Merge remote-tracking branch 'origin/development-3.3' into update_flutter_3.16.0

# Conflicts:
#	android/app/build.gradle
#	android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt
#	android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt
#	android/build.gradle
#	android/gradle/wrapper/gradle-wrapper.properties
#	ios/Runner.xcodeproj/project.pbxproj
#	ios/Runner/Info.plist
#	lib/client/base_app_client.dart
#	lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart
#	lib/core/model/SOAP/assessment/post_assessment_request_model.dart
#	lib/core/model/admissionRequest/admission-request.dart
#	lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart
#	lib/core/model/doctor/clinic_model.dart
#	lib/core/model/hospitals/get_hospitals_request_model.dart
#	lib/core/model/labs/patient_lab_orders.dart
#	lib/core/model/patient/get_doctor_by_clinic_id_request.dart
#	lib/core/model/patient/vital_sign/patient-vital-sign-data.dart
#	lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart
#	lib/core/model/radiology/final_radiology.dart
#	lib/core/service/AnalyticsService.dart
#	lib/core/service/VideoCallService.dart
#	lib/core/service/authentication_service.dart
#	lib/core/service/hospitals/hospitals_service.dart
#	lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart
#	lib/core/service/patient_medical_file/lab_order/labs_service.dart
#	lib/core/service/patient_medical_file/radiology/radiology_service.dart
#	lib/core/service/pending_order_service.dart
#	lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart
#	lib/core/viewModel/SOAP_view_model.dart
#	lib/core/viewModel/authentication_view_model.dart
#	lib/core/viewModel/dashboard_view_model.dart
#	lib/core/viewModel/doctor_replay_view_model.dart
#	lib/core/viewModel/patient-ucaf-viewmodel.dart
#	lib/core/viewModel/procedure_View_model.dart
#	lib/core/viewModel/radiology_view_model.dart
#	lib/screens/ER_singin/ER_singin_screen.dart
#	lib/screens/auth/login_screen.dart
#	lib/screens/auth/verification_methods_screen.dart
#	lib/screens/live_care/video_call.dart
#	lib/screens/medical-file/medical_file_details.dart
#	lib/screens/medicine/medicine_search_screen.dart
#	lib/screens/patients/DischargedPatientPage.dart
#	lib/screens/patients/ECGPage.dart
#	lib/screens/patients/out_patient/out_patient_screen.dart
#	lib/screens/patients/profile/admission_request/admission_request_first_screen.dart
#	lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart
#	lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart
#	lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart
#	lib/screens/patients/profile/notes/note/progress_note_screen.dart
#	lib/screens/patients/profile/notes/note/update_note.dart
#	lib/screens/patients/profile/operation_report/update_operation_report.dart
#	lib/screens/patients/profile/profile_screen/patient_profile_screen.dart
#	lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart
#	lib/screens/patients/profile/radiology/radiology_details_page.dart
#	lib/screens/patients/profile/radiology/radiology_home_page.dart
#	lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart
#	lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart
#	lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart
#	lib/screens/patients/profile/soap_update/objective/update_objective_page.dart
#	lib/screens/patients/profile/soap_update/plan/update_plan_page.dart
#	lib/screens/patients/profile/soap_update/soap_utils.dart
#	lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart
#	lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart
#	lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart
#	lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart
#	lib/screens/patients/profile/vital_sign/line_chart_curved.dart
#	lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart
#	lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart
#	lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart
#	lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart
#	lib/screens/prescription/add_prescription/prescription_form_widget.dart
#	lib/screens/prescription/old_prescriptions_page.dart
#	lib/screens/prescription/prescription_checkout_screen.dart
#	lib/screens/procedures/add_procedure_page.dart
#	lib/screens/procedures/entity_list_checkbox_search_widget.dart
#	lib/screens/reschedule_leaves/reschedule_leave.dart
#	lib/utils/translations_delegate_base_utils.dart
#	lib/utils/utils.dart
#	lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart
#	lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart
#	lib/widgets/shared/app_scaffold_widget.dart
#	lib/widgets/shared/app_texts_widget.dart
#	lib/widgets/shared/dialogs/dailog-list-select.dart
#	lib/widgets/shared/dialogs/master_key_dailog.dart
#	lib/widgets/shared/dialogs/search-drugs-dailog-list.dart
#	lib/widgets/shared/text_fields/TextFields.dart
#	lib/widgets/shared/text_fields/html_rich_editor.dart
#	pubspec.lock
#	pubspec.yaml
update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
commit dc802e2bda

@ -26,11 +26,11 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 34 compileSdkVersion 33
signingConfigs { signingConfigs {
release { release {
storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key') storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor_app_key')
storePassword 'Hmgdoctor1234' storePassword 'Hmgdoctor1234'
keyAlias 'hmgdoctor' keyAlias 'hmgdoctor'
keyPassword 'Hmgdoctor1234' keyPassword 'Hmgdoctor1234'
@ -59,8 +59,7 @@ android {
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
signingConfig signingConfigs.debug signingConfig signingConfigs.release
} }
debug { debug {
@ -91,8 +90,6 @@ flutter {
source '../..' source '../..'
} }
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.1.0'
@ -115,8 +112,5 @@ dependencies {
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0' implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
implementation 'com.google.firebase:firebase-analytics:17.4.1' implementation 'com.google.firebase:firebase-analytics:17.4.1'
implementation 'com.android.support:multidex:2.0.1'
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'

@ -42,6 +42,7 @@
android:exported="true" android:exported="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:exported="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

@ -17,8 +17,8 @@ import android.widget.Toast
import androidx.annotation.NonNull import androidx.annotation.NonNull
import com.google.gson.GsonBuilder import com.google.gson.GsonBuilder
import com.hmg.hmgDr.Service.VideoStreamFloatingWidgetService import com.hmg.hmgDr.Service.VideoStreamFloatingWidgetService
import com.hmg.hmgDr.model.GetSessionStatusModel import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.ui.VideoCallResponseListener import com.hmg.hmgDr.ui.VideoCallResponseListener
import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine import io.flutter.embedding.engine.FlutterEngine

@ -133,10 +133,10 @@ abstract class BaseMovingFloatingWidget : Service() {
return true return true
} }
override fun onDoubleTap(e: MotionEvent): Boolean { // override fun onDoubleTap(e: MotionEvent?): Boolean {
miniCircleDoubleTap() // miniCircleDoubleTap()
return super.onDoubleTap(e) // return super.onDoubleTap(e)
} // }
} }

@ -1,8 +1,8 @@
package com.hmg.hmgDr.Service; package com.hmg.hmgDr.Service;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel; import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel; import com.hmg.hmgDr.Model.SessionStatusModel;
import retrofit2.Call; import retrofit2.Call;

@ -17,6 +17,9 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat import androidx.core.view.GestureDetectorCompat
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.R import com.hmg.hmgDr.R
import com.hmg.hmgDr.model.* import com.hmg.hmgDr.model.*
import com.hmg.hmgDr.ui.VideoCallContract import com.hmg.hmgDr.ui.VideoCallContract

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model; package com.hmg.hmgDr.Model;
import android.os.Parcel; import android.os.Parcel;

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model; package com.hmg.hmgDr.Model;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model; package com.hmg.hmgDr.Model;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;

@ -1,8 +1,8 @@
package com.hmg.hmgDr.ui; package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel; import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel; import com.hmg.hmgDr.Model.SessionStatusModel;
public interface VideoCallContract { public interface VideoCallContract {

@ -1,8 +1,8 @@
package com.hmg.hmgDr.ui; package com.hmg.hmgDr.ui;
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel;
import com.hmg.hmgDr.model.GetSessionStatusModel; import com.hmg.hmgDr.Model.GetSessionStatusModel;
import com.hmg.hmgDr.model.SessionStatusModel; import com.hmg.hmgDr.Model.SessionStatusModel;
import com.hmg.hmgDr.Service.AppRetrofit; import com.hmg.hmgDr.Service.AppRetrofit;
import com.hmg.hmgDr.Service.SessionStatusAPI; import com.hmg.hmgDr.Service.SessionStatusAPI;

@ -20,9 +20,9 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat import androidx.core.view.GestureDetectorCompat
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.model.GetSessionStatusModel import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.R import com.hmg.hmgDr.R
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView
@ -143,8 +143,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
return R.style.dialogTheme return R.style.dialogTheme
} }
@SuppressLint("UseRequireInsteadOfGet")
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme
val layoutInflater = activity!!.layoutInflater val layoutInflater = requireActivity().layoutInflater
this.parentView = onCreateView(layoutInflater, null) this.parentView = onCreateView(layoutInflater, null)
val alertDialogBuilder: AlertDialog.Builder = val alertDialogBuilder: AlertDialog.Builder =
@ -230,7 +231,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
handleDragDialog() handleDragDialog()
mDetector = GestureDetectorCompat( mDetector = GestureDetectorCompat(
requireContext(), requireContext(),
MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() }) MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() })
) )
@ -772,16 +773,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = val mCallBtnLayoutParam: ConstraintLayout.LayoutParams =
mCallBtn.layoutParams as ConstraintLayout.LayoutParams mCallBtn.layoutParams as ConstraintLayout.LayoutParams
val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() val iconSize: Int = requireContext().resources.getDimension(R.dimen.video_icon_size).toInt()
val iconSizeSmall: Int = val iconSizeSmall: Int =
context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() requireContext().resources.getDimension(R.dimen.video_icon_size_small).toInt()
val localPreviewMargin: Int = val localPreviewMargin: Int =
context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() requireContext().resources.getDimension(R.dimen.local_preview_margin_top).toInt()
val localPreviewWidth: Int = val localPreviewWidth: Int =
context!!.resources.getDimension(R.dimen.local_preview_width).toInt() requireContext().resources.getDimension(R.dimen.local_preview_width).toInt()
val localPreviewHeight: Int = val localPreviewHeight: Int =
context!!.resources.getDimension(R.dimen.local_preview_height).toInt() requireContext().resources.getDimension(R.dimen.local_preview_height).toInt()
// val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt() // val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt()
// val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt() // val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt()
// val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt() // val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt()
@ -792,9 +793,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams
val remotePreviewIconSize: Int = val remotePreviewIconSize: Int =
context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() requireContext().resources.getDimension(R.dimen.remote_back_icon_size).toInt()
val remotePreviewIconSizeSmall: Int = val remotePreviewIconSizeSmall: Int =
context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() requireContext().resources.getDimension(R.dimen.remote_back_icon_size_small).toInt()
val remotePreviewLayoutParam: FrameLayout.LayoutParams = val remotePreviewLayoutParam: FrameLayout.LayoutParams =
mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams
@ -884,17 +885,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
controlPanel.layoutParams as ConstraintLayout.LayoutParams controlPanel.layoutParams as ConstraintLayout.LayoutParams
val layoutNameHeight: Int = val layoutNameHeight: Int =
context!!.resources.getDimension(R.dimen.layout_name_height).toInt() requireContext().resources.getDimension(R.dimen.layout_name_height).toInt()
val layoutMiniHeight: Int = val layoutMiniHeight: Int =
context!!.resources.getDimension(R.dimen.layout_mini_height).toInt() requireContext().resources.getDimension(R.dimen.layout_mini_height).toInt()
val panelHeight: Int = context!!.resources.getDimension(R.dimen.layout_panel_height).toInt() val panelHeight: Int = requireContext().resources.getDimension(R.dimen.layout_panel_height).toInt()
val panelHeightSmall: Int = val panelHeightSmall: Int =
context!!.resources.getDimension(R.dimen.layout_panel_height_small).toInt() requireContext().resources.getDimension(R.dimen.layout_panel_height_small).toInt()
val panelPadding: Int = val panelPadding: Int =
context!!.resources.getDimension(R.dimen.padding_space_big).toInt() requireContext().resources.getDimension(R.dimen.padding_space_big).toInt()
val panelPaddingMedium: Int = val panelPaddingMedium: Int =
context!!.resources.getDimension(R.dimen.padding_space_medium).toInt() requireContext().resources.getDimension(R.dimen.padding_space_medium).toInt()
val temp = getStatusBarHeight() / 2 val temp = getStatusBarHeight() / 2
@ -1152,10 +1153,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
return true return true
} }
override fun onDoubleTap(e: MotionEvent): Boolean { // override fun onDoubleTap(e: MotionEvent?): Boolean {
miniCircleDoubleTap() // miniCircleDoubleTap()
return super.onDoubleTap(e) // return super.onDoubleTap(e)
} // }
} }

@ -1,14 +1,14 @@
buildscript { buildscript {
ext.kotlin_version = '1.8.21' ext.kotlin_version = '1.7.20'
repositories { repositories {
google() google()
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.3.0' classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.14' classpath 'com.google.gms:google-services:4.3.3'
} }
} }
@ -31,6 +31,6 @@ subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
tasks.register("clean", Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

@ -1,5 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip

Binary file not shown.

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '11.0' platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -38,10 +38,24 @@ target 'Runner' do
# Plugin Pods # Plugin Pods
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target) flutter_additional_ios_build_settings(target)
target.build_configurations.each do |build_configuration|
build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_CAMERA=1',
'PERMISSION_MICROPHONE=1',
]
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle'
build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF'
end
end
end end
end end

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 54; objectVersion = 50;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -14,8 +14,8 @@
30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; }; 30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; };
30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; }; 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4E9718EA62661304F55A32D /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@ -37,13 +37,10 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; }; 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; };
29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; }; 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = "<group>"; }; 300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = "<group>"; };
300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; }; 300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = "<group>"; }; 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = "<group>"; };
@ -61,7 +58,10 @@
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = "<group>"; }; 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = "<group>"; };
9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = "<group>"; }; 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = "<group>"; };
E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
E4E9718EA62661304F55A32D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -69,7 +69,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */, 7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -104,9 +104,9 @@
7D66D387293CE5376A07EC5F /* Pods */ = { 7D66D387293CE5376A07EC5F /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */, C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */,
E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */, C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */,
0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */, E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */,
); );
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
@ -129,7 +129,7 @@
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */, 97C146EF1CF9000F007C117D /* Products */,
7D66D387293CE5376A07EC5F /* Pods */, 7D66D387293CE5376A07EC5F /* Pods */,
C1938275850F66EAA5D7AC0F /* Frameworks */, A9562A4C43D78E443FA8BFD1 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -171,10 +171,10 @@
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C1938275850F66EAA5D7AC0F /* Frameworks */ = { A9562A4C43D78E443FA8BFD1 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */, E4E9718EA62661304F55A32D /* Pods_Runner.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@ -186,14 +186,14 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = ( buildPhases = (
C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */, 4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */, C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -210,11 +210,12 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1430; LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 3A359E86ZF;
LastSwiftMigration = 1100; LastSwiftMigration = 1100;
}; };
}; };
@ -255,12 +256,10 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
); );
name = "Thin Binary"; name = "Thin Binary";
outputPaths = ( outputPaths = (
@ -269,7 +268,43 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */ = { 4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -306,11 +341,14 @@
"${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework", "${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework",
"${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", "${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework", "${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework",
"${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
"${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework",
"${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
"${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
@ -344,54 +382,20 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
@ -484,12 +488,12 @@
}; };
249021D4217E4FDB00AE95B9 /* Profile */ = { 249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -497,10 +501,7 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -516,6 +517,7 @@
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@ -622,12 +624,12 @@
}; };
97C147061CF9000F007C117D /* Debug */ = { 97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -635,10 +637,7 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -655,13 +654,13 @@
}; };
97C147071CF9000F007C117D /* Release */ = { 97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -669,10 +668,7 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -697,7 +693,7 @@
249021D3217E4FDB00AE95B9 /* Profile */, 249021D3217E4FDB00AE95B9 /* Profile */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Debug;
}; };
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
@ -707,7 +703,7 @@
249021D4217E4FDB00AE95B9 /* Profile */, 249021D4217E4FDB00AE95B9 /* Profile */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Debug;
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };

@ -67,7 +67,5 @@
<false/> <false/>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>

@ -0,0 +1,4 @@
storePassword=HmGsa123
keyPassword=HmGsa123
keyAlias=hmgdoctor
storeFile=doctor_app_key

@ -1,3 +1,5 @@
//@dart=2.9
import 'dart:convert'; import 'dart:convert';
import 'dart:io' show Platform; import 'dart:io' show Platform;
@ -7,22 +9,24 @@ import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../locator.dart';
import '../routes.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Utils helpers = new Utils(); Utils helpers = new Utils();
class BaseAppClient { class BaseAppClient {
//TODO change the post fun to nun static when you change all service //TODO change the post fun to nun static when you change all service
post(String endPoint, post(String endPoint,
{required Map<String, dynamic> body, {Map<String, dynamic> body,
required Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isAllowAny = false,
bool isLiveCare = false, bool isLiveCare = false,
bool isFallLanguage = false}) async { bool isFallLanguage = false}) async {
@ -34,28 +38,34 @@ class BaseAppClient {
bool callLog = true; bool callLog = true;
try { try {
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String? token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) { if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
} }
if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile.projectID; body['ProjectID'] = doctorProfile?.projectID;
} }
if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID; if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID;
} else { } else {
String? doctorID = await sharedPref.getString(DOCTOR_ID); String doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] = null; body['DoctorID'] = null;
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID); } else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
} }
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID);
if (body['EditedBy'] == '') { if (body['EditedBy'] == '') {
body.remove("EditedBy"); body.remove("EditedBy");
} }
@ -64,7 +74,7 @@ class BaseAppClient {
} }
if (!isFallLanguage) { if (!isFallLanguage) {
String? lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar') if (lang != null && lang == 'ar')
body['LanguageID'] = 1; body['LanguageID'] = 1;
else else
@ -88,10 +98,7 @@ class BaseAppClient {
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
} }
int? projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
// if (projectID != null) {
// projectID = 2;
// }
if (projectID == 2 || projectID == 3) if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true; body['PatientOutSA'] = true;
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3) else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3)
@ -99,9 +106,23 @@ class BaseAppClient {
else else
body['PatientOutSA'] = false; body['PatientOutSA'] = false;
// if (!body.containsKey('ProjectID')) {
// if (projectID != null) {
// body['ProjectID'] = projectID;
// } else {
// body['ProjectID'] = 0;
// }
// }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
print("URL : $url");
print("Body : ${json.encode(body)}"); // body['DoctorID'] = 1002; //3844083
// body['TokenID'] = "@dm!n";
// print("ProjectID :");
// print(body['ProjectID']);
debugPrint("URL : $url");
debugPrint("Body : ${json.encode(body)}");
var asd = json.encode(body); var asd = json.encode(body);
var asd2; var asd2;
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
@ -111,6 +132,7 @@ class BaseAppClient {
onFailure(Utils.generateContactAdminMsg(), statusCode); onFailure(Utils.generateContactAdminMsg(), statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
print("Response : $parsed");
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']);
} }
@ -145,11 +167,12 @@ class BaseAppClient {
} }
} }
postPatient(String endPoint, postPatient(String endPoint,
{required Map<String, dynamic> body, {Map<String, dynamic> body,
required Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
PatiantInformtion? patient, @required PatiantInformtion patient,
bool isExternal = false}) async { bool isExternal = false}) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
@ -157,20 +180,23 @@ class BaseAppClient {
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) { if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
} }
} }
if (body['DoctorID'] == 0) {
body['DoctorID'] = null;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: SETUP_ID : await sharedPref.getString(DOCTOR_SETUP_ID)
: SETUP_ID; : await sharedPref.getString(DOCTOR_SETUP_ID);
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
@ -197,7 +223,7 @@ class BaseAppClient {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: patient!.patientType != null : patient.patientType != null
? patient.patientType ? patient.patientType
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
@ -205,13 +231,13 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: patient!.patientType != null : patient.patientType != null
? patient.patientType ? patient.patientType
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN;
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
@ -222,8 +248,21 @@ class BaseAppClient {
else else
body['PatientOutSA'] = false; body['PatientOutSA'] = false;
// if(!body.containsKey('ProjectID')) {
// if (projectID != null) {
// body['ProjectID'] = 313;
// } else {
// body['ProjectID'] = 0;
// }
// }
// body['DoctorID'] = 24; //3844083
// body['TokenID'] = "@dm!n";
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
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);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -308,4 +347,19 @@ class BaseAppClient {
} }
return error; return error;
} }
get({String endPoint,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async{
String token = await sharedPref.getString(TOKEN);
String url = DOCTOR_ROTATION + endPoint+'&token='+token;
final response = await http.get(Uri.parse(url));
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode);
} else {
var parsed = json.decode(response.body.toString());
onSuccess(parsed,statusCode);
}
}
} }

@ -5,119 +5,95 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://webservices.hmg.com/';
// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL
// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
"Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_INSURANCE_APPROVALS_URL = const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor";
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_REFER_TO_DOCTOR_URL =
"Services/DoctorApplication.svc/REST/ReferToDoctor"; const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL =
"Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
"Services/Doctors.svc/REST/SearchDoctorsByTime";
const GET_CLINICS_FOR_DOCTOR =
'Services/DoctorApplication.svc/REST/GetClinicsForDoctor';
const PATIENT_GET_LIST_REFERAL_URL =
"Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL =
"Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
const GET_REFERRAL_FACILITIES = const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_VITAL_SIGN_DATA = const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS =
'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_LIVECARE_PENDINGLIST = const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER';
'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient';
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
"Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
const GET_PRESCRIPTION_REPORT = const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport';
'Services/Patients.svc/REST/GetPrescriptionReport';
const GT_MY_PATIENT_QUESTION = const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const PRM_SEARCH_PATIENT = const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM';
'Services/Patients.svc/REST/GetPatientInformation_PRM';
const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_MY_REFERRAL_PATIENT = const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor';
const ADD_REFERRED_DOCTOR_REMARKS = const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const GET_MY_REFERRED_PATIENT = const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_OUT_PATIENT = const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_PENDING_REFERRAL_PATIENT = const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT = const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral';
'Services/DoctorApplication.svc/REST/CreateReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT = const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral';
'Services/DoctorApplication.svc/REST/RespondReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF';
const GET_DOCTOR_WORKING_HOURS_TABLE = const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_PATIENT_LAB_RESULTS = const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults';
'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI = const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
// 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
// const SELECT_DEVICE_IMEI = // const SELECT_DEVICE_IMEI =
// 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SELECT_DEVICE_IMEI = const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode';
'Services/DoctorApplication.svc/REST/SendVerificationCode'; const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
@ -125,268 +101,182 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction';
const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD = const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const GET_SICKLEAVE_STATISTIC = const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList';
'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_COVERING_DOCTORS = const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition';
const UPDATE_RESCHDEULE = const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition';
'Services/DoctorApplication.svc/REST/PatchRequisition'; const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_RESCHEDULE_LEAVE = const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription';
'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/GetPrescription';
const POST_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_IN_PATIENT_LIST = const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient';
'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks = const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
///Lab Order ///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
'Services/Patients.svc/REST/GetPatientLabSpecialResults'; const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const SEND_LAB_RESULT_EMAIL = const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
'Services/Notifications.svc/REST/SendLabReportEmail'; const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_Patient_LAB_RESULT = const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION =
'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
// SOAP // SOAP
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode';
const POST_EPISODE_FOR_IN_PATIENT = const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT = const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PHYSICAL_EXAM = const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote';
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment';
const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies';
const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory';
const PATCH_CHIEF_COMPLAINT = const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_PHYSICAL_EXAM = const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_PROGRESS_NOTE =
'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment';
const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory';
const GET_CHIEF_COMPLAINT = const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam';
const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_LIST_CATEGORISE = const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure';
'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure';
const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION = const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription';
'Services/DoctorApplication.svc/REST/PatchPrescription';
const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG = const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_ROOM_CATEGORIES = const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories';
'Services/DoctorApplication.svc/REST/GetRoomCategories'; const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIAGNOSIS_TYPES =
'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
const POST_ADMISSION_REQUEST = const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const GET_ITEM_BY_MEDICINE =
'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const GET_PROCEDURE_VALIDATION = const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures';
'Services/DoctorApplication.svc/REST/ValidateProcedures'; const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
const GET_BOX_QUANTITY =
'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
///GET ECG ///GET ECG
const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
"Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUT_PATIENT = const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
"Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT = const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
"Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
"Services/Patients.svc/REST/GetApprovalStatus";
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_IN_PATIENT_ORDERS = const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
'Services/DoctorApplication.svc/REST/GetPatientRadResult';
///Prescriptions ///Prescriptions
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT_NEW = const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
'Services/Patients.svc/REST/INP_GetPrescriptionReport'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const SEND_PRESCRIPTION_EMAIL = const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
'Services/Notifications.svc/REST/SendPrescriptionEmail'; const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT =
"Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT =
"Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave";
const GET_MY_OUT_PATIENT = const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
"Services/DoctorApplication.svc/REST/GetMyOutPatient";
const PATIENT_MEDICAL_REPORT_GET_LIST = const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport";
"Services/Patients.svc/REST/DAPP_ListMedicalReport"; const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport";
"Services/Patients.svc/REST/DAPP_GetTemplateByID"; const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const PATIENT_MEDICAL_REPORT_INSERT =
"Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED =
"Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const GET_PROCEDURE_TEMPLETE = const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet';
const GET_PROCEDURE_TEMPLETE_DETAILS = const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
"Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const DOCTOR_CHECK_HAS_LIVE_CARE = const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
"Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW = const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
"Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_LIST = const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const INSERT_MEDICAL_REPORT = const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves";
"Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const UPDATE_MEDICAL_REPORT =
"Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const GET_SICK_LEAVE_DOCTOR_APP =
"Services/DoctorApplication.svc/REST/GetAllSickLeaves";
const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor";
const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
const CREATE_DOCTOR_RESPONSE = const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse";
"Services/DoctorApplication.svc/REST/CreateDoctorResponse"; const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const GET_DOCTOR_NOT_REPLIED_COUNTS = const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL";
"Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
const ALL_SPECIAL_LAB_RESULT = const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
"services/Patients.svc/REST/GetPatientLabSpecialResultsALL";
const GET_MEDICATION_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
///Operation Details Services ///Operation Details Services
const GET_RESERVATIONS = const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
"Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const GET_OPERATION_DETAILS = const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
"Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT =
"Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const NURSING_PROGRESS_NOTE = const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";
"Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const GET_DIAGNOSIS_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const GET_DIABETIC_CHART_VALUES = const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_PENDING_ORDERS = const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_ADMISSION_ORDERS = const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
"/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
///Patient Registration Services ///Patient Registration Services
const CHECK_PATIENT_FOR_REGISTRATION = const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration";
"Services/Authentication.svc/REST/CheckPatientForRegisteration"; const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode";
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION =
"Services/Authentication.svc/REST/PatientRegistration";
const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo";
/// Discharge Summary /// Discharge Summary
const GET_PENDING_DISCHARGE_SUMMARY = const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo";
const VTE_ASSESSMENT = const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications";
"Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo";
const GET_INTERVENTION_MEDICATION = const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory";
"Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications";
const GET_INTERVENTION_MEDICATION_HISTORY = const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention";
"Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory";
const SET_ACCEPTED_OR_REJECTED = const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
"Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention";
const GET_STP_MASTER_LIST = const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
"Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const DOCTOR_ER_SIGN_ASSESSMENT = const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser";
"Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
var selectedPatientType = 1; var selectedPatientType = 1;
@ -411,26 +301,8 @@ var SERVICES_PATIANT2 = [
"List_MyReferralPatient", "List_MyReferralPatient",
"patientArrivalList" "patientArrivalList"
]; ];
var SERVICES_PATIANT_HEADER = [ var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"];
"My OutPatient", var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"];
"My InPatient",
"Discharge",
"Referred",
"Referral Discharge",
"Tomorrow",
"Referral",
"Arrival Patient"
];
var SERVICES_PATIANT_HEADER_AR = [
"المريض الخارجي",
"المريض المنوم",
"المريض المعافى",
"المريض المحول الي",
"المريض المحال المعافى",
"مريض الغد",
"المريض المحول مني",
"المريض الواصل"
];
const PRIMARY_COLOR = 0xff515B5D; const PRIMARY_COLOR = 0xff515B5D;
@ -438,7 +310,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 8.3; const VERSION_ID = 8.7;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;
@ -450,7 +322,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958';
const PATIENT_TYPE = 1; const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1; const PATIENT_TYPE_ID = 1;
/// Timer Info /// Timer Info
const TIMER_MIN = 10; const TIMER_MIN = 10;
@ -459,7 +330,6 @@ class AppGlobal {
static Color appRedColor = Color(0xFFD02127); static Color appRedColor = Color(0xFFD02127);
static Color appGreenColor = Color(0xFF359846); static Color appGreenColor = Color(0xFF359846);
static Color appTextColor = Color(0xFF2B353E); static Color appTextColor = Color(0xFF2B353E);
static Color scheduleTextColor = Color(0xFF2E303A); static Color scheduleTextColor = Color(0xFF2E303A);
static Color inProgressColor = Color(0xFFCC9B14); static Color inProgressColor = Color(0xFFCC9B14);
} }

@ -800,7 +800,7 @@ const Map<String, Map<String, String>> localizedValues = {
"open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"},
"fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "},
"searchPatient-name": { "searchPatient-name": {
"en": "Search Name, Medical File, Phone Number", "en": "Search Medical File, Phone Number",
"ar": "اسم البحث ، الملف الطبي ، رقم الهاتف" "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"
}, },
"reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"},
@ -1146,4 +1146,9 @@ const Map<String, Map<String, String>> localizedValues = {
"yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"}, "yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"},
"youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""}, "youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""},
"conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"}, "conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"},
"doctorSchedule": {"en": "Doctor Schedule", "ar":"جدول الطبيب"},
"doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"},
"dateFrom": {"en": "Date From", "ar":"التاريخ من"},
"searchFindSchedule": {"en": "Search and find out the doctors schedule ", "ar":"بحث ومعرفة جدول الطبيب"}
}; };

@ -14,3 +14,4 @@ const DASHBOARD_DATA = 'dashboard-data';
const OTP_TYPE = 'otp-type'; const OTP_TYPE = 'otp-type';
const LAST_LOGIN_USER = 'last-login-user'; const LAST_LOGIN_USER = 'last-login-user';
const CLINIC_NAME = 'clinic-name'; const CLINIC_NAME = 'clinic-name';
const DOCTOR_SETUP_ID = 'doctor-setup-id';

@ -1,14 +1,18 @@
class DoctorErSignAssessmentReqModel { class DoctorErSignAssessmentReqModel {
String? setupID; // String setupID;
int? signInType; int signInType;
int? loginDoctorID; int loginDoctorID;
int? patientID; int patientID;
DoctorErSignAssessmentReqModel( DoctorErSignAssessmentReqModel(
{this.setupID, this.signInType, this.loginDoctorID, this.patientID}); {
// this.setupID,
this.signInType,
this.loginDoctorID,
this.patientID});
DoctorErSignAssessmentReqModel.fromJson(Map<String, dynamic> json) { DoctorErSignAssessmentReqModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; // setupID = json['SetupID'];
signInType = json['SignInType']; signInType = json['SignInType'];
loginDoctorID = json['LoginDoctorID']; loginDoctorID = json['LoginDoctorID'];
patientID = json['PatientID']; patientID = json['PatientID'];
@ -16,7 +20,7 @@ class DoctorErSignAssessmentReqModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID; // data['SetupID'] = this.setupID;
data['SignInType'] = this.signInType; data['SignInType'] = this.signInType;
data['LoginDoctorID'] = this.loginDoctorID; data['LoginDoctorID'] = this.loginDoctorID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;

@ -1,23 +1,29 @@
class PostAssessmentRequestModel { class PostAssessmentRequestModel {
int? patientMRN; int patientMRN;
int? appointmentNo; int appointmentNo;
int? episodeId; int episodeId;
List<IcdCodeDetails>? icdCodeDetails; String createdByName;
int createdBy;
List<IcdCodeDetails> icdCodeDetails;
PostAssessmentRequestModel( PostAssessmentRequestModel(
{this.patientMRN, {this.patientMRN,
this.appointmentNo, this.appointmentNo,
this.episodeId, this.episodeId,
this.createdByName,
this.createdBy,
this.icdCodeDetails}); this.icdCodeDetails});
PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) { PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeID']; episodeId = json['EpisodeID'];
createdByName = json['CreatedByName'];
createdBy= json['CreatedBy'];
if (json['icdCodeDetails'] != null) { if (json['icdCodeDetails'] != null) {
icdCodeDetails = <IcdCodeDetails>[]; icdCodeDetails = new List<IcdCodeDetails>();
json['icdCodeDetails'].forEach((v) { json['icdCodeDetails'].forEach((v) {
icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); icdCodeDetails.add(new IcdCodeDetails.fromJson(v));
}); });
} }
} }
@ -27,20 +33,22 @@ class PostAssessmentRequestModel {
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeId; data['EpisodeID'] = this.episodeId;
data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy;
if (this.icdCodeDetails != null) { if (this.icdCodeDetails != null) {
data['icdCodeDetails'] = data['icdCodeDetails'] =
this.icdCodeDetails!.map((v) => v.toJson()).toList(); this.icdCodeDetails.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class IcdCodeDetails { class IcdCodeDetails {
String? icdcode10Id; String icdcode10Id;
int? conditionId; int conditionId;
int? diagnosisTypeId; int diagnosisTypeId;
bool? complexDiagnosis; bool complexDiagnosis;
String? remarks; String remarks;
IcdCodeDetails( IcdCodeDetails(
{this.icdcode10Id, {this.icdcode10Id,

@ -5,6 +5,8 @@ class PostProgressNoteRequestModel {
String? planNote; String? planNote;
dynamic doctorID; dynamic doctorID;
dynamic editedBy; dynamic editedBy;
String createdByName;
int createdBy;
PostProgressNoteRequestModel( PostProgressNoteRequestModel(
{this.appointmentNo, {this.appointmentNo,
@ -12,7 +14,10 @@ class PostProgressNoteRequestModel {
this.patientMRN, this.patientMRN,
this.planNote, this.planNote,
this.doctorID, this.doctorID,
this.editedBy}); this.editedBy,
this.createdByName,
this.createdBy
});
PostProgressNoteRequestModel.fromJson(Map<String, dynamic> json) { PostProgressNoteRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
@ -21,6 +26,8 @@ class PostProgressNoteRequestModel {
planNote = json['PlanNote']; planNote = json['PlanNote'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
editedBy = json['EditedBy']; editedBy = json['EditedBy'];
createdByName = json['CreatedByName'];
createdBy = json['CreatedBy'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -31,6 +38,8 @@ class PostProgressNoteRequestModel {
data['PlanNote'] = this.planNote; data['PlanNote'] = this.planNote;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy; data['EditedBy'] = this.editedBy;
data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy;
return data; return data;
} }
} }

@ -1,190 +1,199 @@
class AdmissionRequest { class AdmissionRequest {
int? patientMRN; int patientMRN;
int? admitToClinic; int admitToClinic;
bool? isPregnant; bool isPregnant;
int? pregnancyWeeks; int pregnancyWeeks;
int? pregnancyType; int pregnancyType;
int? noOfBabies; int noOfBabies;
int? mrpDoctorID; int mrpDoctorID;
String? admissionDate; String admissionDate;
int? expectedDays; int expectedDays;
int? admissionType; int admissionType;
int? admissionLocationID; int admissionLocationID;
int? roomCategoryID; int roomCategoryID;
int? wardID; int wardID;
bool? isSickLeaveRequired; bool isSickLeaveRequired;
String? sickLeaveComments; String sickLeaveComments;
bool? isTransport; bool isTransport;
String? transportComments; String transportComments;
bool? isPhysioAppointmentNeeded; bool isPhysioAppointmentNeeded;
String? physioAppointmentComments; String physioAppointmentComments;
bool? isOPDFollowupAppointmentNeeded; bool isOPDFollowupAppointmentNeeded;
String? opdFollowUpComments; String opdFollowUpComments;
bool? isDietType; bool isDietType;
int? dietType; int dietType;
String? dietRemarks; String dietRemarks;
bool? isPhysicalActivityModification; String diagnosis;
String? physicalActivityModificationComments; bool isPhysicalActivityModification;
int? orStatus; String physicalActivityModificationComments;
String? mainLineOfTreatment; int orStatus;
int? estimatedCost; String mainLineOfTreatment;
String? elementsForImprovement; int estimatedCost;
bool? isPackagePatient; String elementsForImprovement;
String? complications; bool isPackagePatient;
String? otherDepartmentInterventions; String complications;
String? otherProcedures; String otherDepartmentInterventions;
String? pastMedicalHistory; String otherProcedures;
String? pastSurgicalHistory; String pastMedicalHistory;
List<dynamic>? admissionRequestDiagnoses; String pastSurgicalHistory;
List<dynamic>? admissionRequestProcedures; List<dynamic> admissionRequestDiagnoses;
int? appointmentNo; List<dynamic> admissionRequestProcedures;
int? episodeID; int appointmentNo;
int? admissionRequestNo; int episodeID;
int admissionRequestNo;
AdmissionRequest({ AdmissionRequest(
this.patientMRN, {this.patientMRN,
this.admitToClinic, this.admitToClinic,
this.isPregnant, this.isPregnant,
this.pregnancyWeeks, this.pregnancyWeeks = 0,
this.pregnancyType, this.pregnancyType = 0,
this.noOfBabies, this.noOfBabies = 0,
this.mrpDoctorID, this.mrpDoctorID,
this.admissionDate, this.admissionDate,
this.expectedDays, this.expectedDays,
this.admissionType, this.admissionType,
this.admissionLocationID, this.admissionLocationID = 0,
this.roomCategoryID, this.roomCategoryID = 0,
this.wardID, this.wardID,
this.isSickLeaveRequired, this.isSickLeaveRequired,
this.sickLeaveComments, this.sickLeaveComments = "",
this.isTransport, this.isTransport = false,
this.transportComments, this.transportComments = "",
this.isPhysioAppointmentNeeded, this.isPhysioAppointmentNeeded = false,
this.physioAppointmentComments, this.physioAppointmentComments = "",
this.isOPDFollowupAppointmentNeeded, this.isOPDFollowupAppointmentNeeded = false,
this.opdFollowUpComments, this.opdFollowUpComments = "",
this.isDietType, this.isDietType,
this.dietType, this.dietType,
this.dietRemarks, this.dietRemarks,
this.isPhysicalActivityModification, this.diagnosis,
this.physicalActivityModificationComments, this.isPhysicalActivityModification = false,
this.orStatus, this.physicalActivityModificationComments = "",
this.mainLineOfTreatment, this.orStatus = 1,
this.estimatedCost, this.mainLineOfTreatment,
this.elementsForImprovement, this.estimatedCost,
this.isPackagePatient, this.elementsForImprovement,
this.complications, this.isPackagePatient = false,
this.otherDepartmentInterventions, this.complications = "",
this.otherProcedures, this.otherDepartmentInterventions = "",
this.pastMedicalHistory, this.otherProcedures = "",
this.pastSurgicalHistory, this.pastMedicalHistory = "",
this.admissionRequestDiagnoses, this.pastSurgicalHistory = "",
this.admissionRequestProcedures, this.admissionRequestDiagnoses,
this.appointmentNo, this.admissionRequestProcedures,
this.episodeID, this.appointmentNo,
this.admissionRequestNo, this.episodeID,
}); this.admissionRequestNo});
AdmissionRequest.fromJson(Map<String, dynamic>? json) { AdmissionRequest.fromJson(Map<String, dynamic> json) {
if (json != null) { patientMRN = json['patientMRN'];
patientMRN = json['patientMRN']; admitToClinic = json['admitToClinic'];
admitToClinic = json['admitToClinic']; isPregnant = json['isPregnant'];
isPregnant = json['isPregnant']; pregnancyWeeks = json['pregnancyWeeks'];
pregnancyWeeks = json['pregnancyWeeks']; pregnancyType = json['pregnancyType'];
pregnancyType = json['pregnancyType']; noOfBabies = json['noOfBabies'];
noOfBabies = json['noOfBabies']; mrpDoctorID = json['mrpDoctorID'];
mrpDoctorID = json['mrpDoctorID']; admissionDate = json['admissionDate'];
admissionDate = json['admissionDate']; expectedDays = json['expectedDays'];
expectedDays = json['expectedDays']; admissionType = json['admissionType'];
admissionType = json['admissionType']; admissionLocationID = json['admissionLocationID'];
admissionLocationID = json['admissionLocationID']; roomCategoryID = json['roomCategoryID'];
roomCategoryID = json['roomCategoryID']; wardID = json['wardID'];
wardID = json['wardID']; isSickLeaveRequired = json['isSickLeaveRequired'];
isSickLeaveRequired = json['isSickLeaveRequired']; sickLeaveComments = json['sickLeaveComments'];
sickLeaveComments = json['sickLeaveComments']; isTransport = json['isTransport'];
isTransport = json['isTransport']; transportComments = json['transportComments'];
transportComments = json['transportComments']; isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded'];
isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded']; physioAppointmentComments = json['physioAppointmentComments'];
physioAppointmentComments = json['physioAppointmentComments']; isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded'];
isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded']; opdFollowUpComments = json['opdFollowUpComments'];
opdFollowUpComments = json['opdFollowUpComments']; isDietType = json['isDietType'];
isDietType = json['isDietType']; dietType = json['dietType'];
dietType = json['dietType']; dietRemarks = json['dietRemarks'];
dietRemarks = json['dietRemarks']; diagnosis = json['diagnosis'];
isPhysicalActivityModification = isPhysicalActivityModification = json['isPhysicalActivityModification'];
json['isPhysicalActivityModification']; physicalActivityModificationComments = json['physicalActivityModificationComments'];
physicalActivityModificationComments = orStatus = json['orStatus'];
json['physicalActivityModificationComments']; mainLineOfTreatment = json['mainLineOfTreatment'];
orStatus = json['orStatus']; estimatedCost = json['estimatedCost'];
mainLineOfTreatment = json['mainLineOfTreatment']; elementsForImprovement = json['elementsForImprovement'];
estimatedCost = json['estimatedCost']; isPackagePatient = json['isPackagePatient'];
elementsForImprovement = json['elementsForImprovement']; complications = json['complications'];
isPackagePatient = json['isPackagePatient']; otherDepartmentInterventions = json['otherDepartmentInterventions'];
complications = json['complications']; otherProcedures = json['otherProcedures'];
otherDepartmentInterventions = json['otherDepartmentInterventions']; pastMedicalHistory = json['pastMedicalHistory'];
otherProcedures = json['otherProcedures']; pastSurgicalHistory = json['pastSurgicalHistory'];
pastMedicalHistory = json['pastMedicalHistory']; if (json['admissionRequestDiagnoses'] != null) {
pastSurgicalHistory = json['pastSurgicalHistory']; admissionRequestDiagnoses = new List<dynamic>();
if (json['admissionRequestDiagnoses'] != null) { json['admissionRequestDiagnoses'].forEach((v) {
admissionRequestDiagnoses = List<dynamic>.from( admissionRequestDiagnoses.add(v);
json['admissionRequestDiagnoses'], // admissionRequestDiagnoses
); // .add(new AdmissionRequestDiagnoses.fromJson(v));
} });
if (json['admissionRequestProcedures'] != null) {
admissionRequestProcedures = List<dynamic>.from(
json['admissionRequestProcedures'],
);
}
appointmentNo = json['appointmentNo'];
episodeID = json['episodeID'];
admissionRequestNo = json['admissionRequestNo'];
} }
if (json['admissionRequestProcedures'] != null) {
admissionRequestProcedures = new List<dynamic>();
json['admissionRequestProcedures'].forEach((v) {
admissionRequestProcedures.add(v);
// admissionRequestProcedures
// .add(new AdmissionRequestProcedures.fromJson(v));
});
}
appointmentNo = json['appointmentNo'];
episodeID = json['episodeID'];
admissionRequestNo = json['admissionRequestNo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = {}; final Map<String, dynamic> data = new Map<String, dynamic>();
data['patientMRN'] = patientMRN; data['patientMRN'] = this.patientMRN;
data['admitToClinic'] = admitToClinic; data['admitToClinic'] = this.admitToClinic;
data['isPregnant'] = isPregnant; data['isPregnant'] = this.isPregnant;
data['pregnancyWeeks'] = pregnancyWeeks; data['pregnancyWeeks'] = this.pregnancyWeeks;
data['pregnancyType'] = pregnancyType; data['pregnancyType'] = this.pregnancyType;
data['noOfBabies'] = noOfBabies; data['noOfBabies'] = this.noOfBabies;
data['mrpDoctorID'] = mrpDoctorID; data['mrpDoctorID'] = this.mrpDoctorID;
data['admissionDate'] = admissionDate; data['admissionDate'] = this.admissionDate;
data['expectedDays'] = expectedDays; data['expectedDays'] = this.expectedDays;
data['admissionType'] = admissionType; data['admissionType'] = this.admissionType;
data['admissionLocationID'] = admissionLocationID; data['admissionLocationID'] = this.admissionLocationID;
data['roomCategoryID'] = roomCategoryID; data['roomCategoryID'] = this.roomCategoryID;
data['wardID'] = wardID; data['wardID'] = this.wardID;
data['isSickLeaveRequired'] = isSickLeaveRequired; data['isSickLeaveRequired'] = this.isSickLeaveRequired;
data['sickLeaveComments'] = sickLeaveComments; data['sickLeaveComments'] = this.sickLeaveComments;
data['isTransport'] = isTransport; data['isTransport'] = this.isTransport;
data['transportComments'] = transportComments; data['transportComments'] = this.transportComments;
data['isPhysioAppointmentNeeded'] = isPhysioAppointmentNeeded; data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded;
data['physioAppointmentComments'] = physioAppointmentComments; data['physioAppointmentComments'] = this.physioAppointmentComments;
data['isOPDFollowupAppointmentNeeded'] = isOPDFollowupAppointmentNeeded; data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded;
data['opdFollowUpComments'] = opdFollowUpComments; data['opdFollowUpComments'] = this.opdFollowUpComments;
data['isDietType'] = isDietType; data['isDietType'] = this.isDietType;
data['dietType'] = dietType; data['dietType'] = this.dietType;
data['dietRemarks'] = dietRemarks; data['dietRemarks'] = this.dietRemarks;
data['isPhysicalActivityModification'] = isPhysicalActivityModification; data['diagnosis'] = this.diagnosis;
data['physicalActivityModificationComments'] = data['isPhysicalActivityModification'] = this.isPhysicalActivityModification;
physicalActivityModificationComments; data['physicalActivityModificationComments'] = this.physicalActivityModificationComments;
data['orStatus'] = orStatus; data['orStatus'] = this.orStatus;
data['mainLineOfTreatment'] = mainLineOfTreatment; data['mainLineOfTreatment'] = this.mainLineOfTreatment;
data['estimatedCost'] = estimatedCost; data['estimatedCost'] = this.estimatedCost;
data['elementsForImprovement'] = elementsForImprovement; data['elementsForImprovement'] = this.elementsForImprovement;
data['isPackagePatient'] = isPackagePatient; data['isPackagePatient'] = this.isPackagePatient;
data['complications'] = complications; data['complications'] = this.complications;
data['otherDepartmentInterventions'] = otherDepartmentInterventions; data['otherDepartmentInterventions'] = this.otherDepartmentInterventions;
data['otherProcedures'] = otherProcedures; data['otherProcedures'] = this.otherProcedures;
data['pastMedicalHistory'] = pastMedicalHistory; data['pastMedicalHistory'] = this.pastMedicalHistory;
data['pastSurgicalHistory'] = pastSurgicalHistory; data['pastSurgicalHistory'] = this.pastSurgicalHistory;
data['admissionRequestDiagnoses'] = admissionRequestDiagnoses; if (this.admissionRequestDiagnoses != null) {
data['admissionRequestProcedures'] = admissionRequestProcedures; data['admissionRequestDiagnoses'] = this.admissionRequestDiagnoses;
data['appointmentNo'] = appointmentNo; // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList();
data['episodeID'] = episodeID; }
data['admissionRequestNo'] = admissionRequestNo; if (this.admissionRequestProcedures != null) {
data['admissionRequestProcedures'] = this.admissionRequestProcedures.map((v) => v.toJson()).toList();
}
data['appointmentNo'] = this.appointmentNo;
data['episodeID'] = this.episodeID;
data['admissionRequestNo'] = this.admissionRequestNo;
return data; return data;
} }
} }

@ -1,62 +1,79 @@
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
class CheckActivationCodeForDoctorAppResponseModel { class CheckActivationCodeForDoctorAppResponseModel {
String? authenticationTokenID; String authenticationTokenID;
List<ListDoctorsClinic>? listDoctorsClinic; List<ListDoctorsClinic> listDoctorsClinic;
List<DoctorProfileModel>? listDoctorProfile; List<DoctorProfileModel> listDoctorProfile;
MemberInformation? memberInformation; MemberInformation memberInformation;
String? vidaAuthTokenID; String vidaAuthTokenID;
String? vidaRefreshTokenID; String vidaRefreshTokenID;
CheckActivationCodeForDoctorAppResponseModel({this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID}); CheckActivationCodeForDoctorAppResponseModel(
{this.authenticationTokenID,
CheckActivationCodeForDoctorAppResponseModel.fromJson(Map<String, dynamic> json) { this.listDoctorsClinic,
this.memberInformation,
this.listDoctorProfile,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
CheckActivationCodeForDoctorAppResponseModel.fromJson(
Map<String, dynamic> json) {
authenticationTokenID = json['AuthenticationTokenID']; authenticationTokenID = json['AuthenticationTokenID'];
if (json['List_DoctorsClinic'] != null) { if (json['List_DoctorsClinic'] != null) {
listDoctorsClinic = <ListDoctorsClinic>[]; listDoctorsClinic = new List<ListDoctorsClinic>();
json['List_DoctorsClinic'].forEach((v) { json['List_DoctorsClinic'].forEach((v) {
listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v));
}); });
} }
if (json['List_DoctorProfile'] != null) { if (json['List_DoctorProfile'] != null) {
listDoctorProfile = <DoctorProfileModel>[]; listDoctorProfile = new List<DoctorProfileModel>();
json['List_DoctorProfile'].forEach((v) { json['List_DoctorProfile'].forEach((v) {
listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); listDoctorProfile.add(new DoctorProfileModel.fromJson(v));
}); });
} }
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; memberInformation = json['memberInformation'] != null
? new MemberInformation.fromJson(json['memberInformation'])
: null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['AuthenticationTokenID'] = this.authenticationTokenID; data['AuthenticationTokenID'] = this.authenticationTokenID;
if (this.listDoctorsClinic != null) { if (this.listDoctorsClinic != null) {
data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList(); data['List_DoctorsClinic'] =
this.listDoctorsClinic.map((v) => v.toJson()).toList();
} }
if (this.listDoctorProfile != null) { if (this.listDoctorProfile != null) {
data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList(); data['List_DoctorProfile'] =
this.listDoctorProfile.map((v) => v.toJson()).toList();
} }
if (this.memberInformation != null) { if (this.memberInformation != null) {
data['memberInformation'] = this.memberInformation!.toJson(); data['memberInformation'] = this.memberInformation.toJson();
} }
return data; return data;
} }
} }
class ListDoctorsClinic { class ListDoctorsClinic {
String? setupID; String setupID;
int? projectID; int projectID;
int? doctorID; int doctorID;
int? clinicID; int clinicID;
bool? isActive; bool isActive;
String? clinicName; String clinicName;
ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ListDoctorsClinic(
{this.setupID,
this.projectID,
this.doctorID,
this.clinicID,
this.isActive,
this.clinicName});
ListDoctorsClinic.fromJson(Map<String, dynamic> json) { ListDoctorsClinic.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
@ -80,23 +97,32 @@ class ListDoctorsClinic {
} }
class MemberInformation { class MemberInformation {
List<Clinics>? clinics; List<Clinics> clinics;
int? doctorId; int doctorId;
String? email; String email;
int? employeeId; int employeeId;
int? memberId; int memberId;
String? memberName; Null memberName;
String? memberNameArabic; Null memberNameArabic;
String? preferredLanguage; String preferredLanguage;
List<Roles>? roles; List<Roles> roles;
MemberInformation({this.clinics, this.doctorId, this.email, this.employeeId, this.memberId, this.memberName, this.memberNameArabic, this.preferredLanguage, this.roles}); MemberInformation(
{this.clinics,
this.doctorId,
this.email,
this.employeeId,
this.memberId,
this.memberName,
this.memberNameArabic,
this.preferredLanguage,
this.roles});
MemberInformation.fromJson(Map<String, dynamic> json) { MemberInformation.fromJson(Map<String, dynamic> json) {
if (json['clinics'] != null) { if (json['clinics'] != null) {
clinics = <Clinics>[]; clinics = new List<Clinics>();
json['clinics'].forEach((v) { json['clinics'].forEach((v) {
clinics!.add(new Clinics.fromJson(v)); clinics.add(new Clinics.fromJson(v));
}); });
} }
doctorId = json['doctorId']; doctorId = json['doctorId'];
@ -107,9 +133,9 @@ class MemberInformation {
memberNameArabic = json['memberNameArabic']; memberNameArabic = json['memberNameArabic'];
preferredLanguage = json['preferredLanguage']; preferredLanguage = json['preferredLanguage'];
if (json['roles'] != null) { if (json['roles'] != null) {
roles = <Roles>[]; roles = new List<Roles>();
json['roles'].forEach((v) { json['roles'].forEach((v) {
roles!.add(new Roles.fromJson(v)); roles.add(new Roles.fromJson(v));
}); });
} }
} }
@ -117,7 +143,7 @@ class MemberInformation {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.clinics != null) { if (this.clinics != null) {
data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); data['clinics'] = this.clinics.map((v) => v.toJson()).toList();
} }
data['doctorId'] = this.doctorId; data['doctorId'] = this.doctorId;
data['email'] = this.email; data['email'] = this.email;
@ -127,16 +153,16 @@ class MemberInformation {
data['memberNameArabic'] = this.memberNameArabic; data['memberNameArabic'] = this.memberNameArabic;
data['preferredLanguage'] = this.preferredLanguage; data['preferredLanguage'] = this.preferredLanguage;
if (this.roles != null) { if (this.roles != null) {
data['roles'] = this.roles!.map((v) => v.toJson()).toList(); data['roles'] = this.roles.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
} }
class Clinics { class Clinics {
bool? defaultClinic; bool defaultClinic;
int? id; int id;
String? name; String name;
Clinics({this.defaultClinic, this.id, this.name}); Clinics({this.defaultClinic, this.id, this.name});
@ -156,8 +182,8 @@ class Clinics {
} }
class Roles { class Roles {
String? name; String name;
int? roleId; int roleId;
Roles({this.name, this.roleId}); Roles({this.name, this.roleId});

@ -0,0 +1,80 @@
import 'dart:convert';
List<DoctorSchedule> doctorScheduleFromJson(String str) => List<DoctorSchedule>.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x)));
String doctorScheduleToJson(List<DoctorSchedule> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class DoctorSchedule {
int scheduledid;
int status;
String clinicname;
int clinicid;
List<Scheduleforuser> scheduleforuser;
DoctorSchedule({
this.scheduledid,
this.status,
this.clinicname,
this.clinicid,
this.scheduleforuser,
});
factory DoctorSchedule.fromJson(Map<String, dynamic> json) => DoctorSchedule(
scheduledid: json["scheduledid"],
status: json["status"],
clinicname: json["clinicname"],
clinicid: json["clinicid"],
scheduleforuser: List<Scheduleforuser>.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"scheduledid": scheduledid,
"status": status,
"clinicname": clinicname,
"clinicid": clinicid,
"scheduleforuser": List<dynamic>.from(scheduleforuser.map((x) => x.toJson())),
};
}
class Scheduleforuser {
DateTime days;
int duration;
List<Shiftforuser> shiftforuser;
Scheduleforuser({
this.days,
this.duration,
this.shiftforuser,
});
factory Scheduleforuser.fromJson(Map<String, dynamic> json) => Scheduleforuser(
days: DateTime.parse(json["days"]),
duration: json["duration"],
shiftforuser: List<Shiftforuser>.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"days": days.toIso8601String(),
"duration": duration,
"shiftforuser": List<dynamic>.from(shiftforuser.map((x) => x.toJson())),
};
}
class Shiftforuser {
int fromtime;
int totime;
Shiftforuser({
this.fromtime,
this.totime,
});
factory Shiftforuser.fromJson(Map<String, dynamic> json) => Shiftforuser(
fromtime: json["fromtime"],
totime: json["totime"],
);
Map<String, dynamic> toJson() => {
"fromtime": fromtime,
"totime": totime,
};
}

@ -23,7 +23,7 @@ class GetDischargeSummaryReqModel {
data['AdmissionNo'] = this.admissionNo; data['AdmissionNo'] = this.admissionNo;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID; data['PatientTypeID'] = this.patientTypeID;
data['SetupID'] = "010266";
data['isDentalAllowedBackend'] = false; data['isDentalAllowedBackend'] = false;
return data; return data;
} }

@ -1,12 +1,25 @@
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param:
*@return:
*@desc: Clinic Model
*/
class ClinicModel { class ClinicModel {
String? setupID; String setupID;
int? projectID; int projectID;
int? doctorID; int doctorID;
int? clinicID; int clinicID;
bool? isActive; bool isActive;
String? clinicName; String clinicName;
ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); ClinicModel(
{this.setupID,
this.projectID,
this.doctorID,
this.clinicID,
this.isActive,
this.clinicName});
ClinicModel.fromJson(Map<String, dynamic> json) { ClinicModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];

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

@ -1,15 +1,27 @@
class GetHospitalsRequestModel { class GetHospitalsRequestModel {
int? languageID; int languageID;
String? stamp; String stamp;
String? iPAdress; String iPAdress;
double? versionID; double versionID;
int? channel; int channel;
String? tokenID; String tokenID;
String? sessionID; String sessionID;
bool? isLoginForDoctorApp; bool isLoginForDoctorApp;
String? memberID; String memberID;
String doctorID;
GetHospitalsRequestModel({this.languageID, this.stamp, this.iPAdress, this.versionID, this.channel, this.tokenID, this.sessionID, this.isLoginForDoctorApp, this.memberID}); GetHospitalsRequestModel(
{this.languageID,
this.stamp,
this.iPAdress,
this.versionID,
this.channel,
this.tokenID,
this.sessionID,
this.isLoginForDoctorApp,
this.memberID,
this.doctorID,
});
GetHospitalsRequestModel.fromJson(Map<String, dynamic> json) { GetHospitalsRequestModel.fromJson(Map<String, dynamic> json) {
languageID = json['LanguageID']; languageID = json['LanguageID'];
@ -21,6 +33,7 @@ class GetHospitalsRequestModel {
sessionID = json['SessionID']; sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp']; isLoginForDoctorApp = json['IsLoginForDoctorApp'];
memberID = json['MemberID']; memberID = json['MemberID'];
doctorID = json['DoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -34,6 +47,7 @@ class GetHospitalsRequestModel {
data['SessionID'] = this.sessionID; data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['MemberID'] = this.memberID; data['MemberID'] = this.memberID;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -1,43 +1,42 @@
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
class PatientLabOrders { class PatientLabOrders {
int? actualDoctorRate; int actualDoctorRate;
String? clinicDescription; String clinicDescription;
String? clinicDescriptionEnglish; String clinicDescriptionEnglish;
dynamic clinicDescriptionN; Null clinicDescriptionN;
int? clinicID; int clinicID;
int? doctorID; int doctorID;
String? doctorImageURL; String doctorImageURL;
String? doctorName; String doctorName;
String? doctorNameEnglish; String doctorNameEnglish;
dynamic doctorNameN; Null doctorNameN;
int? doctorRate; int doctorRate;
String? doctorTitle; String doctorTitle;
int? gender; int gender;
String? genderDescription; String genderDescription;
String? invoiceNo; String invoiceNo;
bool? isActiveDoctorProfile; bool isActiveDoctorProfile;
bool? isDoctorAllowVedioCall; bool isDoctorAllowVedioCall;
bool? isExecludeDoctor; bool isExecludeDoctor;
bool? isInOutPatient; bool isInOutPatient;
String? isInOutPatientDescription; String isInOutPatientDescription;
String? isInOutPatientDescriptionN; String isInOutPatientDescriptionN;
bool? isRead; bool isRead;
String? nationalityFlagURL; String nationalityFlagURL;
int? noOfPatientsRate; int noOfPatientsRate;
DateTime? orderDate; DateTime orderDate;
DateTime? createdOn; DateTime createdOn;
String? orderNo; String orderNo;
String? patientID; String patientID;
String? projectID; String projectID;
String? projectName; String projectName;
dynamic projectNameN; Null projectNameN;
String? qR; String qR;
String? setupID; String setupID;
List<String>? speciality; List<String> speciality;
bool? isLiveCareAppointment; bool isLiveCareAppointment;
String invoiceType;
PatientLabOrders( PatientLabOrders(
{this.actualDoctorRate, {this.actualDoctorRate,
this.clinicDescription, this.clinicDescription,
@ -72,7 +71,9 @@ class PatientLabOrders {
this.qR, this.qR,
this.setupID, this.setupID,
this.speciality, this.speciality,
this.isLiveCareAppointment}); this.isLiveCareAppointment,
this.invoiceType
});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
@ -109,6 +110,7 @@ class PatientLabOrders {
qR = json['QR']; qR = json['QR'];
setupID = json['SetupID']; setupID = json['SetupID'];
isLiveCareAppointment = json['IsLiveCareAppointment']; isLiveCareAppointment = json['IsLiveCareAppointment'];
invoiceType = json["InvoiceType"];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
} }
@ -148,16 +150,17 @@ 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['InvoiceType'] = this.invoiceType;
return data; return data;
} }
} }
class PatientLabOrdersList { class PatientLabOrdersList {
String filterName = ""; String filterName = "";
List<PatientLabOrders> patientLabOrdersList = []; List<PatientLabOrders> patientLabOrdersList = List();
PatientLabOrdersList( PatientLabOrdersList(
{required this.filterName, PatientLabOrders? patientDoctorAppointment}) { {this.filterName, PatientLabOrders patientDoctorAppointment}) {
patientLabOrdersList.add(patientDoctorAppointment!); patientLabOrdersList.add(patientDoctorAppointment);
} }
} }

@ -1,16 +1,17 @@
class DoctorsByClinicIdRequest { class DoctorsByClinicIdRequest {
int? clinicID; int clinicID;
int? projectID; int projectID;
bool? continueDentalPlan; bool continueDentalPlan;
bool? isSearchAppointmnetByClinicID; bool isSearchAppointmnetByClinicID;
int? patientID; int patientID;
int? gender; int doctorID;
bool? isGetNearAppointment; int gender;
bool? isVoiceCommand; bool isGetNearAppointment;
int? latitude; bool isVoiceCommand;
int? longitude; int latitude;
bool? license; int longitude;
bool? isDentalAllowedBackend; bool license;
bool isDentalAllowedBackend;
DoctorsByClinicIdRequest({ DoctorsByClinicIdRequest({
this.clinicID, this.clinicID,
@ -18,6 +19,7 @@ class DoctorsByClinicIdRequest {
this.continueDentalPlan = false, this.continueDentalPlan = false,
this.isSearchAppointmnetByClinicID = true, this.isSearchAppointmnetByClinicID = true,
this.patientID, this.patientID,
this.doctorID,
this.gender, this.gender,
this.isGetNearAppointment = false, this.isGetNearAppointment = false,
this.isVoiceCommand = true, this.isVoiceCommand = true,
@ -30,6 +32,7 @@ class DoctorsByClinicIdRequest {
DoctorsByClinicIdRequest.fromJson(Map<String, dynamic> json) { DoctorsByClinicIdRequest.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
doctorID = json['DoctorID'];
continueDentalPlan = json['ContinueDentalPlan']; continueDentalPlan = json['ContinueDentalPlan'];
isSearchAppointmnetByClinicID = json['IsSearchAppointmnetByClinicID']; isSearchAppointmnetByClinicID = json['IsSearchAppointmnetByClinicID'];
patientID = json['PatientID']; patientID = json['PatientID'];
@ -49,6 +52,7 @@ class DoctorsByClinicIdRequest {
data['ContinueDentalPlan'] = this.continueDentalPlan; data['ContinueDentalPlan'] = this.continueDentalPlan;
data['IsSearchAppointmnetByClinicID'] = this.isSearchAppointmnetByClinicID; data['IsSearchAppointmnetByClinicID'] = this.isSearchAppointmnetByClinicID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['DoctorID'] = this.doctorID;
data['gender'] = this.gender; data['gender'] = this.gender;
data['IsGetNearAppointment'] = this.isGetNearAppointment; data['IsGetNearAppointment'] = this.isGetNearAppointment;
data['IsVoiceCommand'] = this.isVoiceCommand; data['IsVoiceCommand'] = this.isVoiceCommand;

@ -227,7 +227,7 @@ class PatiantInformtion {
endTime = json['endTime']; endTime = json['endTime'];
episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'];
fallRiskScore = json['fallRiskScore']; fallRiskScore = json['fallRiskScore'];
isSigned = json['isSigned']; isSigned = json['IsSigned'];
medicationOrders = json['medicationOrders']; medicationOrders = json['medicationOrders'];
nationality = json['nationality'] ?? json['NationalityNameN']; nationality = json['nationality'] ?? json['NationalityNameN'];
patientMRN = json['patientMRN'] ?? patientMRN = json['patientMRN'] ??

@ -1,36 +1,35 @@
class VitalSignData { class VitalSignData {
int? appointmentNo; int appointmentNo;
int? bloodPressureCuffLocation; int bloodPressureCuffLocation;
int? bloodPressureCuffSize; int bloodPressureCuffSize;
int? bloodPressureHigher; int bloodPressureHigher;
int? bloodPressureLower; int bloodPressureLower;
int? bloodPressurePatientPosition; int bloodPressurePatientPosition;
dynamic bodyMassIndex; var bodyMassIndex;
int? fio2; int fio2;
int? headCircumCm; int headCircumCm;
dynamic heightCm; var heightCm;
int? idealBodyWeightLbs; int idealBodyWeightLbs;
bool? isPainManagementDone; bool isPainManagementDone;
bool? isVitalsRequired; bool isVitalsRequired;
int? leanBodyWeightLbs; int leanBodyWeightLbs;
String? painCharacter; String painCharacter;
String? painDuration; String painDuration;
String? painFrequency; String painFrequency;
String? painLocation; String painLocation;
int? painScore; int painScore;
int? patientMRN; int patientMRN;
int? patientType; int patientType;
int? pulseBeatPerMinute; int pulseBeatPerMinute;
int? pulseRhythm; int pulseRhythm;
int? respirationBeatPerMinute; num respirationBeatPerMinute;
int? respirationPattern; int respirationPattern;
int? sao2; int sao2;
int? status; int status;
dynamic temperatureCelcius; var temperatureCelcius;
int? temperatureCelciusMethod; int temperatureCelciusMethod;
dynamic waistSizeInch; var waistSizeInch;
dynamic weightKg; var weightKg;
VitalSignData( VitalSignData(
{this.appointmentNo, {this.appointmentNo,

@ -1,21 +1,21 @@
class InterventionMedicationHistoryResModel { class InterventionMedicationHistoryResModel {
String? setupId; String setupId;
String? projectId; String projectId;
int? patientId; int patientId;
int? admissionNo; int admissionNo;
int? prescriptionId; int prescriptionId;
int? orderNo; int orderNo;
int? id; int id;
int? interventionId; int interventionId;
dynamic intervention; dynamic intervention;
String? remark; String remark;
int? commentedBy; int commentedBy;
bool? isDoctor; bool isDoctor;
bool? isActive; bool isActive;
int? createdBy; int createdBy;
String? createdByName; String createdByName;
String? createdByNameN; String createdByNameN;
String? createdOn; String createdOn;
dynamic editedBy; dynamic editedBy;
dynamic editedByName; dynamic editedByName;
dynamic editedByNameN; dynamic editedByNameN;

@ -58,7 +58,7 @@ class EntityList {
this.subGroup, this.subGroup,
this.template, this.template,
this.remarks, this.remarks,
this.type}); this.type ='1'});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic']; allowedClinic = json['allowedClinic'];

@ -6,19 +6,20 @@ class FinalRadiology {
dynamic patientID; dynamic patientID;
dynamic invoiceLineItemNo; dynamic invoiceLineItemNo;
dynamic invoiceNo; dynamic invoiceNo;
dynamic invoiceNo_VP;
dynamic doctorID; dynamic doctorID;
dynamic clinicID; dynamic clinicID;
DateTime? orderDate; DateTime orderDate;
DateTime? reportDate; DateTime reportDate;
dynamic reportData; dynamic reportData;
dynamic imageURL; dynamic imageURL;
dynamic procedureID; dynamic procedureID;
dynamic appodynamicmentNo; dynamic appodynamicmentNo;
dynamic dIAPacsURL; dynamic dIAPacsURL;
bool? isRead; bool isRead;
dynamic readOn; dynamic readOn;
var admissionNo; var admissionNo;
bool? isInOutPatient; bool isInOutPatient;
dynamic actualDoctorRate; dynamic actualDoctorRate;
dynamic clinicDescription; dynamic clinicDescription;
dynamic dIAPACSURL; dynamic dIAPACSURL;
@ -28,8 +29,8 @@ class FinalRadiology {
dynamic doctorTitle; dynamic doctorTitle;
dynamic gender; dynamic gender;
dynamic genderDescription; dynamic genderDescription;
bool? isActiveDoctorProfile; bool isActiveDoctorProfile;
bool? isExecludeDoctor; bool isExecludeDoctor;
dynamic isInOutPatientDescription; dynamic isInOutPatientDescription;
dynamic isInOutPatientDescriptionN; dynamic isInOutPatientDescriptionN;
dynamic nationalityFlagURL; dynamic nationalityFlagURL;
@ -39,17 +40,19 @@ class FinalRadiology {
dynamic qR; dynamic qR;
dynamic reportDataHTML; dynamic reportDataHTML;
dynamic reportDataTextdynamic; dynamic reportDataTextdynamic;
List<dynamic>? speciality; List<dynamic> speciality;
bool? isCVI; bool isCVI;
bool? isRadMedicalReport; bool isRadMedicalReport;
bool? isLiveCareAppodynamicment; bool isLiveCareAppodynamicment;
bool isRecordFromVidaPlus;
String invoiceType;
FinalRadiology( FinalRadiology(
{this.setupID, {this.setupID,
this.projectID, this.projectID,
this.patientID, this.patientID,
this.invoiceLineItemNo, this.invoiceLineItemNo,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
this.orderDate, this.orderDate,
@ -86,7 +89,7 @@ class FinalRadiology {
this.speciality, this.speciality,
this.isCVI, this.isCVI,
this.isRadMedicalReport, this.isRadMedicalReport,
this.isLiveCareAppodynamicment}); this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType});
FinalRadiology.fromJson(Map<dynamic, dynamic> json) { FinalRadiology.fromJson(Map<dynamic, dynamic> json) {
try { try {
@ -95,6 +98,7 @@ class FinalRadiology {
patientID = json['PatientID']; patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); orderDate = AppDateUtils.convertStringToDate(json['OrderDate']);
@ -132,6 +136,8 @@ class FinalRadiology {
// speciality = json['Speciality'].cast<dynamic>(); // speciality = json['Speciality'].cast<dynamic>();
isCVI = json['isCVI']; isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport']; isRadMedicalReport = json['isRadMedicalReport'];
isRecordFromVidaPlus = json['IsRecordFromVidaPlus'];
invoiceType = json["InvoiceType"];
} catch (e) { } catch (e) {
print(e); print(e);
} }
@ -144,6 +150,7 @@ class FinalRadiology {
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
@ -179,15 +186,17 @@ class FinalRadiology {
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['isCVI'] = this.isCVI; data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport; data['isRadMedicalReport'] = this.isRadMedicalReport;
data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus;
data["InvoiceType"] =invoiceType;
return data; return data;
} }
} }
class FinalRadiologyList { class FinalRadiologyList {
dynamic filterName = ""; dynamic filterName = "";
List<FinalRadiology> finalRadiologyList = []; List<FinalRadiology> finalRadiologyList = List();
FinalRadiologyList({this.filterName, FinalRadiology? finalRadiology}) { FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) {
finalRadiologyList.add(finalRadiology!); finalRadiologyList.add(finalRadiology);
} }
} }

@ -9,6 +9,7 @@ class SickLeavePatientModel {
dynamic requestDate; dynamic requestDate;
dynamic sickLeaveDays; dynamic sickLeaveDays;
dynamic appointmentNo; dynamic appointmentNo;
dynamic appointmentNO;
dynamic admissionNo; dynamic admissionNo;
dynamic actualDoctorRate; dynamic actualDoctorRate;
dynamic appointmentDate; dynamic appointmentDate;
@ -98,7 +99,7 @@ class SickLeavePatientModel {
requestNo = json['RequestNo']; requestNo = json['RequestNo'];
requestDate = json['RequestDate']; requestDate = json['RequestDate'];
sickLeaveDays = json['SickLeaveDays']; sickLeaveDays = json['SickLeaveDays'];
appointmentNo = json['AppointmentNo']; appointmentNo = (json['AppointmentNo'] ==null ? json['appointmentNo'] : json['AppointmentNo']);
admissionNo = json['AdmissionNo']; admissionNo = json['AdmissionNo'];
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];

@ -4,7 +4,7 @@ class VteAssessmentRequestModel {
int? transactionNo; int? transactionNo;
VteAssessmentRequestModel( VteAssessmentRequestModel(
{this.setupID = "010266", this.parameterGroup = 7, this.transactionNo}); {this.setupID, this.parameterGroup = 7, this.transactionNo});
VteAssessmentRequestModel.fromJson(Map<String, dynamic> json) { VteAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];

@ -3,14 +3,13 @@ import 'package:firebase_analytics/observer.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class AnalyticsService { class AnalyticsService {
final FirebaseAnalytics _analytics = FirebaseAnalytics.instance; // final FirebaseAnalytics _analytics = FirebaseAnalytics();
static FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: analytics);
static FirebaseAnalytics analytics = FirebaseAnalytics.instance;
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: analytics);
FirebaseAnalyticsObserver getAnalyticsObserver() => Future logEvent({@required String eventCategory, @required String eventAction}) async {
FirebaseAnalyticsObserver(analytics: _analytics); await analytics.logEvent(name: 'event', parameters: {
Future logEvent(
{required String eventCategory, required String eventAction}) async {
await _analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory, "eventCategory": eventCategory,
"eventAction": eventAction, "eventAction": eventAction,
}); });

@ -17,8 +17,8 @@ import '../../routes.dart';
import 'NavigationService.dart'; import 'NavigationService.dart';
class VideoCallService extends BaseService { class VideoCallService extends BaseService {
StartCallRes? startCallRes; StartCallRes startCallRes;
PatiantInformtion? patient; PatiantInformtion patient;
LiveCarePatientServices _liveCarePatientServices = LiveCarePatientServices _liveCarePatientServices =
locator<LiveCarePatientServices>(); locator<LiveCarePatientServices>();
@ -34,21 +34,23 @@ class VideoCallService extends BaseService {
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen( await VideoChannel.openVideoCallScreen(
// TODO MOSA TEST // TODO MOSA TEST
kToken: startCallRes!.openTokenID,
kSessionId: startCallRes!.openSessionID,
kApiKey: '46209962', kApiKey: '46209962',
// kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg", kToken: startCallRes.openTokenID,
// kApiKey:'47247954', kSessionId: startCallRes.openSessionID,
vcId: patient!.vcId!, //
// kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4",
vcId: patient.vcId,
isRecording: isRecording, isRecording: isRecording,
patientName: patient!.fullName ?? patientName: patient.fullName ??
(patient!.firstName != null (patient.firstName != null
? "${patient!.firstName} ${patient!.lastName}" ? "${patient.firstName} ${patient.lastName}"
: "-"), : "-"),
tokenID: await sharedPref.getString(TOKEN), tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID, generalId: GENERAL_ID,
doctorId: doctorProfile.doctorID!, doctorId: doctorProfile.doctorID,
onFailure: (String error) { onFailure: (String error) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
}, },
@ -57,13 +59,13 @@ class VideoCallService extends BaseService {
onCallEnd: () { onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext!); locator<NavigationService>().navigatorKey.currentContext);
endCall( endCall(
patient!.vcId!, patient.vcId,
false, false,
).then((value) { ).then((value) {
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext!); locator<NavigationService>().navigatorKey.currentContext);
if (hasError) { if (hasError) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
} else } else
@ -77,13 +79,13 @@ class VideoCallService extends BaseService {
onCallNotRespond: (SessionStatusModel sessionStatusModel) { onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext!); locator<NavigationService>().navigatorKey.currentContext);
endCall( endCall(
patient!.vcId!, patient.vcId,
sessionStatusModel.sessionStatus == 3, sessionStatusModel.sessionStatus == 3,
).then((value) { ).then((value) {
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext!); locator<NavigationService>().navigatorKey.currentContext);
if (hasError) { if (hasError) {
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
} else { } else {
@ -101,7 +103,7 @@ class VideoCallService extends BaseService {
hasError = false; hasError = false;
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq(); EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorProfile!.doctorID; endCallReq.doctorId = doctorProfile.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = vCID; endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient; endCallReq.isDestroy = isPatient;

@ -16,7 +16,7 @@ class AuthenticationService extends BaseService {
List<GetIMEIDetailsModel> _imeiDetails = []; List<GetIMEIDetailsModel> _imeiDetails = [];
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails; List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
late NewLoginInformationModel _loginInfo; NewLoginInformationModel _loginInfo = NewLoginInformationModel();
NewLoginInformationModel get loginInfo => _loginInfo; NewLoginInformationModel get loginInfo => _loginInfo;
SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel();
@ -29,7 +29,7 @@ class AuthenticationService extends BaseService {
CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes;
late Map<String, dynamic> _insertDeviceImeiRes; Map<String, dynamic> _insertDeviceImeiRes = {};
List<DoctorProfileModel> _doctorProfilesList = []; List<DoctorProfileModel> _doctorProfilesList = [];
@ -45,10 +45,10 @@ class AuthenticationService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: {"IMEI": imei, "TokenID": "@dm!n"}); }, body: {"IMEI": imei});
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
@ -64,7 +64,7 @@ class AuthenticationService extends BaseService {
}, body: userInfo.toJson()); }, body: userInfo.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
@ -80,7 +80,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson()); }, body: activationCodeModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
@ -96,7 +96,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson()); }, body: activationCodeModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
@ -106,13 +106,13 @@ class AuthenticationService extends BaseService {
try { try {
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
_checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String? error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: checkActivationCodeRequestModel.toJson()); }, body: checkActivationCodeRequestModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
@ -128,7 +128,7 @@ class AuthenticationService extends BaseService {
}, body: insertIMEIDetailsModel.toJson()); }, body: insertIMEIDetailsModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
@ -146,7 +146,7 @@ class AuthenticationService extends BaseService {
}, body: profileReqModel.toJson()); }, body: profileReqModel.toJson());
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error;
} }
} }
} }

@ -55,10 +55,11 @@ class LookupService extends BaseService {
List<dynamic> listOfAdmissionType = []; List<dynamic> listOfAdmissionType = [];
List<dynamic> listOfDiagnosisSelectionTypes = []; List<dynamic> listOfDiagnosisSelectionTypes = [];
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys, {String searchKey = ""}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = { Map<String, dynamic> body = {
"MasterInput": masterKeys.getMasterKeyService() "MasterInput": masterKeys.getMasterKeyService(),
"SearchKey": searchKey
}; };
await baseAppClient.post(GET_MASTER_LOOKUP_LIST, await baseAppClient.post(GET_MASTER_LOOKUP_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
import '../../model/dashboard/doctor_schedule.dart';
class DashboardService extends BaseService { class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = []; List<DashboardModel> _dashboardItemsList = [];

@ -3,13 +3,17 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/request_schedule.dart'; import 'package:doctor_app_flutter/core/model/doctor/request_schedule.dart';
import '../../../config/shared_pref_kay.dart';
import '../../model/dashboard/doctor_schedule.dart';
class ScheduleService extends BaseService { class ScheduleService extends BaseService {
List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable => List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable =>
_listDoctorWorkingHoursTable; _listDoctorWorkingHoursTable;
List<ListDoctorWorkingHoursTable> _listDoctorWorkingHoursTable = []; List<ListDoctorWorkingHoursTable> _listDoctorWorkingHoursTable = [];
RequestSchedule _requestSchedule = RequestSchedule(); RequestSchedule _requestSchedule = RequestSchedule();
List<DoctorSchedule> _doctorRota= [];
List<DoctorSchedule> get doctorRotation => _doctorRota;
Future getDoctorSchedule() async { Future getDoctorSchedule() async {
await baseAppClient.post(GET_DOCTOR_WORKING_HOURS_TABLE, await baseAppClient.post(GET_DOCTOR_WORKING_HOURS_TABLE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -23,4 +27,23 @@ class ScheduleService extends BaseService {
super.error = error; super.error = error;
}, body: _requestSchedule.toJson(), isFallLanguage: true); }, body: _requestSchedule.toJson(), isFallLanguage: true);
} }
Future getDoctorRota(String fromDate, String toDate,{int pageNo = 1}) async{
hasError = false;
String doctorId = '7826'; //await sharedPref.getString(DOCTOR_ID);
String url = DOCTOR_SCHEDULE + '?userid='+doctorId+'&fromDate='+fromDate+'&toDate='+toDate+'&pagenumber='+pageNo.toString()+'&pagesize=10';
await baseAppClient.get( endPoint: url, onSuccess: (dynamic response, int statusCode) {
_doctorRota =[];
response['response'].forEach((res){
_doctorRota.add(DoctorSchedule.fromJson(res));
});
print(_doctorRota);
}, onFailure: (String error, int statusCode) {
print(error);
},
);
}
} }

@ -1,10 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class HospitalsService extends BaseService { class HospitalsService extends BaseService {
List<GetHospitalsResponseModel> hospitals = []; List<GetHospitalsResponseModel> hospitals = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
hasError = false; hasError = false;
@ -15,6 +17,12 @@ class HospitalsService extends BaseService {
response['ProjectInfo'].forEach((hospital) { response['ProjectInfo'].forEach((hospital) {
hospitals.add(GetHospitalsResponseModel.fromJson(hospital)); hospitals.add(GetHospitalsResponseModel.fromJson(hospital));
}); });
vidaPlusProjectListModel.clear();
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
}
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -8,8 +8,7 @@ class OutPatientService extends BaseService {
List<PatiantInformtion> get patientList => _patientList; List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient( Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async {
PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_MY_OUT_PATIENT, GET_MY_OUT_PATIENT,
@ -27,8 +26,7 @@ class OutPatientService extends BaseService {
); );
} }
Future getPatientFileInformation( Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async {
PatientSearchRequestModel patientSearchRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
PRM_SEARCH_PATIENT, PRM_SEARCH_PATIENT,

@ -114,6 +114,7 @@ class PatientReferralService extends LookupService {
_doctorsByClinicIdRequest.clinicID = clinicId; _doctorsByClinicIdRequest.clinicID = clinicId;
_doctorsByClinicIdRequest.patientID = patient.patientId; _doctorsByClinicIdRequest.patientID = patient.patientId;
_doctorsByClinicIdRequest.gender = patient.gender; _doctorsByClinicIdRequest.gender = patient.gender;
_doctorsByClinicIdRequest.doctorID = 0;
await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital, await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -1,23 +1,46 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:flutter/cupertino.dart';
class ERSignInService extends LookupService { class ERSignInService extends LookupService {
Future signInERPatient({DoctorErSignAssessmentReqModel? doctorErSignAssessmentReqModel}) async { Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false; hasError = false;
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: doctorErSignAssessmentReqModel!.toJson()); }, body: doctorErSignAssessmentReqModel.toJson());
} }
} }

@ -13,8 +13,8 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import '../../base/base_service.dart'; import '../../base/base_service.dart';
class LabsService extends BaseService { class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = []; List<PatientLabOrders> patientLabOrdersList = List();
List<AllSpecialLabResultModel> _allSpecialLab = []; List<AllSpecialLabResultModel> _allSpecialLab = List();
List<AllSpecialLabResultModel> get allSpecialLab => _allSpecialLab; List<AllSpecialLabResultModel> get allSpecialLab => _allSpecialLab;
@ -28,7 +28,7 @@ class LabsService extends BaseService {
String url = ""; String url = "";
if (isInpatient) { if (isInpatient) {
await getDoctorProfile(); await getDoctorProfile();
body['ProjectID'] = doctorProfile!.projectID; body['ProjectID'] = doctorProfile.projectID;
url = GET_PATIENT_LAB_OREDERS; url = GET_PATIENT_LAB_OREDERS;
} else { } else {
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
@ -58,18 +58,18 @@ class LabsService extends BaseService {
RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult _requestPatientLabSpecialResult =
RequestPatientLabSpecialResult(); RequestPatientLabSpecialResult();
List<PatientLabSpecialResult> patientLabSpecialResult =[]; List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = []; List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = []; List<LabOrderResult> labOrdersResultsList = List();
List<LabResultHistory> labOrdersResultHistoryList = []; List<LabResultHistory> labOrdersResultHistoryList = List();
Future getLaboratoryResult( Future getLaboratoryResult(
{String? projectID, {String projectID,
int? clinicID, int clinicID,
String? invoiceNo, String invoiceNo,
String? orderNo, String orderNo,
PatiantInformtion? patient, PatiantInformtion patient,
bool? isInpatient = false}) async { bool isInpatient = false}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -80,7 +80,7 @@ class LabsService extends BaseService {
body = _requestPatientLabSpecialResult.toJson(); body = _requestPatientLabSpecialResult.toJson();
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT,
patient: patient!, onSuccess: (dynamic response, int statusCode) { patient: patient, onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) { response['ListPLSR'].forEach((hospital) {
@ -93,9 +93,9 @@ class LabsService extends BaseService {
} }
Future getPatientLabResult( Future getPatientLabResult(
{PatientLabOrders? patientLabOrder, {PatientLabOrders patientLabOrder,
PatiantInformtion? patient, PatiantInformtion patient,
bool isInpatient = false}) async { bool isInpatient}) async {
hasError = false; hasError = false;
String url = ""; String url = "";
@ -106,14 +106,14 @@ class LabsService extends BaseService {
} }
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder!.invoiceNo; body['InvoiceNo'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID ?? 0; body['ClinicID'] = patientLabOrder.clinicID ?? 0;
body['InvoiceType'] = patientLabOrder.invoiceType ??"";
await baseAppClient.postPatient(url, patient: patient!, await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult = []; patientLabSpecialResult = [];
labResultList = []; labResultList = [];
@ -138,9 +138,9 @@ class LabsService extends BaseService {
} }
Future getPatientLabOrdersResults( Future getPatientLabOrdersResults(
{PatientLabOrders? patientLabOrder, {PatientLabOrders patientLabOrder,
String? procedure, String procedure,
PatiantInformtion? patient}) async { PatiantInformtion patient}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
if (patientLabOrder != null) { if (patientLabOrder != null) {
@ -153,7 +153,7 @@ class LabsService extends BaseService {
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['Procedure'] = procedure; body['Procedure'] = procedure;
await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT,
patient: patient!, onSuccess: (dynamic response, int statusCode) { patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab)); labOrdersResultsList.add(LabOrderResult.fromJson(lab));
@ -167,7 +167,7 @@ class LabsService extends BaseService {
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail _requestSendLabReportEmail =
RequestSendLabReportEmail(); RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async {
// _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
// _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
// _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
@ -192,9 +192,9 @@ class LabsService extends BaseService {
} }
Future getPatientLabOrdersResultHistoryByDescription( Future getPatientLabOrdersResultHistoryByDescription(
{PatientLabOrders? patientLabOrder, {PatientLabOrders patientLabOrder,
String? procedureDescription, String procedureDescription,
PatiantInformtion? patient}) async { PatiantInformtion patient}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
if (patientLabOrder != null) { if (patientLabOrder != null) {
@ -206,7 +206,7 @@ class LabsService extends BaseService {
body['ProcedureDescription'] = procedureDescription; body['ProcedureDescription'] = procedureDescription;
await baseAppClient.postPatient( await baseAppClient.postPatient(
GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION,
patient: patient!, onSuccess: (dynamic response, int statusCode) { patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear(); labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) { response['ListGeneralResultHistory'].forEach((lab) {
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
@ -217,7 +217,7 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
Future getAllSpecialLabResult({int? mrn}) async { Future getAllSpecialLabResult({int mrn}) async {
_allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(
patientID: mrn, patientID: mrn,
patientType: 1, patientType: 1,

@ -19,12 +19,12 @@ class MedicineService extends BaseService {
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();
Future getMedicineItem(String itemName) async { Future getMedicineItem(String itemName) async {
_pharmacyItemsList.clear();
_itemsRequestModel.pHRItemName = itemName; _itemsRequestModel.pHRItemName = itemName;
searchText = itemName; searchText = itemName;
await baseAppClient.post( await baseAppClient.post(
PHARMACY_ITEMS_URL, PHARMACY_ITEMS_URL,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_pharmacyItemsList.clear();
_pharmacyItemsList = response['ListPharmcy_Region_enh']; _pharmacyItemsList = response['ListPharmcy_Region_enh'];
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -1,27 +1,24 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart'; import '../../base/base_service.dart';
class RadiologyService extends BaseService { class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList =[]; List<FinalRadiology> finalRadiologyList = List();
String url = ''; String url = '';
bool isRadiologyVIDAPlus = false;
Future getRadImageURL( Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient,String invoiceType}) async {
{required int invoiceNo,
required int lineItem,
required int projectId,
required PatiantInformtion patient}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0";
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
body["InvoiceType"] = invoiceType;
await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -29,8 +26,7 @@ class RadiologyService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientRadOrders(PatiantInformtion patient, Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
{isInPatient = false}) async {
String url = GET_PATIENT_ORDERS; String url = GET_PATIENT_ORDERS;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
if (isInPatient) { if (isInPatient) {
@ -39,19 +35,29 @@ class RadiologyService extends BaseService {
} }
finalRadiologyList.clear(); finalRadiologyList.clear();
hasError = false; hasError = false;
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList = []; finalRadiologyList = [];
String label = "ListRAD"; String label = "ListRAD";
if (isInPatient) { if (isInPatient) {
label = "List_GetRadOreders"; label = "List_GetRadOreders";
} }
if (response[label] == null || response[label].length == 0) { if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) {
label = "FinalRadiologyList"; isRadiologyVIDAPlus = false;
response['FinalRadiologyList'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
} else {
isRadiologyVIDAPlus = true;
response['FinalRadiologyListAPI'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
} }
response[label].forEach((radiology) { // if (response[label] == null || response[label].length == 0) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology)); // label = "FinalRadiologyList";
}); // }
// response[label].forEach((radiology) {
// finalRadiologyList.add(FinalRadiology.fromJson(radiology));
// });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -100,6 +100,7 @@ class SickLeaveService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
// Future.value(response); // Future.value(response);
getAllSickLeavePatient = []; getAllSickLeavePatient = [];
getAllSickLeavePatient.clear();
response['List_SickLeave'].forEach((v) { response['List_SickLeave'].forEach((v) {
getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v));
}); });

@ -6,19 +6,28 @@ import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_reque
import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart';
class PendingOrderService extends BaseService { class PendingOrderService extends BaseService {
List<PendingOrderModel> _pendingOrderList = []; List<PendingOrderModel> _pendingOrderList = List();
List<PendingOrderModel> get pendingOrderList => _pendingOrderList; List<PendingOrderModel> get pendingOrderList => _pendingOrderList;
List<AdmissionOrdersModel> _admissionOrderList = []; List<AdmissionOrdersModel> _admissionOrderList = List();
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList; List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async { Future getPendingOrders(
pendingOrderRequestModel = PendingOrderRequestModel(patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, patientType: 1, setupID: "010266"); {PendingOrderRequestModel pendingOrderRequestModel,
int patientId,
int admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
hasError = false; hasError = false;
await baseAppClient.post(GET_PENDING_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PENDING_ORDERS,
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
_pendingOrderList.clear(); _pendingOrderList.clear();
response['List_PendingOrders'].forEach( response['List_PendingOrders'].forEach(
@ -32,11 +41,20 @@ class PendingOrderService extends BaseService {
}, body: pendingOrderRequestModel.toJson()); }, body: pendingOrderRequestModel.toJson());
} }
Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async { Future getAdmissionOrders(
admissionOrdersRequestModel = AdmissionOrdersRequestModel(patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, patientType: 1, setupID: "010266"); {AdmissionOrdersRequestModel admissionOrdersRequestModel,
int patientId,
int admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
hasError = false; hasError = false;
await baseAppClient.post(GET_ADMISSION_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ADMISSION_ORDERS,
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
//admissionOrderList.clear(); //admissionOrderList.clear();
response['List_AdmissionOrders'].forEach( response['List_AdmissionOrders'].forEach(

@ -1,27 +1,37 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel { class ERSignInViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
ERSignInService _ERSignInService = locator<ERSignInService>(); ERSignInService _ERSignInService = locator<ERSignInService>();
Future signInERPatient({int? patientId, int? signInType}) async { Future signInERPatient({int patientId, int signInType}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel( DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId);
setupID: "010266",
signInType: signInType,
loginDoctorID: doctorProfile!.doctorID,
patientID: patientId,
);
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel); await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) { if (_ERSignInService.hasError) {
error = _ERSignInService.error!; error = _ERSignInService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);

@ -79,7 +79,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList; List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID!; int get episodeID => _SOAPService.episodeID;
bool isAddProgress = true; bool isAddProgress = true;
bool isAddExamInProgress = true; bool isAddExamInProgress = true;
@ -98,52 +98,52 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList; List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack? subjectiveCallBack; SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) { setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack; this.subjectiveCallBack = callBack;
} }
nextOnSubjectPage(model) { nextOnSubjectPage(model) {
subjectiveCallBack!.nextFunction(model); subjectiveCallBack.nextFunction(model);
} }
ObjectiveCallBack? objectiveCallBack; ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) { setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack; this.objectiveCallBack = callBack;
} }
nextOnObjectivePage(model) { nextOnObjectivePage(model) {
objectiveCallBack!.nextFunction(model); objectiveCallBack.nextFunction(model);
} }
AssessmentCallBack? assessmentCallBack; AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) { setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack; this.assessmentCallBack = callBack;
} }
nextOnAssessmentPage(model) { nextOnAssessmentPage(model) {
assessmentCallBack!.nextFunction(model); assessmentCallBack.nextFunction(model);
} }
PlanCallBack? planCallBack; PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) { setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack; this.planCallBack = callBack;
} }
nextOnPlanPage(model) { nextOnPlanPage(model) {
planCallBack!.nextFunction(model); planCallBack.nextFunction(model);
} }
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async {
if (isBusyLocal) { if (isBusyLocal) {
setState(ViewState.Busy); setState(ViewState.Busy);
} else } else
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys); await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -251,7 +251,7 @@ class SOAPViewModel extends BaseViewModel {
String allergiesString = ''; String allergiesString = '';
patientAllergiesList.forEach((element) { patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
if (selectedAllergy != null && element.isChecked!) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , ';
}); });
return allergiesString; return allergiesString;
} }
@ -268,8 +268,8 @@ class SOAPViewModel extends BaseViewModel {
patientInfo.appointmentNo.toString(), patientInfo.appointmentNo.toString(),
), ),
); );
if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!); getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo);
else else
getPhysicalExamReqModel.admissionNo = 0; getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy); setState(ViewState.Busy);
@ -303,7 +303,7 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async { Future getEpisodeForInpatient(PatiantInformtion patient) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1); GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -315,7 +315,7 @@ class SOAPViewModel extends BaseViewModel {
} }
// ignore: missing_return // ignore: missing_return
MasterKeyModel getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) { MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) {
switch (masterKeys) { switch (masterKeys) {
case MasterKeysService.Allergies: case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) { List<MasterKeyModel> result = allergiesList.where((element) {
@ -406,35 +406,12 @@ class SOAPViewModel extends BaseViewModel {
return result.first; return result.first;
} }
break; break;
case MasterKeysService.physiotherapyGoals:
break;
case MasterKeysService.TemperatureMethods:
break;
case MasterKeysService.Speciality:
break;
case MasterKeysService.MedicationStrength:
break;
case MasterKeysService.MedicationDuration:
break;
case MasterKeysService.MedicationRoute:
break;
case MasterKeysService.MedicationFrequency:
break;
case MasterKeysService.MedicationDoseTime:
break;
case MasterKeysService.MedicationIndications:
break;
case MasterKeysService.AdmissionRequestType:
break;
case MasterKeysService.DiagnosisSelectionType:
break; break;
} }
return MasterKeyModel();
} }
int getFirstIndexForOldExamination(List<MySelectedExamination> mySelectedExamination) { int getFirstIndexForOldExamination(List<MySelectedExamination> mySelectedExamination) {
Iterable<MySelectedExamination> examList = mySelectedExamination.where((element) => !element.isLocal!); Iterable<MySelectedExamination> examList = mySelectedExamination.where((element) => !element.isLocal);
if (examList.length > 0) { if (examList.length > 0) {
return mySelectedExamination.indexOf(examList.first); return mySelectedExamination.indexOf(examList.first);
@ -444,7 +421,7 @@ class SOAPViewModel extends BaseViewModel {
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async { onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null, admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null, appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo, episodeId: patientInfo.episodeNo,
@ -564,15 +541,15 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []); final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) { if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error! + _prescriptionService.error!; error = _SOAPService.error + _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
callAddAssessmentLookupsServices({bool allowSetState = true}) async { callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
if (allowSetState) setState(ViewState.Busy); if (allowSetState) setState(ViewState.Busy);
dynamic services; var services;
if (listOfDiagnosisCondition.length == 0) { if (listOfDiagnosisCondition.length == 0) {
if (services == null) { if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)]; services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
@ -589,9 +566,9 @@ class SOAPViewModel extends BaseViewModel {
} }
if (listOfICD10.length == 0) { if (listOfICD10.length == 0) {
if (services == null) { if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)]; services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10)); services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
} }
} }
@ -607,14 +584,7 @@ class SOAPViewModel extends BaseViewModel {
onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async { onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN!, patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
episodeID: patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: int.parse(
patientInfo.appointmentNo.toString(),
),
);
var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)]; var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)];
@ -631,22 +601,11 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
postSubjectServices({ postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List<MySelectedHistory> myHistoryList, List<MySelectedAllergy> myAllergiesList}) async {
patientInfo,
String? complaintsText,
String? medicationText,
String? illnessText,
List<MySelectedHistory>? myHistoryList,
List<MySelectedAllergy>? myAllergiesList,
}) async {
var services; var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel = createPostChiefComplaintRequestModel( PostChiefComplaintRequestModel postChiefComplaintRequestModel =
patientInfo: patientInfo, createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText);
illnessText: illnessText!,
medicationText: medicationText!,
complaintsText: complaintsText!,
);
if (patientChiefComplaintList.isEmpty) { if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = ''; postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
@ -655,7 +614,7 @@ class SOAPViewModel extends BaseViewModel {
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
} }
if (myHistoryList!.length != 0) { if (myHistoryList.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) { if (patientHistoryList.isEmpty) {
@ -665,7 +624,7 @@ class SOAPViewModel extends BaseViewModel {
} }
} }
if (myAllergiesList!.length != 0) { if (myAllergiesList.length != 0) {
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) { if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel)); services.add(_SOAPService.postAllergy(postAllergyRequestModel));
@ -683,12 +642,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({ PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) {
patientInfo,
String? complaintsText,
String? medicationText,
String? illnessText,
}) {
return new PostChiefComplaintRequestModel( return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
@ -703,17 +657,17 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0); numberOfWeeks: 0);
} }
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory>? myHistoryList}) { PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
myHistoryList!.forEach((history) { myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo, episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo, appointmentNo: patientInfo.appointmentNo,
remarks: "", remarks: "",
historyId: history.selectedHistory!.id, historyId: history.selectedHistory.id,
historyType: history.selectedHistory!.typeId, historyType: history.selectedHistory.typeId,
isChecked: history.isChecked, isChecked: history.isChecked,
)); ));
}); });
@ -725,7 +679,7 @@ class SOAPViewModel extends BaseViewModel {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) { myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId, allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
@ -733,9 +687,9 @@ class SOAPViewModel extends BaseViewModel {
appointmentNo: patientInfo.appointmentNo, appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id, severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark, remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile!.doctorID, createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile!.doctorID!, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked, isChecked: allergy.isChecked,
isUpdatedByNurse: false)); isUpdatedByNurse: false));

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart';
@ -26,8 +27,11 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:local_auth/auth_strings.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:local_auth_ios/local_auth_ios.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@ -49,13 +53,14 @@ class AuthenticationViewModel extends BaseViewModel {
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes;
NewLoginInformationModel? loggedUser; List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
GetIMEIDetailsModel? user; NewLoginInformationModel loggedUser;
GetIMEIDetailsModel user;
UserModel userInfo = UserModel(); UserModel userInfo = UserModel();
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
List<BiometricType>? _availableBiometrics; List<BiometricType> _availableBiometrics;
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
bool isLogin = false; bool isLogin = false;
@ -63,6 +68,7 @@ class AuthenticationViewModel extends BaseViewModel {
bool isFromLogin = false; bool isFromLogin = false;
APP_STATUS appStatus = APP_STATUS.LOADING; APP_STATUS appStatus = APP_STATUS.LOADING;
String localToken = ""; String localToken = "";
bool isHuawei = false;
AuthenticationViewModel({bool checkDeviceInfo = false}) { AuthenticationViewModel({bool checkDeviceInfo = false}) {
getDeviceInfoFromFirebase(); getDeviceInfoFromFirebase();
@ -76,11 +82,13 @@ class AuthenticationViewModel extends BaseViewModel {
if (data != null) { if (data != null) {
user = GetIMEIDetailsModel.fromJson(data); user = GetIMEIDetailsModel.fromJson(data);
} }
var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE); var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE);
profileInfo['IMEI'] = token; profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
profileInfo['BioMetricEnabled'] = true; profileInfo['BioMetricEnabled'] = true;
profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile;
InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo);
insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
@ -88,12 +96,12 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID; insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password; insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedIn != null ? loggedIn["employeeID"] : int.parse(user!.editedBy.toString()); insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel); await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -111,11 +119,11 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await sharedPref.setInt(PROJECT_ID, userInfo.projectID!); sharedPref.setInt(PROJECT_ID, userInfo.projectID);
loggedUser = loginInfo; loggedUser = loginInfo;
await saveObjToString(LOGGED_IN_USER, loginInfo); saveObjToString(LOGGED_IN_USER, loginInfo);
await sharedPref.remove(LAST_LOGIN_USER); sharedPref.remove(LAST_LOGIN_USER);
await sharedPref.setString(TOKEN, loginInfo.logInTokenID!); sharedPref.setString(TOKEN, loginInfo.logInTokenID);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -124,17 +132,17 @@ class AuthenticationViewModel extends BaseViewModel {
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user!.iMEI, iMEI: user.iMEI,
facilityId: user!.projectID, facilityId: user.projectID,
memberID: user!.doctorID, memberID: user.doctorID,
loginDoctorID: int.parse(user!.editedBy.toString()), loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user!.outSA == true ? '971' : '966', zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user!.mobile, mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(), oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1, isMobileFingerPrint: 1,
vidaAuthTokenID: user!.vidaAuthTokenID, vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user!.vidaRefreshTokenID); vidaRefreshTokenID: user.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString()); await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel); await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -145,42 +153,42 @@ class AuthenticationViewModel extends BaseViewModel {
} }
/// send activation code for silent login /// send activation code for silent login
Future sendActivationCodeForDoctorApp({AuthMethodTypes? authMethodType, String? password}) async { Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel( ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID, facilityId: projectID,
memberID: loggedUser!.listMemberInformation![0].memberID, memberID: loggedUser.listMemberInformation[0].memberID,
loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
otpSendType: authMethodType!.getTypeIdService().toString(), otpSendType: authMethodType.getTypeIdService().toString(),
); );
await sharedPref.setString(DOCTOR_ID, (loggedUser!.listMemberInformation![0].employeeID).toString()); await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString());
await _authService.sendActivationCodeForDoctorApp(activationCodeModel); await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!); await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
/// check activation code for sms and whats app /// check activation code for sms and whats app
Future checkActivationCodeForDoctorApp({String? activationCode, bool isSilentLogin = false}) async { Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID,
logInTokenID: await sharedPref.getString(TOKEN), logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000', activationCode: activationCode ?? '0000',
memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user!.doctorID, memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID,
password: userInfo.password, password: userInfo.password,
facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user!.projectID.toString(), facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken, iMEI: localToken,
loginDoctorID: loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user!.editedBy.toString()), loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()),
///loggedUser.listMemberInformation[0].employeeID, ///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID,
@ -200,6 +208,7 @@ class AuthenticationViewModel extends BaseViewModel {
Future getHospitalsList(memberID) async { Future getHospitalsList(memberID) async {
GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel();
getHospitalsRequestModel.memberID = memberID; getHospitalsRequestModel.memberID = memberID;
getHospitalsRequestModel.doctorID = memberID;
await _hospitalsService.getHospitals(getHospitalsRequestModel); await _hospitalsService.getHospitals(getHospitalsRequestModel);
if (_hospitalsService.hasError) { if (_hospitalsService.hasError) {
error = _hospitalsService.error; error = _hospitalsService.error;
@ -229,12 +238,14 @@ class AuthenticationViewModel extends BaseViewModel {
} }
} }
/// add  token to shared preferences in case of send activation code is success /// add token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); await sharedPref.setString(
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : "");
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
} }
saveObjToString(String key, value) async { saveObjToString(String key, value) async {
@ -243,16 +254,10 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric /// ask user to add his biometric
showIOSAuthMessages() async { showIOSAuthMessages() async {
const iosStrings = IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID');
try { try {
await auth.authenticate( await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
localizedReason: 'Scan your fingerprint to authenticate',
authMessages: [iosStrings],
options: AuthenticationOptions(
useErrorDialogs: true,
stickyAuth: true,
),
);
} on PlatformException catch (e) { } on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e.toString()); DrAppToastMsg.showErrorToast(e.toString());
} }
@ -280,12 +285,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success /// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
} else { } else {
sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson());
await getDoctorProfileBasedOnClinic(clinic); await getDoctorProfileBasedOnClinic(clinic);
} }
} }
@ -295,8 +300,8 @@ class AuthenticationViewModel extends BaseViewModel {
bool isAvailable = false; bool isAvailable = false;
await _getAvailableBiometrics(); await _getAvailableBiometrics();
if (_availableBiometrics != null) { if (_availableBiometrics != null) {
for (var i = 0; i < _availableBiometrics!.length; i++) { for (var i = 0; i < _availableBiometrics.length; i++) {
if (biometricType == _availableBiometrics![i]) isAvailable = true; if (biometricType == _availableBiometrics[i]) isAvailable = true;
} }
} }
return isAvailable; return isAvailable;
@ -311,16 +316,31 @@ class AuthenticationViewModel extends BaseViewModel {
} }
} }
// checkIsHuawei() async {
// HmsApiAvailability hmsApiAvailability = HmsApiAvailability();
// await hmsApiAvailability.isHMSAvailable().then((value) {
// isHuawei = value == 0 ? true : false;
// });
// print(isHuawei);
// }
/// call firebase service to check if the user already login in before or not /// call firebase service to check if the user already login in before or not
getDeviceInfoFromFirebase() async { getDeviceInfoFromFirebase() async {
// await checkIsHuawei();
var token;
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestPermission(); _firebaseMessaging.requestPermission();
} }
setState(ViewState.Busy); setState(ViewState.Busy);
var token = await _firebaseMessaging.getToken(); try {
token = await _firebaseMessaging.getToken();
} catch (ex) {
print(ex);
}
if (localToken == "") { if (localToken == "") {
localToken = token!; localToken = token;
await _authService.selectDeviceImei(localToken); await _authService.selectDeviceImei(localToken);
if (_authService.hasError) { if (_authService.hasError) {
@ -330,8 +350,8 @@ class AuthenticationViewModel extends BaseViewModel {
if (_authService.dashboardItemsList.length > 0) { if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0]; user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user!.vidaRefreshTokenID!); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user!.vidaAuthTokenID!); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID);
this.unverified = true; this.unverified = true;
} }
setState(ViewState.Idle); setState(ViewState.Idle);
@ -385,7 +405,7 @@ class AuthenticationViewModel extends BaseViewModel {
} }
deleteUser() { deleteUser() {
user = GetIMEIDetailsModel(); user = null;
unverified = false; unverified = false;
isLogin = false; isLogin = false;
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
@ -15,20 +16,23 @@ import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
SpecialClinicsService _specialClinicsService = locator<SpecialClinicsService>(); SpecialClinicsService _specialClinicsService =
locator<SpecialClinicsService>();
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>(); DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList; List<DashboardModel> get dashboardItemsList =>
_dashboardService.dashboardItemsList;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
String? get sServiceID => _dashboardService.sServiceID; String get sServiceID => _dashboardService.sServiceID;
int get notRepliedCount => _doctorReplyService.notRepliedCount; int get notRepliedCount => _doctorReplyService.notRepliedCount;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
_specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { Future startHomeScreenServices(ProjectViewModel projectsProvider,
AuthenticationViewModel authProvider) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
@ -49,13 +53,14 @@ class DashboardViewModel extends BaseViewModel {
} }
Future setFirebaseNotification(AuthenticationViewModel authProvider) async { Future setFirebaseNotification(AuthenticationViewModel authProvider) async {
_firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); _firebaseMessaging.requestPermission(
sound: true, badge: true, alert: true, provisional: true);
_firebaseMessaging.getToken().then((String? token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != null && token != '') { if (token != '') {
// DEVICE_TOKEN = token; // DEVICE_TOKEN = token;
///TODO Elham* return it back ///TODO Elham* return it back
authProvider.insertDeviceImei(token); authProvider.insertDeviceImei(token);
} }
}); });
} }
@ -80,13 +85,14 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle); // setState(ViewState.Idle);
} }
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { Future changeClinic(
int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
ClinicModel clinicModel = ClinicModel( ClinicModel clinicModel = ClinicModel(
doctorID: doctorProfile!.doctorID, doctorID: doctorProfile.doctorID,
clinicID: clinicId, clinicID: clinicId,
projectID: doctorProfile!.projectID, projectID: doctorProfile.projectID,
); );
await authProvider.getDoctorProfileBasedOnClinic(clinicModel); await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) { if (authProvider.state == ViewState.ErrorLocal) {
@ -96,15 +102,13 @@ class DashboardViewModel extends BaseViewModel {
getPatientCount(DashboardModel inPatientCount) { getPatientCount(DashboardModel inPatientCount) {
int value = 0; int value = 0;
inPatientCount.summaryoptions!.forEach((result) { inPatientCount.summaryoptions.forEach((result) => {value += result.value});
value += result.value!;
});
return value.toString(); return value.toString();
} }
GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) { GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) {
GetSpecialClinicalCareListResponseModel special = GetSpecialClinicalCareListResponseModel(); GetSpecialClinicalCareListResponseModel special;
specialClinicalCareList.forEach((element) { specialClinicalCareList.forEach((element) {
if (element.clinicID == clinicId) { if (element.clinicID == clinicId) {
special = element; special = element;
@ -126,4 +130,6 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
} }

@ -53,9 +53,9 @@ class DoctorReplayViewModel extends BaseViewModel {
transactionNo: model.transactionNo.toString(), transactionNo: model.transactionNo.toString(),
doctorResponse: response, doctorResponse: response,
infoStatus: 6, infoStatus: 6,
createdBy: this.doctorProfile!.doctorID, createdBy: this.doctorProfile.doctorID,
infoEnteredBy: this.doctorProfile!.doctorID, infoEnteredBy: this.doctorProfile.doctorID,
setupID: "010266"); );
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel);
if (_doctorReplyService.hasError) { if (_doctorReplyService.hasError) {

@ -18,9 +18,9 @@ import '../../locator.dart';
class UcafViewModel extends BaseViewModel { class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>(); UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList!; List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
List<VitalSignHistory> get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory!; List<VitalSignHistory> get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory;
List<GetAssessmentResModel> get patientAssessmentList => _ucafService.patientAssessmentList; List<GetAssessmentResModel> get patientAssessmentList => _ucafService.patientAssessmentList;
@ -28,13 +28,13 @@ class UcafViewModel extends BaseViewModel {
List<MasterKeyModel> get diagnosisConditions => _ucafService.listOfDiagnosisCondition; List<MasterKeyModel> get diagnosisConditions => _ucafService.listOfDiagnosisCondition;
PrescriptionModel get prescriptionList => _ucafService.prescriptionList!; PrescriptionModel get prescriptionList => _ucafService.prescriptionList;
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList!; List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList;
Function? saveUCAFOnTap; Function saveUCAFOnTap;
String? selectedLanguage; String selectedLanguage;
String heightCm = "0"; String heightCm = "0";
String weightKg = "0"; String weightKg = "0";
String bodyMax = "0"; String bodyMax = "0";
@ -60,8 +60,8 @@ class UcafViewModel extends BaseViewModel {
Future getUCAFData(PatiantInformtion patient) async { Future getUCAFData(PatiantInformtion patient) async {
// setState(ViewState.Busy); // setState(ViewState.Busy);
String? from; String from;
String? to; String to;
if (from == null || from == "0") { if (from == null || from == "0") {
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
@ -96,7 +96,7 @@ class UcafViewModel extends BaseViewModel {
if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') {
respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); respirationBeatPerMinute = element.respirationBeatPerMinute.toString();
} }
if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString(); bloodPressure = element.bloodPressure.toString();
} }
}); });
@ -157,7 +157,7 @@ class UcafViewModel extends BaseViewModel {
} }
} }
MasterKeyModel findMasterDataById({required MasterKeysService masterKeys, dynamic id}) { MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) { switch (masterKeys) {
case MasterKeysService.DiagnosisCondition: case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) { List<MasterKeyModel> result = diagnosisConditions.where((element) {
@ -166,7 +166,7 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
} }
return MasterKeyModel(); return null;
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) { List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService(); return element.id == id && element.typeId == masterKeys.getMasterKeyService();
@ -174,9 +174,9 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
} }
return MasterKeyModel(); return null;
default: default:
return MasterKeyModel(); return null;
} }
} }

@ -354,7 +354,7 @@ class PatientViewModel extends BaseViewModel {
patientTypeID: 1, patientTypeID: 1,
patientType: 1, patientType: 1,
resultType: resultType, resultType: resultType,
setupID: "010266"); );
await _patientService.getDiabeticChartValues(requestModel); await _patientService.getDiabeticChartValues(requestModel);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;

@ -44,8 +44,8 @@ class ProcedureViewModel extends BaseViewModel {
List<dynamic> get categoryList => _procedureService.categoryList; List<dynamic> get categoryList => _procedureService.categoryList;
RadiologyService _radiologyService = locator<RadiologyService>(); RadiologyService _radiologyService = locator<RadiologyService>();
LabsService _labsService = locator<LabsService>(); LabsService _labsService = locator<LabsService>();
List<FinalRadiologyList> _finalRadiologyListClinic = []; List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = []; List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
@ -56,11 +56,15 @@ class ProcedureViewModel extends BaseViewModel {
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList; List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList; List<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList;
List<ProcedureTempleteDetailsModelList> templateList = []; List<ProcedureTempleteDetailsModelList> templateList = List();
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList; List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList;
Future getProcedure({int? mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async { bool _isRadiologyVIDAPlus = false;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
if (isLocalBusy) if (isLocalBusy)
@ -78,7 +82,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureCategory({String? categoryName, String? categoryID, patientId, bool isLocalBusy = false}) async { Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
if (isLocalBusy) if (isLocalBusy)
@ -105,7 +109,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureTemplate({String? categoryID, bool isLocalBusy = false, BuildContext? context}) async { Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
@ -136,7 +140,7 @@ class ProcedureViewModel extends BaseViewModel {
int tempId = 0; int tempId = 0;
Future getProcedureTemplateDetails({required int templateId}) async { Future getProcedureTemplateDetails({int templateId}) async {
tempId = templateId; tempId = templateId;
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
@ -181,13 +185,13 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
Future updateProcedure({UpdateProcedureRequestModel? updateProcedureRequestModel, int? mrn, bool isLocalBusy = false}) async { Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async {
hasError = false; hasError = false;
if (isLocalBusy) if (isLocalBusy)
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
else else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.updateProcedure(updateProcedureRequestModel!); await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -196,9 +200,10 @@ class ProcedureViewModel extends BaseViewModel {
//await getProcedure(mrn: mrn); //await getProcedure(mrn: mrn);
} }
void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async { void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
if (patientType == "7") if (patientType == "7")
@ -235,7 +240,7 @@ class ProcedureViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo = 0, int lineItem = 0, int projectId = 0, required PatiantInformtion patient}) async { getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
@ -254,7 +259,7 @@ class ProcedureViewModel extends BaseViewModel {
List<LabResult> get labResultList => _labsService.labResultList; List<LabResult> get labResultList => _labsService.labResultList;
List<LabResultList> labResultLists = []; List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom { List<LabResultList> get labResultListsCoustom {
return labResultLists; return labResultLists;
@ -271,7 +276,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient}) async { getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient);
if (_labsService.hasError) { if (_labsService.hasError) {
@ -282,7 +287,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient);
if (_labsService.hasError) { if (_labsService.hasError) {
@ -292,7 +297,7 @@ class ProcedureViewModel extends BaseViewModel {
bool isShouldClear = false; bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) { if (_labsService.labOrdersResultsList.length == 1) {
labOrdersResultsList.forEach((element) { labOrdersResultsList.forEach((element) {
if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true; if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true;
}); });
} }
if (isShouldClear) _labsService.labOrdersResultsList.clear(); if (isShouldClear) _labsService.labOrdersResultsList.clear();
@ -300,7 +305,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
@ -309,11 +314,11 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future preparePostProcedure({ Future preparePostProcedure({
String? remarks, String remarks,
String? orderType, String orderType,
PatiantInformtion? patient, PatiantInformtion patient,
List<cpe.EntityList>? entityList, List<cpe.EntityList> entityList,
ProcedureType? procedureType, ProcedureType procedureType,
bool isLocalBusy = false, bool isLocalBusy = false,
}) async { }) async {
///TODO Roaa Move it to function ///TODO Roaa Move it to function
@ -324,19 +329,19 @@ class ProcedureViewModel extends BaseViewModel {
} }
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel(); ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel();
procedureValadteRequestModel.patientMRN = patient!.patientMRN; procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = []; List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList!.forEach((element) { entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId!]; procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = []; List<Controls> controls = List();
controls.add( controls.add(
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
); );
@ -349,8 +354,8 @@ class ProcedureViewModel extends BaseViewModel {
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy); await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) { if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList!.length == 0) { if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN!, isLocalBusy: isLocalBusy); await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error); Utils.showErrorToast(error);
@ -365,7 +370,7 @@ class ProcedureViewModel extends BaseViewModel {
Utils.showErrorToast(error); Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN); getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
Utils.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages); Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
} }
} }
} else { } else {
@ -395,7 +400,7 @@ class ProcedureViewModel extends BaseViewModel {
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
List<cpe.EntityList> entityList = []; List<cpe.EntityList> entityList = List();
items.forEach((element) { items.forEach((element) {
entityList.add( entityList.add(
cpe.EntityList( cpe.EntityList(
@ -414,12 +419,12 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future filterSearchResults(String query, List<cpe.EntityList> masterList, List<cpe.EntityList> items) async { Future filterSearchResults(String query, List<cpe.EntityList> masterList, List<cpe.EntityList> items) async {
List<cpe.EntityList> dummySearchList = []; List<cpe.EntityList> dummySearchList = List();
dummySearchList.addAll(masterList); dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<cpe.EntityList> dummyListData = []; List<cpe.EntityList> dummyListData = List();
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { if (item.procedureName.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });
@ -431,13 +436,13 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel>? masterList, List<ProcedureTempleteModel> items) { void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = []; List<ProcedureTempleteModel> dummySearchList = List();
if (masterList != null) dummySearchList.addAll(masterList); if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = []; List<ProcedureTempleteModel> dummyListData = List();
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { if (item.templateName.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });
@ -446,7 +451,7 @@ class ProcedureViewModel extends BaseViewModel {
return; return;
} else { } else {
items.clear(); items.clear();
items.addAll(masterList!); items.addAll(masterList);
} }
} }
} }

@ -38,7 +38,7 @@ class OperationReportViewModel extends BaseViewModel {
GetOperationDetailsRequestModel( GetOperationDetailsRequestModel(
reservationNo: reservation.oTReservationID, reservationNo: reservation.oTReservationID,
patientID: reservation.patientID, patientID: reservation.patientID,
setupID: "010266"); );
await _operationReportService.getOperationReportDetails( await _operationReportService.getOperationReportDetails(
getOperationReportRequestModel: getOperationReportRequestModel); getOperationReportRequestModel: getOperationReportRequestModel);
if (_operationReportService.hasError) { if (_operationReportService.hasError) {

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -34,6 +35,10 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic; bool get isArabic => _isArabic;
late StreamSubscription subscription; late StreamSubscription subscription;
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
ProjectViewModel() { ProjectViewModel() {
loadSharedPrefLanguage(); loadSharedPrefLanguage();
@ -53,6 +58,11 @@ class ProjectViewModel with ChangeNotifier {
}); });
} }
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
void loadSharedPrefLanguage() async { void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language); currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'en'); _appLocale = Locale(currentLanguage ?? 'en');
@ -100,6 +110,13 @@ class ProjectViewModel with ChangeNotifier {
response['List_DoctorsClinic'].forEach((v) { response['List_DoctorsClinic'].forEach((v) {
doctorClinicsList.add(new ClinicModel.fromJson(v)); doctorClinicsList.add(new ClinicModel.fromJson(v));
}); });
_vidaPlusProjectListModel.clear();
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
_vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
setVidaPlusProjectList(_vidaPlusProjectListModel);
}
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;

@ -12,57 +12,38 @@ class RadiologyViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
RadiologyService _radiologyService = locator<RadiologyService>(); RadiologyService _radiologyService = locator<RadiologyService>();
List<FinalRadiologyList> _finalRadiologyListClinic = []; List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = []; List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> get finalRadiologyList => List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
filterType == FilterType.Clinic
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
void getPatientRadOrders(PatiantInformtion patient, void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
{isInPatient = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
isInPatient: isInPatient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_radiologyService.finalRadiologyList.forEach((element) { _radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic = List<FinalRadiologyList> finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
_finalRadiologyListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
if (finalRadiologyListClinic.length != 0) { if (finalRadiologyListClinic.length != 0) {
_finalRadiologyListClinic[ _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element);
finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])]
.finalRadiologyList
.add(element);
} else { } else {
_finalRadiologyListClinic.add(FinalRadiologyList( _finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element));
filterName: element.clinicDescription, finalRadiology: element));
} }
// FinalRadiologyList list sort via project // FinalRadiologyList list sort via project
List<FinalRadiologyList> finalRadiologyListHospital = List<FinalRadiologyList> finalRadiologyListHospital = _finalRadiologyListHospital
_finalRadiologyListHospital .where(
.where( (elementClinic) => elementClinic.filterName == element.projectName,
(elementClinic) => )
elementClinic.filterName == element.projectName, .toList();
)
.toList();
if (finalRadiologyListHospital.length != 0) { if (finalRadiologyListHospital.length != 0) {
_finalRadiologyListHospital[finalRadiologyListHospital _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element);
.indexOf(finalRadiologyListHospital[0])]
.finalRadiologyList
.add(element);
} else { } else {
_finalRadiologyListHospital.add(FinalRadiologyList( _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element));
filterName: element.projectName, finalRadiology: element));
} }
}); });
@ -72,17 +53,9 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL( getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient, String invoiceType}) async {
{int? invoiceNo,
int? lineItem,
int? projectId,
required PatiantInformtion patient}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL( await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType);
invoiceNo: invoiceNo!,
lineItem: lineItem!,
projectId: projectId!,
patient: patient);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart';
import 'package:doctor_app_flutter/core/service/home/schedule_service.dart'; import 'package:doctor_app_flutter/core/service/home/schedule_service.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
@ -11,6 +12,8 @@ class ScheduleViewModel extends BaseViewModel {
List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable => List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable =>
_scheduleService.listDoctorWorkingHoursTable; _scheduleService.listDoctorWorkingHoursTable;
List<DoctorSchedule> get getDoctorRotation =>
_scheduleService.doctorRotation;
Future getDoctorSchedule() async { Future getDoctorSchedule() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _scheduleService.getDoctorSchedule(); await _scheduleService.getDoctorSchedule();
@ -20,4 +23,15 @@ class ScheduleViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getDoctorRota(String fromDate, String toDate,{int pageNo=1}) async {
setState(ViewState.Busy);
await _scheduleService.getDoctorRota(fromDate,toDate,pageNo:pageNo);
if (_scheduleService.hasError) {
error = _scheduleService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
@ -13,8 +14,7 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>(); SickLeaveService _sickLeaveService = locator<SickLeaveService>();
PatientService _patientService = locator<PatientService>(); PatientService _patientService = locator<PatientService>();
SickLeaveStatisticsModel get sickLeaveStatistics => SickLeaveStatisticsModel get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
_sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave; get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
@ -30,10 +30,7 @@ class SickLeaveViewModel extends BaseViewModel {
get postSechedule => _sickLeaveService.postReschedule; get postSechedule => _sickLeaveService.postReschedule;
get getAllSIckLeavePatient => [ get getAllSIckLeavePatient => removeDuplicates([..._sickLeaveService.getAllSickLeaveDoctor, ..._sickLeaveService.getAllSickLeavePatient]);
..._sickLeaveService.getAllSickLeavePatient,
..._sickLeaveService.getAllSickLeaveDoctor
];
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -88,17 +85,13 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getSickLeaveForPatient(PatiantInformtion patient, Future getSickLeaveForPatient(PatiantInformtion patient, {bool isLocalBusy = false}) async {
{bool isLocalBusy = false}) async {
if (isLocalBusy) if (isLocalBusy)
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
else else
setState(ViewState.Busy); setState(ViewState.Busy);
var patientMRN = patient.patientMRN ?? patient.patientId; var patientMRN = patient.patientMRN ?? patient.patientId;
var services = [ var services = [_sickLeaveService.getSickLeavePatient(patientMRN), _sickLeaveService.getSickLeaveDoctor(patientMRN)];
_sickLeaveService.getSickLeavePatient(patientMRN),
_sickLeaveService.getSickLeaveDoctor(patientMRN)
];
final results = await Future.wait(services); final results = await Future.wait(services);
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
@ -183,4 +176,13 @@ class SickLeaveViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
List<SickLeavePatientModel> removeDuplicates(List<SickLeavePatientModel> items) {
List<SickLeavePatientModel> uniqueItems = [];
var uniqueIDs = items.map((e) => e.appointmentNo).toSet();
uniqueIDs.forEach((e) {
uniqueItems.add(items.firstWhere((i) => i.appointmentNo == e));
});
return uniqueItems;
}
} }

@ -1,22 +1,26 @@
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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 '../../routes.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
Utils helpers = Utils(); Utils helpers = Utils();
@ -27,7 +31,7 @@ class ErSignInScreen extends StatefulWidget {
} }
class _ErSignInScreenState extends State<ErSignInScreen> { class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel? projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -41,7 +45,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
), ),
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7), margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: ListView( child: ListView(
@ -107,12 +111,13 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
} }
} }
signInERPatient({BuildContext? context, ERSignInViewModel? model, patientId, signInType}) async { signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context!); GifLoaderDialogUtils.showMyDialog(context);
await model!.signInERPatient(patientId: patientId, signInType: signInType); await model.signInERPatient(patientId: patientId, signInType: signInType);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
/// TODO Elham* Create this in Utils
DrAppToastMsg.showSuccesToast("Add successfully"); DrAppToastMsg.showSuccesToast("Add successfully");
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -121,12 +126,12 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
/// TODO Elham* Make this as custom Dialog /// TODO Elham* Make this as custom Dialog
showMyDialog({ showMyDialog({
BuildContext? context, BuildContext context,
Function? firstAction, Function firstAction,
Function? secondAction, Function secondAction,
}) { }) {
showDialog( showDialog(
context: context!, context: context,
builder: (ctx) => Center( builder: (ctx) => Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
@ -167,7 +172,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
color: Colors.white, color: Colors.white,
child: AppText( child: AppText(
projectViewModel!.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ', projectViewModel.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ',
fontSize: 15, fontSize: 15,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -184,23 +189,23 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
children: [ children: [
ElevatedButton( ElevatedButton(
child: AppText( child: AppText(
"Sing In", "Sign In",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
), //Text("Cancel"), ), //Text("Cancel"),
onPressed: () async { onPressed: () async {
await firstAction!(); await firstAction();
}), }),
ElevatedButton( ElevatedButton(
child: AppText( child: AppText(
"Sing Out", "Sign Out",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
), //Text("Confirm", ), ), //Text("Confirm", ),
onPressed: () async { onPressed: () async {
await secondAction!(); await secondAction();
}) })
], ],
), ),

@ -3,8 +3,9 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -20,7 +21,7 @@ class LoginScreen extends StatefulWidget {
} }
class _LoginScreenState extends State<LoginScreen> { class _LoginScreenState extends State<LoginScreen> {
String? platformImei; String platformImei;
bool allowCallApi = true; bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom //TODO change AppTextFormField to AppTextFormFieldCustom
@ -31,11 +32,13 @@ class _LoginScreenState extends State<LoginScreen> {
List<GetHospitalsResponseModel> projectsList = []; List<GetHospitalsResponseModel> projectsList = [];
FocusNode focusPass = FocusNode(); FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode(); FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of<AuthenticationViewModel>(context); authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: HexColor('#F8F8F8'), backgroundColor: HexColor('#F8F8F8'),
@ -48,6 +51,7 @@ class _LoginScreenState extends State<LoginScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
//TODO Use App Text rather than text
Container( Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -70,11 +74,11 @@ class _LoginScreenState extends State<LoginScreen> {
), ),
Text( Text(
TranslationBase.of(context).drSulaimanAlHabib, TranslationBase.of(context).drSulaimanAlHabib,
style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth! * 0.029, fontFamily: 'Poppins'), style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'),
), ),
Text( Text(
"Doctor App", "Doctor App",
style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth! * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)),
), ),
]), ]),
], ],
@ -88,8 +92,8 @@ class _LoginScreenState extends State<LoginScreen> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth! * 0.90, width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight! * 0.65, height: SizeConfig.realScreenHeight * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(), buildSizedBox(),
AppTextFieldCustom( AppTextFieldCustom(
@ -97,12 +101,11 @@ class _LoginScreenState extends State<LoginScreen> {
hasBorder: true, hasBorder: true,
controller: userIdController, controller: userIdController,
onChanged: (value) { onChanged: (value) {
if (value != null) authenticationViewModel.userInfo.userID = value.trim(); if (value != null)
print(authenticationViewModel.userInfo.userID); setState(() {
//setState(() {}); authenticationViewModel.userInfo.userID = value.trim();
});
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
buildSizedBox(), buildSizedBox(),
AppTextFieldCustom( AppTextFieldCustom(
@ -111,12 +114,18 @@ class _LoginScreenState extends State<LoginScreen> {
isSecure: true, isSecure: true,
controller: passwordController, controller: passwordController,
onChanged: (value) { onChanged: (value) {
if (value != null) authenticationViewModel.userInfo.password = value.trim(); if (value != null)
getProjects(authenticationViewModel.userInfo.userID); setState(() {
setState(() {}); authenticationViewModel.userInfo.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(authenticationViewModel.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
}, },
onClick: () {}, onClick: () {},
onFieldSubmitted: () {},
), ),
buildSizedBox(), buildSizedBox(),
AppTextFieldCustom( AppTextFieldCustom(
@ -126,10 +135,8 @@ class _LoginScreenState extends State<LoginScreen> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
enabled: false, enabled: false,
onClick: () { onClick: () {
if (projectsList.isNotEmpty) Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
}, },
onFieldSubmitted: () {},
onChanged: (value) {},
), ),
buildSizedBox() buildSizedBox()
]), ]),
@ -143,7 +150,7 @@ class _LoginScreenState extends State<LoginScreen> {
]), ]),
), ),
bottomSheet: Container( bottomSheet: Container(
height: 100, height: 90,
width: double.infinity, width: double.infinity,
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -180,8 +187,8 @@ class _LoginScreenState extends State<LoginScreen> {
login( login(
context, context,
) async { ) async {
if (loginFormKey.currentState!.validate()) { if (loginFormKey.currentState.validate()) {
loginFormKey.currentState!.save(); loginFormKey.currentState.save();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.login(authenticationViewModel.userInfo); await authenticationViewModel.login(authenticationViewModel.userInfo);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
@ -206,10 +213,10 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) { onSelectProject(index) {
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName!; projectIdController.text = projectsList[index].facilityName;
}); });
primaryFocus!.unfocus(); primaryFocus.unfocus();
} }
String memberID = ""; String memberID = "";
@ -222,8 +229,9 @@ class _LoginScreenState extends State<LoginScreen> {
if (authenticationViewModel.state == ViewState.Idle) { if (authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals; projectsList = authenticationViewModel.hospitals;
setState(() { setState(() {
projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList);
authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; authenticationViewModel.userInfo.projectID = projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName!; projectIdController.text = projectsList[0].facilityName;
}); });
} }
} }

@ -23,7 +23,7 @@ import '../../utils/dr_app_shared_pref.dart';
import '../../utils/utils.dart'; import '../../utils/utils.dart';
import '../../widgets/auth/verification_methods_list.dart'; import '../../widgets/auth/verification_methods_list.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Utils helpers = Utils(); Utils helpers = Utils();
///TODO Elham* check if this still in user or not ///TODO Elham* check if this still in user or not
@ -39,13 +39,12 @@ class VerificationMethodsScreen extends StatefulWidget {
} }
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> { class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
late ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
bool isMoreOption = false; bool isMoreOption = false;
bool onlySMSBox = false; bool onlySMSBox = false;
AuthMethodTypes fingerPrintBefore = AuthMethodTypes.Fingerprint; AuthMethodTypes fingerPrintBefore;
AuthMethodTypes selectedOption;
late AuthMethodTypes selectedOption; AuthenticationViewModel authenticationViewModel;
late AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -64,7 +63,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 6 : 4), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4),
), ),
if (authenticationViewModel.isFromLogin) if (authenticationViewModel.isFromLogin)
InkWell( InkWell(
@ -79,7 +78,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Column( Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
), ),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null && isMoreOption == false
? Column( ? Column(
@ -94,14 +93,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.72, letterSpacing: -0.72,
), ),
AppText( AppText(
Utils.convertToTitleCase(authenticationViewModel.user!.doctorName!), Utils.convertToTitleCase(authenticationViewModel.user.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: -1.44, letterSpacing: -1.44,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * 4, height: SizeConfig.heightMultiplier * 4,
), ),
AppText( AppText(
TranslationBase.of(context).accountInfo, TranslationBase.of(context).accountInfo,
@ -110,7 +109,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.64, letterSpacing: -0.64,
), ),
SizedBox(height: SizeConfig.heightMultiplier! * 4), SizedBox(height: SizeConfig.heightMultiplier * 4),
Container( Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -125,7 +124,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth! * .5, width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -153,7 +152,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.4), letterSpacing: -0.4),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: authenticationViewModel.getType(authenticationViewModel.user!.logInTypeID, context), text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context),
style: TextStyle( style: TextStyle(
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -172,10 +171,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
authenticationViewModel.user!.editedOn != null authenticationViewModel.user.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true)
: authenticationViewModel.user!.createdOn != null : authenticationViewModel.user.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true)
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
@ -184,10 +183,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
AppText( AppText(
authenticationViewModel.user!.editedOn != null authenticationViewModel.user.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!)) ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn))
: authenticationViewModel.user!.createdOn != null : authenticationViewModel.user.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!)) ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn))
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -202,7 +201,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * 3, height: SizeConfig.heightMultiplier * 3,
), ),
Row( Row(
children: [ children: [
@ -217,7 +216,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
], ],
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * 2, height: SizeConfig.heightMultiplier * 2,
), ),
], ],
) )
@ -245,12 +244,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => { onTap: () => {
print("Fingerprint"),
// TODO check this logic it seem it will create bug to us // TODO check this logic it seem it will create bug to us
authenticateUser(AuthMethodTypes.Fingerprint, true) authenticateUser(AuthMethodTypes.Fingerprint, true)
}, },
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!), authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)), )),
), ),
@ -350,6 +350,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password); await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error); Utils.showErrorToast(authenticationViewModel.error);
@ -374,7 +375,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(authenticationViewModel.error); Utils.showErrorToast(authenticationViewModel.error);
} else { } else {
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true); this.startSMSService(authMethodType, isSilentLogin: true);
@ -417,11 +418,11 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
startSMSService(AuthMethodTypes type, {isSilentLogin = false}) { startSMSService(AuthMethodTypes type, {isSilentLogin: false}) {
new SMSOTP( new SMSOTP(
context, context,
type, type,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user!.mobile, authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile,
(value) { (value) {
showDialog( showDialog(
context: context, context: context,
@ -442,8 +443,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages(); await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return; if (!mounted) return;
if (authenticationViewModel.user != null && if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.Fingerprint || (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.FaceID)) { SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes); this.sendActivationCode(authMethodTypes);
} else { } else {
setState(() { setState(() {
@ -453,7 +454,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({String? value, bool isSilentLogin = false}) async { checkActivationCode({String value, bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);

@ -0,0 +1,465 @@
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../core/viewModel/project_view_model.dart';
import '../../core/viewModel/schedule_view_model.dart';
import '../../icons_app/doctor_app_icons.dart';
import '../../utils/date-utils.dart';
import '../../utils/dr_app_toast_msg.dart';
import '../../utils/translations_delegate_base_utils.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/errors/error_message.dart';
import '../base/base_view.dart';
import '../patients/register_patient/CustomEditableText.dart';
class DoctorSchedulePage extends StatefulWidget {
@override
_DoctorSchedulePageState createState() => _DoctorSchedulePageState();
}
class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
DashboardService service;
PageController _pageController = PageController();
double currentPage = 0;
int selectedindex = 0;
List weeks = [];
// List<DoctorScheduleResponse> doctorScheduleResponse = [];
int weekMS = 604800 * 1000;
// DoctorList? doctorList;
List<String> freeSlots = [];
bool isPageChange = false;
String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now());
String toDate =
DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30)));
// AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
// this.doctorList = widget.doctorList;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ScheduleViewModel>(
onModelReady: (model) => model.getDoctorRota(fromDate, toDate),
builder: (_, model, widget2) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).doctorSchedule,
isShowAppBar: true,
baseViewModel: model,
isHomeIcon: false,
isLoading: true,
actionButton: IconButton(
icon: Icon(DoctorApp.search_1),
color: Colors.black, //Colors.black,
onPressed: () => searchSchedule(model),
),
body: SizedBox(
height: MediaQuery.of(context).size.height,
child: Stack(
children: [
Column(
children: [
Padding(
padding: EdgeInsets.only(left: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).dateFrom +
" " +
DateFormat("dd-MMM").format(
DateFormat('yyyy-MM-dd')
.parse(fromDate)) +
" " +
TranslationBase.of(context).to +
" " +
DateFormat("dd-MMM").format(
DateFormat('yyyy-MM-dd')
.parse(toDate)),
style: TextStyle(fontWeight: FontWeight.w600),
),
Row(
children: [
IconButton(
onPressed: () {
model.getDoctorRota(fromDate, toDate,);
},
icon: SvgPicture.asset(
'assets/images/svgs/prev.svg',
height: 25,
width: 10)),
IconButton(
onPressed: () {},
icon: SvgPicture.asset(
'assets/images/svgs/next.svg',
height: 25,
width: 10))
],
),
],
)),
],
),
model.getDoctorRotation.length ==0 ? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
)) :
Container(
margin: EdgeInsets.only(top: 45),
child: PageView.builder(
controller: _pageController,
itemCount: model.getDoctorRotation.length,
onPageChanged: (index) {
setState(() {
isPageChange = true;
this.currentPage = index.toDouble();
});
},
itemBuilder: (context, index) {
return Container(
child: ListView.builder(
itemCount: model.getDoctorRotation[index]
.scheduleforuser.length,
itemBuilder: (context, index2) => InkWell(
onTap: () {
// final weekDay = weeks[index][index2]['DayName'];
},
child: Row(
children: [
Expanded(
flex: 1,
child: Padding(
padding:
projectViewModel.isArabic
? EdgeInsets.only(
right: 17)
: EdgeInsets.only(
left: 17),
child: Row(children: [
Column(
children: [
Text(DateFormat('EEEE')
.format(model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days)
// fontSize: 13,
// fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500,
),
Text(getDayMonths(model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days))
// fontWeight: FontWeight.bold,
// fontSize: 18,
],
)
])),
),
Expanded(
flex: 3,
child: ClipRRect(
borderRadius:
const BorderRadius.all(
Radius.circular(
20.0)),
child: Container(
padding: EdgeInsets.only(
left: 10,
right: 10,
top: 15,
bottom: 20),
margin: EdgeInsets.only(
left: 20,
right: 20,
top: 7,
bottom: 7),
decoration: BoxDecoration(
boxShadow: [
model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days
.toString()
.substring(
0,
10) ==
DateTime.now()
.toString()
.substring(
0, 10)
? BoxShadow(
color: Colors
.green,
offset: Offset(
projectViewModel.isArabic
? 5
: -5,
0))
: BoxShadow(
color: Colors
.grey[
100],
blurRadius:
5,
spreadRadius:
4,
offset:
Offset(
0,
10),
),
],
borderRadius:
const BorderRadius.all(
Radius.circular(
10.0)),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.days
.toString()
.substring(
0,
10) ==
DateTime.now()
.toString()
.substring(
0,
10)
? Text(
TranslationBase.of(
context)
.today,
style:
TextStyle(
color: Colors
.green,
fontWeight:
FontWeight
.w600,
fontSize:
12,
))
: SizedBox(),
// : SizedBox(),
Row(
children: [
Expanded(
child: Text(
model
.getDoctorRotation[
index]
.clinicname,
style:
TextStyle(
fontWeight:
FontWeight
.w600,
),
),
),
// Icon(Icons.arrow_forward, size: 16.0),
],
),
Container(
height: 45,
child: ListView
.builder(
itemCount: model
.getDoctorRotation[
index]
.scheduleforuser[
index2]
.shiftforuser
.length,
itemBuilder: (context,
index3) =>
Row(children: [
Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].fromtime.toString()),
Text(" To "),
Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].totime.toString())
])))
// ],)
]))),
),
],
))));
},
)),
// PageViewIndicator(
// isActive: true,
// currentPage: this.currentPage,
// length: weeks.length,
// )
],
)),
);
});
}
searchSchedule(model) {
showDialog(
context: context,
builder: (BuildContext context) {
return StatefulBuilder(
builder:(context, setState) {
return
AlertDialog(
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).search,
style: TextStyle(fontSize: 22),
),
Text(
TranslationBase.of(context).searchFindSchedule,
style: TextStyle(fontSize: 16),
)
],
),
content: Container(
height: 150,
child: Column(children: [
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now().add(Duration(days:365)),
onConfirm: (date) {
setState(() {
fromDate = DateFormat('yyyy-MM-dd').format(date);
});
},
);
},
child: Container(
padding:
EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5),
width: double.infinity,
height: 55,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
blurRadius: .26,
spreadRadius: 1 * 1.5,
color: Colors.black.withOpacity(.05))
]),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dateFrom,
style: TextStyle(fontSize: 12),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(fromDate),
Icon(Icons.calendar_month_outlined)
])
],
))),
SizedBox(height: 20,),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now().add(Duration(days:365)),
onConfirm: (date) {
setState(() {
toDate = DateFormat('yyyy-MM-dd').format(date);
});
},
);
},
child: Container(
padding:
EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5),
width: double.infinity,
height: 55,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
blurRadius: .26,
spreadRadius: 1 * 1.5,
color: Colors.black.withOpacity(.05))
]),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).toDate,
style: TextStyle(fontSize: 12),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(toDate),
Icon(Icons.calendar_month_outlined)
])
],
)))
]),
),
actions: [
AppButton(
title:TranslationBase.of(context).search,
onPressed: () {
setState((){
model.getDoctorRota(fromDate, toDate);
Navigator.pop(context);
});
},
)
],
);
;
}
);
},
);
}
String getDayMonths(DateTime dateTime) {
String dateFormat =
'${dateTime.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}';
return dateFormat;
}
}

@ -19,7 +19,7 @@ class VideoCallPage extends StatefulWidget {
final listContext; final listContext;
final LiveCarePatientViewModel model; final LiveCarePatientViewModel model;
VideoCallPage({required this.patientData, this.listContext, required this.model}); VideoCallPage({this.patientData, this.listContext, this.model});
@override @override
_VideoCallPageState createState() => _VideoCallPageState(); _VideoCallPageState createState() => _VideoCallPageState();
@ -28,10 +28,10 @@ class VideoCallPage extends StatefulWidget {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class _VideoCallPageState extends State<VideoCallPage> { class _VideoCallPageState extends State<VideoCallPage> {
Timer? _timmerInstance; Timer _timmerInstance;
int _start = 0; int _start = 0;
String _timmer = ''; String _timmer = '';
LiveCareViewModel _liveCareProvider = LiveCareViewModel(); LiveCareViewModel _liveCareProvider;
bool _isInit = true; bool _isInit = true;
var _tokenData; var _tokenData;
bool isTransfer = false; bool isTransfer = false;
@ -68,13 +68,9 @@ class _VideoCallPageState extends State<VideoCallPage> {
kSessionId: tokenData.openSessionID, kSessionId: tokenData.openSessionID,
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patientData.vcId!, vcId: widget.patientData.vcId,
isRecording: tokenData != null ? tokenData.isRecording! : false, isRecording: tokenData != null ? tokenData.isRecording : false,
patientName: widget.patientData.fullName == null patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
? widget.patientData.firstName != null
? "${widget.patientData.firstName} ${widget.patientData.lastName}"
: "-"
: "",
tokenID: token, tokenID: token,
//"hfkjshdf347r8743", //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958", generalId: "Cs2020@2016\$2958",
@ -140,7 +136,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: MediaQuery.of(context).size.height * 0.02, height: MediaQuery.of(context).size.height * 0.02,
), ),
Text( Text(
widget.patientData.fullName!, widget.patientData.fullName,
style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20),
), ),
SizedBox( SizedBox(
@ -202,7 +198,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
width: MediaQuery.of(context).size.width * .9, width: MediaQuery.of(context).size.width * .9,
child: Stack( child: Stack(
fit: StackFit.loose, fit: StackFit.loose,
clipBehavior: Clip.none, // overflow: Overflow.visible,
children: <Widget>[ children: <Widget>[
Positioned( Positioned(
right: -40.0, right: -40.0,
@ -226,43 +223,30 @@ class _VideoCallPageState extends State<VideoCallPage> {
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: ElevatedButton( child: ElevatedButton(
onPressed: () => {endCall()}, onPressed: () => {endCall()},
child: Text(TranslationBase.of(context).endcall), child: Text(TranslationBase.of(context).endcall),
style: ButtonStyle( style: ElevatedButton.styleFrom(backgroundColor: Colors.red, textStyle: TextStyle(color: Colors.white))
backgroundColor: MaterialStateProperty.all(
Colors.red, //color: Colors.red,
), //textColor: Colors.white,
textStyle: MaterialStateProperty.all( )),
TextStyle(color: Colors.white),
),
),
)),
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: ElevatedButton( child: ElevatedButton(
onPressed: () => {resumeCall()}, onPressed: () => {resumeCall()},
child: Text(TranslationBase.of(context).resumecall), child: Text(TranslationBase.of(context).resumecall),
style: ButtonStyle( style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appGreenColor, textStyle: TextStyle(color: Colors.white))
backgroundColor: MaterialStateProperty.all(
AppGlobal.appGreenColor, // color: AppGlobal.appGreenColor,
), // textColor: Colors.white,
textStyle: MaterialStateProperty.all(
TextStyle(color: Colors.white),
), ),
),
),
), ),
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: ElevatedButton( child: ElevatedButton(
onPressed: () => {endCallWithCharge()}, onPressed: () => {endCallWithCharge()},
child: Text(TranslationBase.of(context).endcallwithcharge), child: Text(TranslationBase.of(context).endcallwithcharge),
style: ButtonStyle( style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.white))),
textStyle: MaterialStateProperty.all(
TextStyle(color: Colors.white),
),
),
),
), ),
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -271,11 +255,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
setState(() => {isTransfer = true}) setState(() => {isTransfer = true})
}, },
child: Text(TranslationBase.of(context).transfertoadmin), child: Text(TranslationBase.of(context).transfertoadmin),
style: ButtonStyle( style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])),
backgroundColor: MaterialStateProperty.all( // color: Colors.yellow[900],
Colors.yellow[900],
),
),
), ),
), ),
isTransfer == true isTransfer == true
@ -294,11 +275,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
child: ElevatedButton( child: ElevatedButton(
onPressed: () => {this.transferToAdmin(notes)}, onPressed: () => {this.transferToAdmin(notes)},
child: Text('Transfer'), child: Text('Transfer'),
style: ButtonStyle( style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])),
backgroundColor: MaterialStateProperty.all(
Colors.yellow[900],
),
),
)) ))
], ],
) )

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -16,52 +16,52 @@ import 'package:provider/provider.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
class MedicalFileDetails extends StatefulWidget { class MedicalFileDetails extends StatefulWidget {
String? age; String age;
String? firstName; String firstName;
String? lastName; String lastName;
String? gender; String gender;
int? encounterNumber; int encounterNumber;
int? pp; int pp;
PatiantInformtion? patient; PatiantInformtion patient;
String? clinicName; String clinicName;
String? episode; String episode;
String? doctorName; String doctorName;
String? vistDate; String vistDate;
String? doctorImage; String doctorImage;
MedicalFileDetails( MedicalFileDetails(
{this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage});
@override @override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState( _MedicalFileDetailsState createState() => _MedicalFileDetailsState(
firstName: firstName!, firstName: firstName,
age: age!, age: age,
lastName: lastName!, lastName: lastName,
gender: gender!, gender: gender,
encounterNumber: encounterNumber!, encounterNumber: encounterNumber,
pp: pp!, pp: pp,
patient: patient!, patient: patient,
clinicName: clinicName!, clinicName: clinicName,
doctorName: doctorName!, doctorName: doctorName,
episode: episode!, episode: episode,
vistDate: vistDate!, vistDate: vistDate,
doctorImage: doctorImage!, doctorImage: doctorImage,
); );
} }
class _MedicalFileDetailsState extends State<MedicalFileDetails> { class _MedicalFileDetailsState extends State<MedicalFileDetails> {
int? encounterNumber; int encounterNumber;
String? age; String age;
String? firstName; String firstName;
String? lastName; String lastName;
String? gender; String gender;
int? pp; int pp;
PatiantInformtion? patient; PatiantInformtion patient;
String? clinicName; String clinicName;
String? episode; String episode;
String? doctorName; String doctorName;
String? vistDate; String vistDate;
String? doctorImage; String doctorImage;
_MedicalFileDetailsState( _MedicalFileDetailsState(
{this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage});
@ -77,20 +77,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.medicalFileList.length == 0) { if (model.medicalFileList.length == 0) {
model.getMedicalFile(mrn: pp!); model.getMedicalFile(mrn: pp);
} }
}, },
builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient!, patient,
doctorName: doctorName!, doctorName: doctorName,
profileUrl: doctorImage!, profileUrl: doctorImage,
clinic: clinicName!, clinic: clinicName,
isPrescriptions: true, isPrescriptions: true,
isMedicalFile: true, isMedicalFile: true,
episode: episode!, episode: episode,
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate!, vistDate,
), isArabic: projectViewModel.isArabic)}', ), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
@ -103,14 +103,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0 model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0
? Padding( ? Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
SizedBox(height: 25.0), SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -120,7 +120,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: Colors.grey[200]!, width: 0.5), border: Border.all(color: Colors.grey[200], width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -147,7 +147,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length, itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -159,7 +159,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI! model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI
.trim(), .trim(),
), ),
), ),
@ -182,7 +182,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -192,7 +192,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: Colors.grey[200]!, width: 0.5), border: Border.all(color: Colors.grey[200], width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -219,7 +219,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length, itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -234,8 +234,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontSize: 13.0, fontSize: 13.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10! model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(),
.trim(),
fontSize: 13.5, fontSize: 13.5,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -250,8 +249,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition
.condition!
.trim(), .trim(),
fontSize: 13.0, fontSize: 13.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -263,8 +261,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description,
.description!,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15.0, fontSize: 15.0,
), ),
@ -279,7 +276,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!, model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type,
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -290,8 +287,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks! model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(),
.trim(),
), ),
Divider( Divider(
height: 1, height: 1,
@ -314,7 +310,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -324,7 +320,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: Colors.grey[200]!, width: 0.5), border: Border.all(color: Colors.grey[200], width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -351,7 +347,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length, itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -367,8 +363,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'Procedure ID: ', 'Procedure ID: ',
), ),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId
.procedureId!
.trim(), .trim(),
fontSize: 13.5, fontSize: 13.5,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -383,8 +378,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
AppText( AppText(
AppDateUtils.getDateFormatted(DateTime.parse( AppDateUtils.getDateFormatted(DateTime.parse(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate
.orderDate!
.trim(), .trim(),
)), )),
fontSize: 13.5, fontSize: 13.5,
@ -401,7 +395,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!, model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
) )
@ -413,7 +407,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'CPT Code : ', 'CPT Code : ',
), ),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID
.toString(), .toString(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -443,7 +437,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox( SizedBox(
height: 30, height: 30,
), ),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -453,7 +447,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: Colors.grey[200]!, width: 0.5), border: Border.all(color: Colors.grey[200], width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -480,7 +474,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length, itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -491,7 +485,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText(TranslationBase.of(context).examType + ": "), AppText(TranslationBase.of(context).examType + ": "),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
@ -499,7 +493,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
) )
], ],
@ -508,7 +502,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [ children: [
AppText(TranslationBase.of(context).abnormal + ": "), AppText(TranslationBase.of(context).abnormal + ": "),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!, model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
@ -517,7 +511,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!, model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks,
), ),
Divider( Divider(
height: 1, height: 1,

@ -1,5 +1,4 @@
import 'dart:math'; import 'dart:math';
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
@ -7,10 +6,11 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -25,10 +25,10 @@ import 'package:speech_to_text/speech_to_text.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class MedicineSearchScreen extends StatefulWidget { class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg {
MedicineSearchScreen({this.changeLoadingState}); MedicineSearchScreen({this.changeLoadingState});
final Function? changeLoadingState; final Function changeLoadingState;
@override @override
_MedicineSearchState createState() => _MedicineSearchState(); _MedicineSearchState createState() => _MedicineSearchState();
@ -42,22 +42,27 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
String _currentLocaleId = ""; String _currentLocaleId = "";
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();
String lastStatus = ''; String lastStatus = '';
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
String? lastError; String lastError;
double level = 0.0; double level = 0.0;
double minSoundLevel = 50000; double minSoundLevel = 50000;
double maxSoundLevel = -50000; double maxSoundLevel = -50000;
String? recognizedWord; String recognizedWord;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); bool hasSpeech = await speech.initialize(
_currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; onError: errorListener, onStatus: statusListener);
_currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
if (!mounted) return; if (!mounted) return;
setState(() { setState(() {
@ -65,46 +70,54 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}); });
} }
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(onModelReady: (model) async {
onModelReady: (model) async {}, }, builder: (_, model, w) {
builder: (_, model, w) { // myController.text = model.searchText;
myController.text = model.searchText; return AppScaffold(
return AppScaffold( // baseViewModel: model,
// baseViewModel: model, isShowAppBar: true,
isShowAppBar: true, appBar: BottomSheetTitle(
appBar: BottomSheetTitle( title: TranslationBase.of(context).searchMedicine,
title: TranslationBase.of(context).searchMedicine, ),
), body: SingleChildScrollView(
body: SingleChildScrollView( child: Column(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 20, height: 10,
), ),
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
hintText: TranslationBase.of(context).searchMedicineNameHere, hintText:
TranslationBase.of(context).searchMedicineNameHere,
searchController: myController, searchController: myController,
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
searchMedicine(context, model); searchMedicine(context, model);
}, },
marginTop: 5, marginTop: 5,
onChangeFun: (val) {},
), ),
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).youCanFind + TranslationBase.of(context).youCanFind +
(myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + (myController.text != ''
? model.pharmacyItemsList.length.toString()
: '0') +
" " + " " +
TranslationBase.of(context).medicineSearchResult + TranslationBase.of(context).medicineSearchResult +" '${myController.text}'",
" '${myController.text}'",
fontHeight: 1.4, fontHeight: 1.4,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -121,23 +134,33 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
if (myController.text != '') if (myController.text != '')
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
height: MediaQuery.of(context).size.height * 0.6, height: MediaQuery.of(context).size.height * 0.6,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, itemCount: model.pharmacyItemsList == null
? 0
: model.pharmacyItemsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: model.pharmacyItemsList[index]["ItemDescription"], label: model.pharmacyItemsList[index]
url: model.pharmacyItemsList[index]["ImageSRCUrl"], ["ItemDescription"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"],
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => PharmaciesListScreen(itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]), builder: (context) => PharmaciesListScreen(
settings: RouteSettings(name: 'PharmaciesListScreen'), itemID: model.pharmacyItemsList[index]
["ItemID"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"]),
settings: RouteSettings(
name: 'PharmaciesListScreen'),
), ),
); );
}, },
@ -147,44 +170,45 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
), ),
], ],
)), )),
bottomSheet: Container( bottomSheet: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(0.0), Radius.circular(0.0),
), ),
border: Border.all(color: HexColor('#707070'), width: 0), border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
), ),
height: MediaQuery.of(context).size.height * 0.1, Container(
width: double.infinity, child: FractionallySizedBox(
child: Column( widthFactor: .80,
children: [ child: Center(
SizedBox( child: AppButton(
height: 10, fontWeight: FontWeight.w700,
), title: TranslationBase.of(context).search,
Container( onPressed: () async {
child: FractionallySizedBox( await searchMedicine(context, model);
widthFactor: .80, },
child: Center( color: AppGlobal.appRedColor,
child: AppButton(
fontWeight: FontWeight.w700,
title: TranslationBase.of(context).search,
onPressed: () async {
await searchMedicine(context, model);
},
color: AppGlobal.appRedColor,
),
),
), ),
), ),
SizedBox( ),
height: 5,
),
],
), ),
), SizedBox(
); height: 5,
}); ),
],
),
),
);
});
} }
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
@ -222,8 +246,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
setState(() { setState(() {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
lastStatus = ''; lastStatus = '';
myController.text = recognizedWord!; myController.text = recognizedWord;
Future.delayed(const Duration(seconds: 2), () {}); Future.delayed(const Duration(seconds: 2), () {
});
}); });
} }
@ -240,6 +265,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}); });
} }
void soundLevelListener(double level) { void soundLevelListener(double level) {
minSoundLevel = min(minSoundLevel, level); minSoundLevel = min(minSoundLevel, level);
maxSoundLevel = max(maxSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level);

@ -1,16 +1,16 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -64,18 +64,14 @@ class PatientSickLeaveScreen extends StatelessWidget {
if (!projectsProvider.isArabic) if (!projectsProvider.isArabic)
AppText( AppText(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4),
SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 3 : 4),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.72, letterSpacing: -0.72,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
AppText( AppText(
TranslationBase.of(context).sickLeave, TranslationBase.of(context).sickLeave,
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6),
SizeConfig.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 6 : 6),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: -1.44, letterSpacing: -1.44,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
@ -105,8 +101,7 @@ class PatientSickLeaveScreen extends StatelessWidget {
shrinkWrap: true, shrinkWrap: true,
itemCount: model.getAllSIckLeavePatient.length, itemCount: model.getAllSIckLeavePatient.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
SickLeavePatientModel item = SickLeavePatientModel item = model.getAllSIckLeavePatient[index];
model.getAllSIckLeavePatient[index];
return Column( return Column(
children: [ children: [
CardWithBgWidget( CardWithBgWidget(
@ -122,42 +117,31 @@ class PatientSickLeaveScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
if (item.doctorName != null) if (item.doctorName != null)
Row( Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [
crossAxisAlignment: Expanded(
CrossAxisAlignment.start, // width: MediaQuery.of(context).size.width*0.51,
mainAxisAlignment: child: AppText(
MainAxisAlignment.start, Utils.capitalize(item.doctorName ?? ""),
children: [ fontSize: 18,
Expanded( color: Color(0xff2e303a),
// width: MediaQuery.of(context).size.width*0.51, fontWeight: FontWeight.w700,
child: AppText( fontFamily: 'Poppins',
Utils.capitalize( textOverflow: TextOverflow.ellipsis,
item.doctorName ?? ""), ),
fontSize: 18, ),
color: Color(0xff2e303a), ]),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
textOverflow:
TextOverflow.ellipsis,
),
),
]),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row( Row(
children: [ children: [
ClipRRect( ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(50.0),
BorderRadius.circular(50.0),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: item.doctorImageURL ?? imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
height: 30, height: 30,
width: 30, width: 30,
errorWidget: errorWidget: (context, url, error) => AppText(
(context, url, error) =>
AppText(
'No Image', 'No Image',
fontSize: 10, fontSize: 10,
), ),
@ -170,90 +154,36 @@ class PatientSickLeaveScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(context).daysSickleave,
context) labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3,
.daysSickleave, valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
labelSize: SizeConfig value:
.getTextMultiplierBasedOnWidth() * (item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(),
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: (item.sickLeaveDays
.toString() !=
null &&
item.sickLeaveDays
.toString() !=
"null")
? item.sickLeaveDays
.toString()
: item.noOfDays
.toString(),
), ),
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(context).startDate + ' ' ?? "",
context) labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3,
.startDate + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
' ' ?? value: AppDateUtils.getDayMonthYearDateFormatted(
"", item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate),
labelSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: AppDateUtils
.getDayMonthYearDateFormatted(
item.startDate.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(
item
.startDate)
: DateTime.parse(
item.startDate),
), ),
), ),
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(context).endDate + ' ' ?? "",
context) labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3,
.endDate + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
' ' ?? value: AppDateUtils.getDayMonthYearDateFormatted(
"", item.startDate.contains("/Date(")
labelSize: SizeConfig ? AppDateUtils.convertStringToDate(item.endDate ?? "").add(
.getTextMultiplierBasedOnWidth() * Duration(days: item.noOfDays ?? item.sickLeaveDays),
3.3,
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
value: AppDateUtils
.getDayMonthYearDateFormatted(
item.startDate.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(
item.endDate ??
"")
.add(
Duration(
days: item
.noOfDays ??
item.sickLeaveDays),
) )
: DateTime.parse( : DateTime.parse(item.startDate ?? "").add(
item.startDate ?? Duration(days: item.noOfDays ?? ""),
"")
.add(
Duration(
days:
item.noOfDays ??
""),
), ),
), ),
), ),
], ],
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
), ),
), ),
], ],

@ -29,7 +29,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
//appBarTitle: 'Discharged Patient', //appBarTitle: 'Discharged Patient',
//subtitle: "Last Three Months", //subtitle: "Last Three Months",
backgroundColor: Colors.grey[200]!, backgroundColor: Colors.grey[200],
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargedPatient.isEmpty body: model.myDischargedPatient.isEmpty
@ -59,9 +59,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
onPressed: () {},
), ),
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -117,11 +115,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
children: [ children: [
AppText( AppText(
model.filterData[index].nationalityName != null model.filterData[index].nationalityName != null
? model.filterData[index].nationalityName!.trim() ? model.filterData[index].nationalityName.trim()
: model.filterData[index].nationality != null : model.filterData[index].nationality != null
? model.filterData[index].nationality!.trim() ? model.filterData[index].nationality.trim()
: model.filterData[index].nationalityId != null : model.filterData[index].nationalityId != null
? model.filterData[index].nationalityId! ? model.filterData[index].nationalityId
: "", : "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
@ -131,10 +129,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '', model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '',
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
return AppText( return AppText(
'', '',
fontSize: 10, fontSize: 10,
@ -174,7 +172,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black), style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')), new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
@ -188,7 +186,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier!, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -209,7 +207,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier!, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black, color: Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -232,7 +230,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
), ),
AppText( AppText(
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
], ],

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -17,16 +18,13 @@ import 'package:url_launcher/url_launcher.dart';
class ECGPage extends StatelessWidget { class ECGPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patient-type']; String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type']; String arrivalType = routeArgs['arrival-type'];
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMuseViewModel>( return BaseView<PatientMuseViewModel>(
onModelReady: (model) => model.getECGPatient( onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId),
patientType: patient.patientType,
patientOutSA: 0,
patientID: patient.patientId),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
@ -59,19 +57,24 @@ class ECGPage extends StatelessWidget {
model.patientMuseResultsModelList.length, model.patientMuseResultsModelList.length,
(index) => InkWell( (index) => InkWell(
onTap: () async { onTap: () async {
await launch(model Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL);
.patientMuseResultsModelList[index].imageURL!); await canLaunchUrl(ecgImageURL).then((value) async {
await launchUrl(ecgImageURL);
}).catchError((err) {
DrAppToastMsg.showErrorToast(err.toString());
});
// if (await canLaunchUrl(ecgImageURL)) {
// await launchUrl(ecgImageURL);
// } else {
// DrAppToastMsg.showErrorToast("Unable to open ECG Image");
// }
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: 120, height: 120,
margin: EdgeInsets.only(top: 5, bottom: 5), margin: EdgeInsets.only(top: 5, bottom: 5),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(border: Border.all(color: Colors.white, width: 2), color: Colors.white, borderRadius: BorderRadius.circular(8)),
border:
Border.all(color: Colors.white, width: 2),
color: Colors.white,
borderRadius: BorderRadius.circular(8)),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -79,8 +82,7 @@ class ECGPage extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
'ECG Report', 'ECG Report',
@ -90,26 +92,12 @@ class ECGPage extends StatelessWidget {
SizedBox(height: 3), SizedBox(height: 3),
RichText( RichText(
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
fontSize: 1.6 *
SizeConfig.textMultiplier!,
color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
text: TranslationBase.of( text: '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}',
context) style: TextStyle(fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)),
.orderNo,
style: TextStyle(
fontSize: 12,
fontFamily: 'Poppins')),
new TextSpan(
text:
'${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}',
style: TextStyle(
fontWeight:
FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 14)),
], ],
), ),
) )
@ -118,19 +106,18 @@ class ECGPage extends StatelessWidget {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}', '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700]!, color: Colors.grey[700],
fontSize: 14, fontSize: 14,
), ),
], ],

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_cus
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'filter_date_page.dart'; import 'filter_date_page.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
@ -29,13 +30,13 @@ class OutPatientsScreen extends StatefulWidget {
final isAppbar; final isAppbar;
final arrivalType; final arrivalType;
final isView; final isView;
final PatientType? selectedPatientType; final PatientType selectedPatientType;
final PatientSearchRequestModel? patientSearchRequestModel; final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo; final bool isSearchWithKeyInfo;
final bool isSearch; final bool isSearch;
final bool isInpatient; final bool isInpatient;
final bool isSearchAndOut; final bool isSearchAndOut;
final String? searchKey; final String searchKey;
OutPatientsScreen( OutPatientsScreen(
{this.patientSearchForm, {this.patientSearchForm,
@ -56,18 +57,21 @@ class OutPatientsScreen extends StatefulWidget {
} }
class _OutPatientsScreenState extends State<OutPatientsScreen> { class _OutPatientsScreenState extends State<OutPatientsScreen> {
int? clinicId; int clinicId;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); AuthenticationViewModel authenticationViewModel;
List<String> _times = []; List<String> _times = [];
int _activeLocation = 1; int _activeLocation = 1;
String? patientType; String patientType;
String? patientTypeTitle; String patientTypeTitle;
var selectedFilter = 1; var selectedFilter = 1;
String? arrivalType; String arrivalType;
late ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
var isView; var isView;
final _controller = TextEditingController(); final _controller = TextEditingController();
late PatientModel patient;
PatientModel patient;
OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today;
bool isSortDes = true; bool isSortDes = true;
@ -85,7 +89,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getOutPatient(widget.patientSearchRequestModel!); await model.getOutPatient(widget.patientSearchRequestModel);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient", appBarTitle: "Search Patient",
@ -191,7 +195,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
model.sortOutPatient(isDes: isSortDes); model.sortOutPatient(isDes: isSortDes);
isSortDes = !isSortDes; isSortDes = !isSortDes;
}, },
), onFieldSubmitted: (){}, ),
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -211,8 +215,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
child: PatientCard( child: PatientCard(
patientInfo: model.filterData[index], patientInfo: model.filterData[index],
patientType: patientType!, patientType: patientType,
arrivalType: arrivalType!, arrivalType: arrivalType,
isFromSearch: widget.isSearchAndOut, isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
onTap: () { onTap: () {
@ -220,12 +224,13 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index], "patient": model.filterData[index],
"patientType": "1", "patientType": "1",
"from": widget.patientSearchRequestModel!.from, "from": widget.patientSearchRequestModel.from,
"to": widget.patientSearchRequestModel!.from, "to": widget.patientSearchRequestModel.from,
"isSearch": false, "isSearch": false,
"isInpatient": false, "isInpatient": false,
"arrivalType": "7", "arrivalType": "7",
"isSearchAndOut": false, "isSearchAndOut": false,
"isSigned": model.filterData[index].isSigned != null ? model.filterData[index].isSigned : false,
}); });
}, },
// isFromSearch: widget.isSearch, // isFromSearch: widget.isSearch,

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -19,9 +19,9 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
class AdmissionRequestFirstScreen extends StatefulWidget { class AdmissionRequestFirstScreen extends StatefulWidget {
@ -42,11 +42,16 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
bool _isSickLeaveRequired = false; bool _isSickLeaveRequired = false;
bool _patientPregnant = false; bool _patientPregnant = false;
String clinicError = '', doctorError = '', sickLeaveCommentError = '', dietTypeError = '', medicalHistoryError = '', surgicalHistoryError = ''; String clinicError;
String doctorError;
String sickLeaveCommentError;
String dietTypeError;
String medicalHistoryError;
String surgicalHistoryError;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
@ -94,7 +99,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
child: AppText( child: AppText(
Utils.convertToTitleCase(TranslationBase.of(context).specialityAndDoctorDetail), Utils.convertToTitleCase(TranslationBase.of(context).specialityAndDoctorDetail),
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier! * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -135,8 +140,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -172,9 +175,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
} }
: () {}, : null,
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 16, height: 16,
@ -184,7 +185,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
child: AppText( child: AppText(
TranslationBase.of(context).patientDetails, TranslationBase.of(context).patientDetails,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
@ -194,13 +195,13 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
TranslationBase.of(context).patientPregnant, TranslationBase.of(context).patientPregnant,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
value: _patientPregnant, value: _patientPregnant,
activeColor: HexColor("#D02127"), activeColor: HexColor("#D02127"),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
_patientPregnant = newValue!; _patientPregnant = newValue;
}); });
}, },
controlAffinity: ListTileControlAffinity.leading, controlAffinity: ListTileControlAffinity.leading,
@ -211,13 +212,13 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
TranslationBase.of(context).isSickLeaveRequired, TranslationBase.of(context).isSickLeaveRequired,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
value: _isSickLeaveRequired, value: _isSickLeaveRequired,
activeColor: HexColor("#D02127"), activeColor: HexColor("#D02127"),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
_isSickLeaveRequired = newValue!; _isSickLeaveRequired = newValue;
}); });
}, },
controlAffinity: ListTileControlAffinity.leading, controlAffinity: ListTileControlAffinity.leading,
@ -233,9 +234,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 4, maxLines: 4,
validationError: sickLeaveCommentError, validationError: sickLeaveCommentError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -270,8 +268,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -282,9 +278,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -296,9 +289,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 6, maxLines: 6,
validationError: medicalHistoryError, validationError: medicalHistoryError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -310,9 +300,6 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 4, maxLines: 4,
validationError: surgicalHistoryError, validationError: surgicalHistoryError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 100, height: 100,
@ -340,22 +327,23 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
_sickLeaveCommentsController.text != "" && _sickLeaveCommentsController.text != "" &&
_postMedicalHistoryController.text != "" && _postMedicalHistoryController.text != "" &&
_postSurgicalHistoryController.text != "") { _postSurgicalHistoryController.text != "") {
model.admissionRequestData!.patientMRN = patient.patientMRN; model.admissionRequestData.patientMRN = patient.patientMRN;
model.admissionRequestData!.appointmentNo = patient.appointmentNo; model.admissionRequestData.appointmentNo = patient.appointmentNo;
model.admissionRequestData!.episodeID = patient.episodeNo; model.admissionRequestData.episodeID = patient.episodeNo;
model.admissionRequestData!.admissionRequestNo = 0; model.admissionRequestData.admissionRequestNo = 0;
model.admissionRequestData!.admitToClinic = _selectedClinic['clinicID']; model.admissionRequestData.admitToClinic = _selectedClinic['clinicID'];
model.admissionRequestData!.mrpDoctorID = _selectedDoctor['DoctorID']; model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID'];
model.admissionRequestData!.isPregnant = _patientPregnant; model.admissionRequestData.isPregnant = _patientPregnant;
model.admissionRequestData!.isSickLeaveRequired = _isSickLeaveRequired; model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired;
model.admissionRequestData!.sickLeaveComments = _sickLeaveCommentsController.text; model.admissionRequestData.sickLeaveComments = _sickLeaveCommentsController.text;
model.admissionRequestData!.isDietType = _selectedDietType != null ? true : false; model.admissionRequestData.isDietType = _selectedDietType != null ? true : false;
model.admissionRequestData!.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0;
model.admissionRequestData!.dietRemarks = _dietTypeRemarksController.text; model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text;
model.admissionRequestData!.pastMedicalHistory = _postMedicalHistoryController.text; model.admissionRequestData.diagnosis = "0";
model.admissionRequestData!.pastSurgicalHistory = _postSurgicalHistoryController.text; model.admissionRequestData.pastMedicalHistory = _postMedicalHistoryController.text;
model.admissionRequestData.pastSurgicalHistory = _postSurgicalHistoryController.text;
Navigator.of(context) Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData}); .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData});
} else { } else {
@ -365,32 +353,32 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
if (_selectedClinic == null) { if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired; clinicError = TranslationBase.of(context).fieldRequired;
} else { } else {
clinicError = ""; clinicError = null;
} }
if (_selectedDoctor == null) { if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired; doctorError = TranslationBase.of(context).fieldRequired;
} else { } else {
doctorError = ""; doctorError = null;
} }
if (_sickLeaveCommentsController.text == "") { if (_sickLeaveCommentsController.text == "") {
sickLeaveCommentError = TranslationBase.of(context).fieldRequired; sickLeaveCommentError = TranslationBase.of(context).fieldRequired;
} else { } else {
sickLeaveCommentError = ""; sickLeaveCommentError = null;
} }
if (_selectedDietType == null) { if (_selectedDietType == null) {
dietTypeError = TranslationBase.of(context).fieldRequired; dietTypeError = TranslationBase.of(context).fieldRequired;
} else { } else {
dietTypeError = ""; dietTypeError = null;
} }
if (_postMedicalHistoryController.text == "") { if (_postMedicalHistoryController.text == "") {
medicalHistoryError = TranslationBase.of(context).fieldRequired; medicalHistoryError = TranslationBase.of(context).fieldRequired;
} else { } else {
medicalHistoryError = ""; medicalHistoryError = null;
} }
if (_postSurgicalHistoryController.text == "") { if (_postSurgicalHistoryController.text == "") {
surgicalHistoryError = TranslationBase.of(context).fieldRequired; surgicalHistoryError = TranslationBase.of(context).fieldRequired;
} else { } else {
surgicalHistoryError = ""; surgicalHistoryError = null;
} }
}); });
} }

@ -5,15 +5,15 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class LineChartForDiabetic extends StatelessWidget { class LineChartForDiabetic extends StatelessWidget {
final String? title; final String title;
final List<TimeSeriesSales2>? timeSeries1; final List<TimeSeriesSales2> timeSeries1;
final int? indexes; final int indexes;
final bool isOX; final bool isOX;
LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false}); LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false});
List<int> xAxixs = []; List<int> xAxixs = List();
List<double> yAxixs = []; List<double> yAxixs = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,8 +37,8 @@ class LineChartForDiabetic extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
title!, title,
fontSize: SizeConfig.textMultiplier! * 2.1, fontSize: SizeConfig.textMultiplier * 2.1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -54,7 +54,7 @@ class LineChartForDiabetic extends StatelessWidget {
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
duration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -68,9 +68,9 @@ class LineChartForDiabetic extends StatelessWidget {
} }
getXaxix() { getXaxix() {
for (int index = 0; index < timeSeries1!.length; index++) { for (int index = 0; index < timeSeries1.length; index++) {
int mIndex = indexes! * index; int mIndex = indexes * index;
if (mIndex < timeSeries1!.length) { if (mIndex < timeSeries1.length) {
xAxixs.add(mIndex); xAxixs.add(mIndex);
} }
} }
@ -82,80 +82,45 @@ class LineChartForDiabetic extends StatelessWidget {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (FlTouchEvent event, LineTouchResponse? touchResponse) {}, //touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: AxisTitles( bottomTitles: SideTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
getTitlesWidget: (value, meta) { getTextStyles: (context, value) {
if (timeSeries1!.length < 15) { return TextStyle(
if (timeSeries1!.length > value.toInt()) { color: Colors.black,
return Text( fontSize: 10,
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', );
style: TextStyle( },
color: Colors.black, rotateAngle: -65,
fontSize: 10, //rotateAngle:-65,
), interval: 100,
); margin: 22,
getTitles: (value) {
if (timeSeries1.length < 15) {
if (timeSeries1.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
} else } else
return Text(""); return '';
} else { } else {
if (value.toInt() == 0) if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
return Text( if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == timeSeries1!.length - 1)
return Text(
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return Text( return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
'${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} }
} }
return Text( return '';
"",
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
}, },
// rotateAngle: -65, ),
//rotateAngle:-65, leftTitles: SideTitles(
interval: 100,
reservedSize: 22,
// getTitles: (value) {
//
// },
)),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
// getTextStyles: getTextStyles: (context, value) {
getTitlesWidget: (val, MetaVal) { return TextStyle(
return Text( color: Colors.black,
"", fontSize: 10,
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
); );
}, },
interval: getMaxY() - getMinY() <= 500 interval: getMaxY() - getMinY() <= 500
@ -163,8 +128,8 @@ class LineChartForDiabetic extends StatelessWidget {
: getMaxY() - getMinY() <= 1000 : getMaxY() - getMinY() <= 1000
? 100 ? 100
: 200, : 200,
reservedSize: 12, margin: 12,
)), ),
), ),
borderData: FlBorderData( borderData: FlBorderData(
show: true, show: true,
@ -185,7 +150,7 @@ class LineChartForDiabetic extends StatelessWidget {
), ),
), ),
minX: 0, minX: 0,
maxX: (timeSeries1!.length - 1).toDouble(), maxX: (timeSeries1.length - 1).toDouble(),
maxY: getMaxY() + 0.3, maxY: getMaxY() + 0.3,
minY: getMinY(), minY: getMinY(),
lineBarsData: getData(context), lineBarsData: getData(context),
@ -194,8 +159,8 @@ class LineChartForDiabetic extends StatelessWidget {
double getMaxY() { double getMaxY() {
double max = 0; double max = 0;
timeSeries1!.forEach((element) { timeSeries1.forEach((element) {
double resultValueDouble = element.sales!; double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
}); });
// timeSeries2.forEach((element) { // timeSeries2.forEach((element) {
@ -207,9 +172,9 @@ class LineChartForDiabetic extends StatelessWidget {
} }
double getMinY() { double getMinY() {
double min = timeSeries1![0].sales!; double min = timeSeries1[0].sales;
timeSeries1!.forEach((element) { timeSeries1.forEach((element) {
double resultValueDouble = element.sales!; double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
// timeSeries2.forEach((element) { // timeSeries2.forEach((element) {
@ -223,12 +188,12 @@ class LineChartForDiabetic extends StatelessWidget {
} }
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = []; List<FlSpot> spots = List();
for (int index = 0; index < timeSeries1!.length; index++) { for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!)); spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
} }
List<FlSpot> spots2 = []; List<FlSpot> spots2 = List();
// for (int index = 0; index < timeSeries2.length; index++) { // for (int index = 0; index < timeSeries2.length; index++) {
// spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
// } // }
@ -236,7 +201,7 @@ class LineChartForDiabetic extends StatelessWidget {
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
color: Colors.red, colors: [Colors.red],
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -249,7 +214,7 @@ class LineChartForDiabetic extends StatelessWidget {
final LineChartBarData lineChartBarData2 = LineChartBarData( final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2, spots: spots2,
isCurved: true, isCurved: true,
color: Colors.red, colors: [Colors.red],
barWidth: 5, barWidth: 5,
isStrokeCapRound: true, isStrokeCapRound: true,
dotData: FlDotData( dotData: FlDotData(
@ -260,7 +225,7 @@ class LineChartForDiabetic extends StatelessWidget {
), ),
); );
List<LineChartBarData> lineChartData = []; List<LineChartBarData> lineChartData = List();
if (spots.isNotEmpty) { if (spots.isNotEmpty) {
lineChartData.add(lineChartBarData1); lineChartData.add(lineChartBarData1);
} }

@ -42,7 +42,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
admissionNo: int.parse(patient.admissionNo!), admissionNo: int.parse(patient.admissionNo!),
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
patientID: patient.patientId, patientID: patient.patientId,
setupID: "010266"); );
model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel);
} }

@ -9,20 +9,22 @@ class LineChartCurvedLabHistory extends StatefulWidget {
final String title; final String title;
final List<LabResultHistory> labResultHistory; final List<LabResultHistory> labResultHistory;
LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); LineChartCurvedLabHistory({this.title, this.labResultHistory});
@override @override
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState(); State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
} }
class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> { class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
List<int> xAxixs = []; bool isShowingMainData;
List<int> xAxixs = List();
int indexes = 0; int indexes = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
getXaxix(); getXaxix();
isShowingMainData = true;
} }
getXaxix() { getXaxix() {
@ -54,7 +56,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
), ),
AppText( AppText(
widget.title, widget.title,
fontSize: SizeConfig.textMultiplier! * 2.1, fontSize: SizeConfig.textMultiplier * 2.1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -67,7 +69,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
padding: const EdgeInsets.only(right: 16.0, left: 8.0), padding: const EdgeInsets.only(right: 16.0, left: 8.0),
child: LineChart( child: LineChart(
sampleData1(), sampleData1(),
duration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
), ),
), ),
), ),
@ -88,73 +90,53 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white, tooltipBgColor: Colors.white,
), ),
touchCallback: (event, touchResponse) {}, // touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: AxisTitles( bottomTitles: SideTitles(
sideTitles: SideTitles(
showTitles: true, showTitles: true,
reservedSize: 28, getTextStyles: (context, value) {
// rotateAngle: -65, return TextStyle(
getTitlesWidget: (value, meta) { color: Colors.black,
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime!); fontSize: 10,
);
},
margin: 28,
rotateAngle: -65,
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime);
if (widget.labResultHistory.length < 8) { if (widget.labResultHistory.length < 8) {
if (widget.labResultHistory.length > value.toInt()) { if (widget.labResultHistory.length > value.toInt()) {
return Text( return '${date.day}/ ${date.year}';
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} else } else
return Text(""); return '';
} else { } else {
if (value.toInt() == 0) if (value.toInt() == 0) return '${date.day}/ ${date.year}';
return Text( if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}';
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (value.toInt() == widget.labResultHistory.length - 1)
return Text(
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
if (xAxixs.contains(value.toInt())) { if (xAxixs.contains(value.toInt())) {
return Text( return '${date.day}/ ${date.year}';
'${date.day}/ ${date.year}',
style: TextStyle(
color: Colors.black,
fontSize: 10,
),
);
} }
} }
return Text(""); return '';
}, },
)), ),
leftTitles: AxisTitles( leftTitles: SideTitles(
sideTitles: SideTitles( showTitles: true,
showTitles: true, getTextStyles: (context, value) {
getTitlesWidget: (value, meta) { return TextStyle(
return Text('${value.toInt()}', color: Colors.black,
style: TextStyle( fontSize: 10,
color: Colors.black, );
fontSize: 10, },
)); getTitles: (value) {
}, return '${value.toInt()}';
reservedSize: 8, },
//reservedSize: 30, margin: 8,
), //reservedSize: 30,
), ),
), ),
borderData: FlBorderData( borderData: FlBorderData(
@ -187,7 +169,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double max = 0; double max = 0;
widget.labResultHistory.forEach((element) { widget.labResultHistory.forEach((element) {
try { try {
double resultValueDouble = double.parse(element.resultValue!); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble > max) max = resultValueDouble; if (resultValueDouble > max) max = resultValueDouble;
} catch (e) { } catch (e) {
print(e); print(e);
@ -200,10 +182,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
double getMinY() { double getMinY() {
double min = 0; double min = 0;
try { try {
min = double.parse(widget.labResultHistory[0].resultValue!); min = double.parse(widget.labResultHistory[0].resultValue);
widget.labResultHistory.forEach((element) { widget.labResultHistory.forEach((element) {
double resultValueDouble = double.parse(element.resultValue!); double resultValueDouble = double.parse(element.resultValue);
if (resultValueDouble < min) min = resultValueDouble; if (resultValueDouble < min) min = resultValueDouble;
}); });
} catch (e) { } catch (e) {
@ -215,10 +197,10 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
} }
List<LineChartBarData> getData() { List<LineChartBarData> getData() {
List<FlSpot> spots = []; List<FlSpot> spots = List();
for (int index = 0; index < widget.labResultHistory.length; index++) { for (int index = 0; index < widget.labResultHistory.length; index++) {
try { try {
var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue!); var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue);
spots.add(FlSpot(index.toDouble(), resultValueDouble)); spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) { } catch (e) {
print(e); print(e);
@ -229,7 +211,7 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
final LineChartBarData lineChartBarData1 = LineChartBarData( final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots, spots: spots,
isCurved: true, isCurved: true,
color: Colors.red, colors: [Colors.red],
barWidth: 3, barWidth: 3,
isStrokeCapRound: true, isStrokeCapRound: true,
curveSmoothness: 0.12, curveSmoothness: 0.12,

@ -58,6 +58,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
patientLabOrder: widget.patientLabOrders, patientLabOrder: widget.patientLabOrders,
patient: widget.patient, patient: widget.patient,
isInpatient: widget.patientType == "1", isInpatient: widget.patientType == "1",
invoiceType:widget.patientLabOrders.invoiceType
), ),
), ),
), ),

@ -16,23 +16,25 @@ import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LaboratoryResultWidget extends StatefulWidget { class LaboratoryResultWidget extends StatefulWidget {
final GestureTapCallback? onTap; final GestureTapCallback onTap;
final String? billNo; final String billNo;
final String? details; final String details;
final String? orderNo; final String orderNo;
final PatientLabOrders? patientLabOrder; final PatientLabOrders patientLabOrder;
final PatiantInformtion? patient; final PatiantInformtion patient;
final bool? isInpatient; final bool isInpatient;
final String invoiceType;
const LaboratoryResultWidget( const LaboratoryResultWidget(
{Key? key, {Key key,
this.onTap, this.onTap,
this.billNo, this.billNo,
this.details, this.details,
this.orderNo, this.orderNo,
this.patientLabOrder, this.patientLabOrder,
this.patient, this.patient,
this.isInpatient}) this.isInpatient,
this.invoiceType
})
: super(key: key); : super(key: key);
@override @override
@ -42,7 +44,7 @@ class LaboratoryResultWidget extends StatefulWidget {
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> { class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMoreGeneral = true; bool _isShowMoreGeneral = true;
bool _isShowMore = true; bool _isShowMore = true;
late ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -97,7 +99,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
TranslationBase.of(context) TranslationBase.of(context)
.generalResult, .generalResult,
fontSize: fontSize:
SizeConfig.textMultiplier! * 2.3, SizeConfig.textMultiplier * 2.3,
bold: false, bold: false,
))), ))),
Container( Container(
@ -141,15 +143,15 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return LabResultWidget( return LabResultWidget(
patientLabOrder: patientLabOrder:
widget.patientLabOrder!, widget.patientLabOrder,
filterName: model filterName: model
.labResultLists[index] .labResultLists[index]
.filterName, .filterName,
patientLabResultList: model patientLabResultList: model
.labResultLists[index] .labResultLists[index]
.patientLabResultList, .patientLabResultList,
patient: widget.patient!, patient: widget.patient,
isInpatient: widget.isInpatient!, isInpatient: widget.isInpatient,
); );
}), }),
], ],
@ -168,7 +170,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
SizedBox( SizedBox(
height: 15, height: 15,
), ),
if (widget.details != null && widget.details!.isNotEmpty) if (widget.details != null && widget.details.isNotEmpty)
Column( Column(
children: [ children: [
InkWell( InkWell(
@ -196,7 +198,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
TranslationBase.of(context) TranslationBase.of(context)
.specialResult, .specialResult,
fontSize: fontSize:
SizeConfig.textMultiplier! * 2.3, SizeConfig.textMultiplier * 2.3,
bold: false, bold: false,
))), ))),
Container( Container(
@ -228,7 +230,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
duration: Duration(milliseconds: 7000), duration: Duration(milliseconds: 7000),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
child: !Utils.isTextHtml(widget.details!) child: !Utils.isTextHtml(widget.details)
? AppText( ? AppText(
widget.details ?? widget.details ??
TranslationBase.of(context) TranslationBase.of(context)

@ -32,21 +32,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class ProgressNoteScreen extends StatefulWidget { class ProgressNoteScreen extends StatefulWidget {
final int visitType; final int visitType;
const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); const ProgressNoteScreen({Key key, this.visitType}) : super(key: key);
@override @override
_ProgressNoteState createState() => _ProgressNoteState(); _ProgressNoteState createState() => _ProgressNoteState();
} }
class _ProgressNoteState extends State<ProgressNoteScreen> { class _ProgressNoteState extends State<ProgressNoteScreen> {
List<NoteModel>? notesList; List<NoteModel> notesList;
var filteredNotesList; var filteredNotesList;
bool isDischargedPatient = false; bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
@ -55,7 +55,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType, visitType: widget.visitType,
// if equal 5 then this will return progress note // if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo!), admissionNo: int.parse(patient.admissionNo),
projectID: patient.projectId, projectID: patient.projectId,
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
@ -69,7 +69,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authenticationViewModel = Provider.of(context); authenticationViewModel = Provider.of(context);
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
@ -118,7 +118,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
widthFactor: 0.95, widthFactor: 0.95,
child: CardWithBgWidget( child: CardWithBgWidget(
hasBorder: false, hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4 : model.patientProgressNoteList[index].status == 4
? Colors.red.shade700 ? Colors.red.shade700
@ -130,7 +130,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy)
AppText( AppText(
TranslationBase.of(context).notePending, TranslationBase.of(context).notePending,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -153,7 +153,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 && model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy)
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -209,7 +209,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo!), admissionNo: int.parse(patient.admissionNo),
cancelledNote: false, cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index].lineItemNo, lineItemNo: model.patientProgressNoteList[index].lineItemNo,
conditionId: model.patientProgressNoteList[index].condition, conditionId: model.patientProgressNoteList[index].condition,
@ -264,7 +264,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context, context,
); );
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo!), admissionNo: int.parse(patient.admissionNo),
conditionId: model.patientProgressNoteList[index].condition, conditionId: model.patientProgressNoteList[index].condition,
cancelledNote: true, cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo, lineItemNo: model.patientProgressNoteList[index].lineItemNo,
@ -364,7 +364,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [ children: [
AppText( AppText(
model.patientProgressNoteList[index].createdOn != null model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!), ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn),
isArabic: projectViewModel.isArabic, isMonthShort: true) isArabic: projectViewModel.isArabic, isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -373,7 +373,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
AppText( AppText(
model.patientProgressNoteList[index].createdOn != null model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!)) ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn))
: AppDateUtils.getHour(DateTime.now()), : AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
@ -390,7 +390,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Row(mainAxisAlignment: MainAxisAlignment.start, children: [ Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.patientProgressNoteList[index].notes!, model.patientProgressNoteList[index].notes,
fontSize: 10, fontSize: 10,
isCopyable: true, isCopyable: true,
), ),
@ -416,7 +416,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
} }
/// TODO Elham* Make this as custom Dialog /// TODO Elham* Make this as custom Dialog
showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { showMyDialog({BuildContext context, Function confirmFun, String actionName}) {
showDialog( showDialog(
context: context, context: context,
builder: (ctx) => Center( builder: (ctx) => Center(

@ -14,8 +14,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -26,20 +27,28 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
import '../../../../base/base_view.dart'; import '../../../../base/base_view.dart';
class UpdateNoteOrder extends StatefulWidget { class UpdateNoteOrder extends StatefulWidget {
final NoteModel? note; final NoteModel note;
final PatientViewModel? patientModel; final PatientViewModel patientModel;
final PatiantInformtion? patient; final PatiantInformtion patient;
final int? visitType; final int visitType;
final bool isUpdate; final bool isUpdate;
final List<dynamic>? elementList; final List<dynamic> elementList;
final Function(dynamic)? okFunction; final Function(dynamic) okFunction;
UpdateNoteOrder({Key? key, this.note, this.patientModel, this.patient, this.visitType, this.isUpdate = false, this.elementList, this.okFunction}) : super(key: key); const UpdateNoteOrder(
{Key key,
this.note,
this.patientModel,
this.patient,
this.visitType,
this.isUpdate,
this.elementList,
this.okFunction})
: super(key: key);
@override @override
_UpdateNoteOrderState createState() => _UpdateNoteOrderState(); _UpdateNoteOrderState createState() => _UpdateNoteOrderState();
@ -47,12 +56,12 @@ class UpdateNoteOrder extends StatefulWidget {
class _UpdateNoteOrderState extends State<UpdateNoteOrder> { class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
dynamic selectValue; dynamic selectValue;
int selectedType = 0; int selectedType;
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
late ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
TextEditingController progressNoteController = TextEditingController(); TextEditingController progressNoteController = TextEditingController();
@ -82,10 +91,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
if (widget.note != null) { if (widget.note != null) {
progressNoteController.text = widget.note!.notes!; progressNoteController.text = widget.note.notes;
if (selectValue == null) selectValue = {}; if(selectValue==null)
selectValue[keyId] = widget.note!.condition; selectValue={};
selectValue['Description'] = widget.note!.conditionDescription!; selectValue[keyId] = widget.note.condition;
selectValue['Description'] = widget.note.conditionDescription;
} }
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
@ -105,8 +116,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
BottomSheetTitle( BottomSheetTitle(
title: widget.visitType == 3 title: widget.visitType == 3
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet ? (widget.isUpdate
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, ? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
), ),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
@ -120,7 +137,11 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.stpMasterList, list: model.stpMasterList,
attributeName: 'Description', attributeName: 'Description',
attributeValueId: model.stpMasterList.length == 1 ? model.stpMasterList[0]['${keyId}'].toString() : '${keyId}', attributeValueId:
model.stpMasterList.length == 1
? model.stpMasterList[0]['${keyId}']
.toString()
: '${keyId}',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => { okFunction: (selectedValue) => {
setState(() { setState(() {
@ -139,8 +160,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).selectCondition, hintText: TranslationBase.of(context).selectCondition,//'Select Condition',
//'Select Condition',
dropDownText: model.stpMasterList.length == 1 dropDownText: model.stpMasterList.length == 1
? model.stpMasterList[0]['Description'] ? model.stpMasterList[0]['Description']
: selectValue == null : selectValue == null
@ -148,9 +168,6 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
: selectValue['Description'], : selectValue['Description'],
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
), ),
@ -166,8 +183,19 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: widget.visitType == 3 hintText: widget.visitType == 3
? (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet ? (widget.isUpdate
: (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, ? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context)
.progressNote,
//TranslationBase.of(context).addProgressNote, //TranslationBase.of(context).addProgressNote,
controller: progressNoteController, controller: progressNoteController,
maxLines: 40, maxLines: 40,
@ -175,21 +203,26 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: progressNoteController
onClick: () {}, .text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context).emptyMessage
: null,
), ),
Positioned( Positioned(
top: -2, top: -2,
//MediaQuery.of(context).size.height * 0, //MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, right: projectViewModel.isArabic
? MediaQuery.of(context).size.width * 0.75
: 15,
child: Column( child: Column(
children: [ children: [
IconButton( IconButton(
icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), icon: Icon(DoctorApp.speechtotext,
color: Colors.black, size: 35),
onPressed: () { onPressed: () {
initSpeechState().then((value) => {onVoiceText()}); initSpeechState()
.then((value) => {onVoiceText()});
}, },
), ),
], ],
@ -207,7 +240,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
), ),
bottomSheet: Container( bottomSheet: Container(
height: progressNoteController.text.isNotEmpty ? 130 : 70, height: progressNoteController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
if (progressNoteController.text.isNotEmpty) if (progressNoteController.text.isNotEmpty)
@ -226,8 +259,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: widget.visitType == 3 title: widget.visitType == 3
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet ? (widget.isUpdate
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, ? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
// disabled: progressNoteController.text.isEmpty, // disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -237,51 +276,61 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}); });
if (progressNoteController.text.trim().isNotEmpty) { if (progressNoteController.text.trim().isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile =
DoctorProfileModel.fromJson(profile);
if (widget.isUpdate) { if (widget.isUpdate) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient!.admissionNo!), admissionNo:
int.parse(widget.patient.admissionNo),
cancelledNote: false, cancelledNote: false,
lineItemNo: widget.note!.lineItemNo!, lineItemNo: widget.note.lineItemNo,
createdBy: widget.note!.createdBy!, createdBy: widget.note.createdBy,
notes: progressNoteController.text, notes: progressNoteController.text,
verifiedNote: false, verifiedNote: false,
patientTypeID: widget.patient!.patientType, patientTypeID: widget.patient.patientType,
patientOutSA: false, patientOutSA: false,
conditionId: selectValue['ParameterCode']); conditionId: selectValue['ParameterCode']);
await widget.patientModel!.updatePatientProgressNote(reqModel); await widget.patientModel
.updatePatientProgressNote(reqModel);
} else { } else {
CreateNoteModel reqModel = CreateNoteModel( CreateNoteModel reqModel = CreateNoteModel(
admissionNo: int.parse(widget.patient!.admissionNo!), admissionNo:
int.parse(widget.patient.admissionNo),
createdBy: doctorProfile.doctorID, createdBy: doctorProfile.doctorID,
visitType: widget.visitType, visitType: widget.visitType,
patientID: widget.patient!.patientId, patientID: widget.patient.patientId,
nursingRemarks: ' ', nursingRemarks: ' ',
patientTypeID: widget.patient!.patientType, patientTypeID: widget.patient.patientType,
patientOutSA: false, patientOutSA: false,
notes: progressNoteController.text, notes: progressNoteController.text,
conditionId: selectValue['ParameterCode']); conditionId: selectValue['ParameterCode']);
await widget.patientModel!.createPatientProgressNote(reqModel); await widget.patientModel
.createPatientProgressNote(reqModel);
} }
if (widget.patientModel!.state == ViewState.ErrorLocal) { if (widget.patientModel.state ==
Utils.showErrorToast(widget.patientModel!.error); ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel.error);
} else { } else {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( ProgressNoteRequest progressNoteRequest =
visitType: widget.visitType, ProgressNoteRequest(
// if equal 5 then this will return progress note visitType: widget.visitType,
admissionNo: int.parse(widget.patient!.admissionNo!), // if equal 5 then this will return progress note
projectID: widget.patient!.projectId, admissionNo:
patientTypeID: widget.patient!.patientType, int.parse(widget.patient.admissionNo),
languageID: 2); projectID: widget.patient.projectId,
await widget.patientModel!.getPatientProgressNote(progressNoteRequest.toJson()); patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).yourOrderAddedSuccessfully);
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces);
@ -297,7 +346,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -328,12 +378,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
void resultListener(result) { void resultListener(result) {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult ==true) {
if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); if (mounted) {
speech.stop(); // speech.stop();
progressNoteController.text += recognizedWord + '\n'; progressNoteController.text += recognizedWord + '\n';
SpeechToText.closeAlertDialog(context);
}
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
@ -341,7 +393,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech); print(hasSpeech);
if (!mounted) return; if (!mounted) return;
} }

@ -45,7 +45,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
admissionNo: int.parse(patient.admissionNo!), admissionNo: int.parse(patient.admissionNo!),
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
patientID: patient.patientId, patientID: patient.patientId,
setupID: "010266"); );
model.getNursingProgressNote(getNursingProgressNoteRequestModel); model.getNursingProgressNote(getNursingProgressNoteRequestModel);
} }

@ -1,18 +1,17 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -21,14 +20,18 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../config/config.dart';
class UpdateOperationReport extends StatefulWidget { class UpdateOperationReport extends StatefulWidget {
final GetReservationsResponseModel? reservation; final GetReservationsResponseModel reservation;
final PatiantInformtion? patient;
final int? visitType; // final OperationReportViewModel operationReportViewModel;
final bool? isUpdate; final PatiantInformtion patient;
final int visitType;
final bool isUpdate;
const UpdateOperationReport( const UpdateOperationReport(
{Key? key, {Key key,
// this.operationReportViewModel, // this.operationReportViewModel,
this.patient, this.patient,
this.visitType, this.visitType,
@ -41,12 +44,12 @@ class UpdateOperationReport extends StatefulWidget {
} }
class _UpdateOperationReportState extends State<UpdateOperationReport> { class _UpdateOperationReportState extends State<UpdateOperationReport> {
int? selectedType; int selectedType;
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
late ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController preOpDiagmosisController = TextEditingController();
TextEditingController postOpDiagmosisNoteController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController();
@ -60,11 +63,13 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
TextEditingController complicationDetailsController = TextEditingController(); TextEditingController complicationDetailsController = TextEditingController();
TextEditingController bloodLossDetailController = TextEditingController(); TextEditingController bloodLossDetailController = TextEditingController();
TextEditingController histopathSpecimenController = TextEditingController(); TextEditingController histopathSpecimenController = TextEditingController();
TextEditingController microbiologySpecimenController = TextEditingController(); TextEditingController microbiologySpecimenController =
TextEditingController();
TextEditingController otherSpecimenController = TextEditingController(); TextEditingController otherSpecimenController = TextEditingController();
TextEditingController scrubNurseController = TextEditingController(); TextEditingController scrubNurseController = TextEditingController();
TextEditingController circulatingNurseController = TextEditingController(); TextEditingController circulatingNurseController = TextEditingController();
TextEditingController BloodTransfusedDetailController = TextEditingController(); TextEditingController BloodTransfusedDetailController =
TextEditingController();
TextEditingController anasthetistController = TextEditingController(); TextEditingController anasthetistController = TextEditingController();
TextEditingController OTReservationID = TextEditingController(); TextEditingController OTReservationID = TextEditingController();
@ -86,30 +91,33 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
return BaseView<OperationReportViewModel>( return BaseView<OperationReportViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getOperationReportDetails(widget.reservation!); await model.getOperationReportDetails(widget.reservation);
OTReservationID.text = widget.reservation!.oTReservationID.toString(); OTReservationID.text = widget.reservation.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) { if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails = model.operationDetailsList[0]; GetOperationDetailsResponseModel oldDetails =
model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis!; postOpDiagmosisNoteController.text = oldDetails.postOpInstruction;
surgeonController.text = oldDetails.surgeon!; preOpDiagmosisController.text = oldDetails.preOpDiagnosis;
assistantNoteController.text = oldDetails.assistant!; surgeonController.text = oldDetails.surgeon;
operationController.text = oldDetails.operation!; assistantNoteController.text = oldDetails.assistant;
inasionController.text = oldDetails.inasion!; operationController.text = oldDetails.operation;
findingController.text = oldDetails.finding!; inasionController.text = oldDetails.inasion;
surgeryProcedureController.text = oldDetails.surgeryProcedure!; findingController.text = oldDetails.finding;
postOpInstructionController.text = oldDetails.postOpInstruction!; surgeryProcedureController.text = oldDetails.surgeryProcedure;
complicationDetailsController.text = oldDetails.complicationDetail!; postOpInstructionController.text = oldDetails.postOpInstruction;
bloodLossDetailController.text = oldDetails.bloodLossDetail!; complicationDetailsController.text = oldDetails.complicationDetail;
histopathSpecimenController.text = oldDetails.histopathSpecimen!; bloodLossDetailController.text = oldDetails.bloodLossDetail;
microbiologySpecimenController.text = oldDetails.microbiologySpecimen!; histopathSpecimenController.text = oldDetails.histopathSpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen!; microbiologySpecimenController.text =
oldDetails.microbiologySpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen;
scrubNurseController.text = oldDetails.scrubNurse; scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse; circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text = oldDetails.bloodTransfusedDetail; BloodTransfusedDetailController.text =
anasthetistController.text = oldDetails.anasthetist!; oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist;
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -138,92 +146,107 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
child: Column( child: Column(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).reservation, hintText: TranslationBase.of(context)
.reservation,
controller: OTReservationID, controller: OTReservationID,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).preOperationDiagnosis, hintText: TranslationBase.of(context)
.preOperationDiagnosis,
controller: preOpDiagmosisController, controller: preOpDiagmosisController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: preOpDiagmosisController
onClick: () {}, .text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).postOperationDiagnosis, hintText: TranslationBase.of(context)
.postOperationDiagnosis,
controller: postOpDiagmosisNoteController, controller: postOpDiagmosisNoteController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, postOpDiagmosisNoteController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).surgeon, hintText:
TranslationBase.of(context).surgeon,
controller: surgeonController, controller: surgeonController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, surgeonController.text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).assistant, hintText:
TranslationBase.of(context).assistant,
controller: assistantNoteController, controller: assistantNoteController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: assistantNoteController
onClick: () {}, .text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).operation, hintText:
TranslationBase.of(context).operation,
controller: operationController, controller: operationController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, operationController.text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -237,201 +260,248 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, inasionController.text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).finding, hintText:
TranslationBase.of(context).finding,
controller: findingController, controller: findingController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, findingController.text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).surgeryProcedure, hintText: TranslationBase.of(context)
.surgeryProcedure,
controller: surgeryProcedureController, controller: surgeryProcedureController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, surgeryProcedureController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).postOperationInstruction, hintText: TranslationBase.of(context)
.postOperationInstruction,
controller: postOpInstructionController, controller: postOpInstructionController,
maxLines: 20, maxLines: 20,
minLines: 8, minLines: 8,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, postOpInstructionController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).complicationDetails1, hintText: TranslationBase.of(context)
.complicationDetails1,
controller: complicationDetailsController, controller: complicationDetailsController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, complicationDetailsController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).bloodLossDetail, hintText: TranslationBase.of(context)
.bloodLossDetail,
controller: bloodLossDetailController, controller: bloodLossDetailController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: bloodLossDetailController
onClick: () {}, .text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).histopathSpecimen, hintText: TranslationBase.of(context)
.histopathSpecimen,
controller: histopathSpecimenController, controller: histopathSpecimenController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, histopathSpecimenController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).microbiologySpecimen, hintText: TranslationBase.of(context)
controller: microbiologySpecimenController, .microbiologySpecimen,
controller:
microbiologySpecimenController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, microbiologySpecimenController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).otherSpecimen, hintText: TranslationBase.of(context)
.otherSpecimen,
controller: otherSpecimenController, controller: otherSpecimenController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: otherSpecimenController
onClick: () {}, .text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).scrubNurse, hintText: TranslationBase.of(context)
.scrubNurse,
controller: scrubNurseController, controller: scrubNurseController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, scrubNurseController.text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).circulatingNurse, hintText: TranslationBase.of(context)
.circulatingNurse,
controller: circulatingNurseController, controller: circulatingNurseController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, circulatingNurseController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).bloodTransfusedDetail, hintText: TranslationBase.of(context)
controller: BloodTransfusedDetailController, .bloodTransfusedDetail,
controller:
BloodTransfusedDetailController,
maxLines: 20, maxLines: 20,
minLines: 4, minLines: 4,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, BloodTransfusedDetailController
onChanged: (value) {}, .text.isEmpty &&
onFieldSubmitted: () {}, isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).anesthetist, hintText: TranslationBase.of(context)
.anesthetist,
controller: anasthetistController, controller: anasthetistController,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError:
onClick: () {}, anasthetistController.text.isEmpty &&
onChanged: (value) {}, isSubmitted
onFieldSubmitted: () {}, ? TranslationBase.of(context)
.emptyMessage
: null,
), ),
SizedBox( SizedBox(
height: 250, height: 250,
@ -453,13 +523,17 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
) )
: Container( : Container(
height: 70, height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: AppButton( child: AppButton(
title: (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + " " + TranslationBase.of(context).operationReports, title: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
" " +
TranslationBase.of(context).operationReports,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
// disabled: operationReportsController.text.isEmpty, // disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -471,33 +545,55 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getDoctorProfile(); await model.getDoctorProfile();
CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel( CreateUpdateOperationReportRequestModel
inasion: inasionController.text, createUpdateOperationReportRequestModel =
CreateUpdateOperationReportRequestModel(
/// TODO Elham* Add dynamic reservation inasion: inasionController.text,
reservationNo: widget.reservation!.oTReservationID,
preOpDiagmosis: preOpDiagmosisController.text, /// TODO Elham* Add dynamic reservation
postOpDiagmosis: postOpDiagmosisNoteController.text, reservationNo: widget
surgeon: surgeonController.text, .reservation.oTReservationID,
assistant: assistantNoteController.text, preOpDiagmosis:
anasthetist: assistantNoteController.text, preOpDiagmosisController.text,
operation: operationController.text, postOpDiagmosis:
finding: findingController.text, postOpDiagmosisNoteController
surgeryProcedure: surgeonController.text, .text,
postOpInstruction: postOpInstructionController.text, surgeon: surgeonController.text,
complicationDetails: complicationDetailsController.text, assistant:
bloodLossDetail: bloodLossDetailController.text, assistantNoteController.text,
histopathSpecimen: histopathSpecimenController.text, anasthetist:
microbiologySpecimen: microbiologySpecimenController.text, assistantNoteController.text,
otherSpecimen: otherSpecimenController.text, operation: operationController.text,
scrubNurse: surgeonController.text, finding: findingController.text,
circulatingNurse: circulatingNurseController.text, surgeryProcedure:
bloodTransfusedDetail: bloodLossDetailController.text, surgeonController.text,
patientID: widget.patient!.patientId!, postOpInstruction:
admissionNo: int.parse(widget.patient!.admissionNo!), postOpInstructionController.text,
createdBy: model.doctorProfile!.doctorID!, complicationDetails:
setupID: "010266"); complicationDetailsController
await model.updateOperationReport(createUpdateOperationReportRequestModel); .text,
bloodLossDetail:
bloodLossDetailController.text,
histopathSpecimen:
histopathSpecimenController.text,
microbiologySpecimen:
microbiologySpecimenController
.text,
otherSpecimen:
otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse:
circulatingNurseController.text,
bloodTransfusedDetail:
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo: int.parse(
widget.patient.admissionNo),
createdBy:
model.doctorProfile.doctorID,
);
await model.updateOperationReport(
createUpdateOperationReportRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
@ -505,7 +601,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// await model.( // await model.(
// operationReportsRequest.toJson()); // operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast("Your Order added Successfully"); DrAppToastMsg.showSuccesToast(
"Your Order added Successfully");
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }

@ -1,24 +1,24 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart';
import 'package:doctor_app_flutter/utils/notification_permission_utils.dart'; import 'package:doctor_app_flutter/utils/notification_permission_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -26,36 +26,42 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:quiver/async.dart'; import 'package:quiver/async.dart';
import '../../../../locator.dart';
import '../../../../routes.dart';
class PatientProfileScreen extends StatefulWidget { class PatientProfileScreen extends StatefulWidget {
@override @override
_PatientProfileScreenState createState() => _PatientProfileScreenState(); _PatientProfileScreenState createState() => _PatientProfileScreenState();
} }
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin { class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false; bool isFromSearch = false;
bool isFromLiveCare = false; bool isFromLiveCare = false;
bool isSigned = false;
bool isInpatient = false; bool isInpatient = false;
bool isMyPatient = false; bool isMyPatient = false;
bool isCallFinished = false; bool isCallFinished = false;
bool isDischargedPatient = false; bool isDischargedPatient = false;
bool isSearchAndOut = false; bool isSearchAndOut = false;
bool isCallStarted = false; bool isCallStarted = false;
String? patientType; String patientType;
String? arrivalType; String arrivalType;
String? from; String from;
String? to; String to;
TabController? _tabController; TabController _tabController;
int index = 0; int index = 0;
int _activeTab = 0; int _activeTab = 0;
late StreamController<String> videoCallDurationStreamController; StreamController<String> videoCallDurationStreamController;
late Stream<String> videoCallDurationStream; Stream<String> videoCallDurationStream = (() async* {})();
@override @override
void initState() { void initState() {
@ -67,22 +73,23 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
@override @override
void dispose() { void dispose() {
_tabController!.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
if (isFromLiveCare) { if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId!); _liveCareViewModel.removePatientFromDoctorList(patient.vcId);
} }
} }
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
from = routeArgs['from']; from = routeArgs['from'];
to = routeArgs['to']; to = routeArgs['to'];
isSigned = routeArgs['isSigned'];
if (routeArgs.containsKey("isSearch")) { if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch']; isFromSearch = routeArgs['isSearch'];
} }
@ -110,7 +117,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_activeTab = 1; _activeTab = 1;
} }
late StreamSubscription callTimer; StreamSubscription callTimer;
callConnected() { callConnected() {
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
@ -125,7 +132,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
callDisconnected() { callDisconnected() {
callTimer.cancel(); callTimer.cancel();
videoCallDurationStreamController.sink.add(""); videoCallDurationStreamController.sink.add(null);
setState(() { setState(() {
isCallStarted = false; isCallStarted = false;
@ -135,9 +142,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId!); if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -150,7 +158,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [ children: [
Column( Column(
children: [ children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!, PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType,
videoCallDurationStream: videoCallDurationStream, videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient, isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
@ -172,31 +180,32 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
child: isSearchAndOut child: isSearchAndOut
? ProfileGridForSearch( ? ProfileGridForSearch(
patient: patient, patient: patient,
patientType: patientType!, patientType: patientType,
arrivalType: arrivalType!, arrivalType: arrivalType,
isInpatient: isInpatient, isInpatient: isInpatient,
from: from!, from: from,
to: to!, to: to,
) )
: isInpatient : isInpatient
? ProfileGridForInPatient( ? ProfileGridForInPatient(
patient: patient, patient: patient,
patientType: patientType!, patientType: patientType,
arrivalType: arrivalType!, arrivalType: arrivalType,
isInpatient: isInpatient, isInpatient: isInpatient,
from: from!, from: from,
to: to!, to: to,
isDischargedPatient: isDischargedPatient, isDischargedPatient: isDischargedPatient,
isFromSearch: isFromSearch, isFromSearch: isFromSearch,
) )
: ProfileGridForOther( : ProfileGridForOther(
patient: patient, patient: patient,
patientType: patientType!, patientType: patientType,
arrivalType: arrivalType!, arrivalType: arrivalType,
isInpatient: isInpatient, isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
from: from!, from: from,
to: to!, to: to,
projectViewModel: projectViewModel,
), ),
), ),
SizedBox( SizedBox(
@ -238,7 +247,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontColor: Colors.white, fontColor: Colors.white,
// vPadding: 8, // vPadding: 8,
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30, radius: 30,
hPadding: 25, hPadding: 25,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -257,7 +266,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (patient.episodeNo != 0) if (patient.episodeNo != 0)
AppButton( AppButton(
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal, // disabled: model.state == ViewState.BusyLocal || isSigned,
title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
? AppGlobal.appRedColor ? AppGlobal.appRedColor
@ -266,7 +275,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontColor: Colors.white, fontColor: Colors.white,
// vPadding: 8, // vPadding: 8,
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30, radius: 30,
hPadding: 25, hPadding: 25,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -314,7 +323,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
child: Center( child: Center(
child: AppButton( child: AppButton(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: isCallFinished ? Colors.red[600]! : AppGlobal.appGreenColor, color: isCallFinished ? Colors.red[600] : AppGlobal.appGreenColor,
title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall, title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall,
disabled: isCallStarted || model.state == ViewState.BusyLocal, disabled: isCallStarted || model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
@ -340,7 +349,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
); );
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall(isReCall: false, vCID: patient.vcId!); await model.startCall(isReCall: false, vCID: patient.vcId);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -358,7 +367,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
context: context, context: context,
onTapGrant: () { onTapGrant: () {
locator<VideoCallService>() locator<VideoCallService>()
.openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected); .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected);
}); });
} }
} }
@ -373,24 +382,24 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
], ],
), ),
) )
: SizedBox(), : null,
), ),
); );
} }
createEpisode({PatiantInformtion? patient, SOAPViewModel? model}) async { createEpisode({PatiantInformtion patient, SOAPViewModel model}) async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Patient Profile", eventCategory: "Patient Profile",
eventAction: "Create Episode", eventAction: "Create Episode",
); );
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patient!.admissionNo != null && patient.admissionNo!.isNotEmpty) { if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId); PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId);
await model!.postEpisodeForInPatient(postEpisodeReqModel); await model.postEpisodeForInPatient(postEpisodeReqModel);
} else { } else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
await model!.postEpisode(postEpisodeReqModel); await model.postEpisode(postEpisodeReqModel);
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -1,144 +1,67 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../routes.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class ProfileGridForOther extends StatelessWidget { class ProfileGridForOther extends StatelessWidget {
final PatiantInformtion? patient; final PatiantInformtion patient;
final String? patientType; final String patientType;
final String? arrivalType; final String arrivalType;
final double? height; final double height;
final bool isInpatient; final bool isInpatient;
final bool isFromLiveCare; final bool isFromLiveCare;
String? from; String from;
String? to; String to;
ProjectViewModel projectViewModel;
ProfileGridForOther({Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isFromLiveCare = false}) : super(key: key); ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient),
TranslationBase.of(context).vital, PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
TranslationBase.of(context).signs, PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg',
VITAL_SIGN_DETAILS, isInPatient: isInpatient),
'assets/images/svgs/profile_screen/vital signs.svg', PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient, isInPatient: isInpatient),
//onTap: () {}, PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD,
), 'assets/images/svgs/profile_screen/order prescription.svg',
PatientProfileCardModel( isInPatient: isInpatient),
TranslationBase.of(context).lab, PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg',
TranslationBase.of(context).result, isInPatient: isInpatient),
LAB_RESULT, PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg',
'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
isInPatient: isInpatient, PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient),
//onTap: () {}, PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg',
), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg',
TranslationBase.of(context).lab, isInPatient: isInpatient),
TranslationBase.of(context).special, PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg',
ALL_SPECIAL_LAB_RESULT, isInPatient: isInpatient),
'assets/images/svgs/profile_screen/lab results.svg', if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
isInPatient: isInpatient, PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg',
//onTap: () {}, isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
"ECG",
PATIENT_ECG,
'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient,
//onTap: () {},
),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
//onTap: () {},
),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral,
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR, REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null,
//onTap: () {},
),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
//onTap: () {},
), ),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isDisable:
Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null),
]; ];
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
@ -155,11 +78,11 @@ class ProfileGridForOther extends StatelessWidget {
//change the number as you want //change the number as you want
children: cardsList.map((item) { children: cardsList.map((item) {
return PatientProfileButton( return PatientProfileButton(
patient: patient!, patient: patient,
patientType: patientType!, patientType: patientType,
arrivalType: arrivalType!, arrivalType: arrivalType,
from: from!, from: from,
to: to!, to: to,
nameLine1: item.nameLine1, nameLine1: item.nameLine1,
nameLine2: item.nameLine2, nameLine2: item.nameLine2,
route: item.route, route: item.route,
@ -167,8 +90,7 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: item.isInPatient, isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient, isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable, isDisable: item.isDisable,
onTap: () {}, onTap: item.onTap,
//item.onTap!(),
isLoading: item.isLoading, isLoading: item.isLoading,
); );
}).toList(), }).toList(),

@ -1,41 +1,55 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../../locator.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology? finalRadiology; final FinalRadiology finalRadiology;
final PatiantInformtion? patient; final PatiantInformtion patient;
final String? patientType; final String patientType;
final String? arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isVidaPlus;
RadiologyDetailsPage({Key? key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(patient: patient!, projectId: finalRadiology!.projectID, lineItem: finalRadiology!.invoiceLineItemNo, invoiceNo: finalRadiology!.invoiceNo), onModelReady: (model) => model.getRadImageURL(
patient: patient,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceType:finalRadiology.invoiceType,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID,
),
),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient!, patient,
appointmentDate: finalRadiology!.orderDate!, appointmentDate: finalRadiology.orderDate,
doctorName: finalRadiology!.doctorName, doctorName: finalRadiology.doctorName,
clinic: finalRadiology!.clinicDescription, clinic: finalRadiology.clinicDescription,
branch: finalRadiology!.projectName, branch: finalRadiology.projectName,
profileUrl: finalRadiology!.doctorImageURL, profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology!.invoiceNo.toString(), invoiceNO: finalRadiology.invoiceNo.toString(),
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
isShowAppBar: true, isShowAppBar: true,
@ -68,7 +82,7 @@ class RadiologyDetailsPage extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(
'${finalRadiology!.reportData.trim()}', '${finalRadiology.reportData.trim()}',
textAlign: TextAlign.start, textAlign: TextAlign.start,
isCopyable: true, isCopyable: true,
fontSize: 17, fontSize: 17,
@ -92,19 +106,18 @@ class RadiologyDetailsPage extends StatelessWidget {
margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton( child: AppButton(
color: Color(0xffD02127), color: Color(0xffD02127),
disabled: finalRadiology!.dIAPACSURL == "",
onPressed: () async { onPressed: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "RadiologyDetailsPage", eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image", eventAction: "Open Radiology Image",
); );
launchUrlString(model.radImageURL); launch(model.radImageURL);
}, },
title: TranslationBase.of(context).openRad, title: TranslationBase.of(context).openRad,
), ),
), ),
) )
: SizedBox(), : null,
), ),
); );
} }

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
@ -12,29 +12,30 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_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 '../../../../widgets/shared/errors/error_message.dart';
class RadiologyHomePage extends StatefulWidget { class RadiologyHomePage extends StatefulWidget {
@override @override
_RadiologyHomePageState createState() => _RadiologyHomePageState(); _RadiologyHomePageState createState() => _RadiologyHomePageState();
} }
class _RadiologyHomePageState extends State<RadiologyHomePage> { class _RadiologyHomePageState extends State<RadiologyHomePage> {
String? patientType; String patientType;
PatiantInformtion? patient; PatiantInformtion patient;
String? arrivalType; String arrivalType;
bool isInpatient = false; bool isInpatient;
bool isFromLiveCare = false; bool isFromLiveCare;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
patientType = routeArgs['patientType']; patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType']; arrivalType = routeArgs['arrivalType'];
@ -47,14 +48,13 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient!, onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100]!, backgroundColor: Colors.grey[100],
// appBarTitle: TranslationBase.of(context).radiology, // appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient!, patient,
isInpatient: isInpatient, isInpatient: isInpatient,
), ),
baseViewModel: model, baseViewModel: model,
@ -66,28 +66,24 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.radiologyList.isNotEmpty && if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43)
patient!.patientStatusType != 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
if (patient!.patientStatusType != null && if (patient.patientStatusType != null && patient.patientStatusType == 43)
patient!.patientStatusType == 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
if ((patient!.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
patient!.patientStatusType == 43) ||
(isFromLiveCare && patient!.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
SlideUpPageRoute( SlideUpPageRoute(
widget: BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient!, patient: patient,
previousProcedureViewModel: model, previousProcedureViewModel: model,
procedureType: ProcedureType.RADIOLOGY, procedureType: ProcedureType.RADIOLOGY,
), ),
@ -96,6 +92,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
}, },
label: TranslationBase.of(context).applyForRadiologyOrder, label: TranslationBase.of(context).applyForRadiologyOrder,
), ),
///TODO Elham * fix this to be list view builder ///TODO Elham * fix this to be list view builder
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
@ -117,43 +114,26 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: model.radiologyList[index] color: model.radiologyList[index].isLiveCareAppodynamicment
.isLiveCareAppodynamicment! ? Colors.red[900]
? Colors.red[900]! : !model.radiologyList[index].isInOutPatient
: !model.radiologyList[index].isInOutPatient!
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
? Radius.circular(0) bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
: Radius.circular(8), topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomLeft: projectViewModel.isArabic bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0)),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.radiologyList[index] model.radiologyList[index].isLiveCareAppodynamicment
.isLiveCareAppodynamicment! ? TranslationBase.of(context).liveCare.toUpperCase()
? TranslationBase.of(context) : !model.radiologyList[index].isInOutPatient
.liveCare ? TranslationBase.of(context).inPatientLabel.toUpperCase()
.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(),
: !model.radiologyList[index]
.isInOutPatient!
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -161,28 +141,27 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Expanded( Expanded(
child: DoctorCard( child: DoctorCard(
isNoMargin: true, isNoMargin: true,
doctorName: doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName),
Utils.convertToTitleCase(model.radiologyList[index].doctorName), profileUrl: model.radiologyList[index].doctorImageURL,
profileUrl: invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
model.radiologyList[index].doctorImageURL, ? '${model.radiologyList[index].invoiceNo_VP}'
invoiceNO: : '${model.radiologyList[index].invoiceNo}',
'${model.radiologyList[index].invoiceNo}', // model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}',
branch: branch: '${model.radiologyList[index].projectName}',
'${model.radiologyList[index].projectName}', clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
clinic: appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate,
Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate:
model.radiologyList[index].orderDate ??
model.radiologyList[index].reportDate!,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: RadiologyDetailsPage( page: RadiologyDetailsPage(
finalRadiology: finalRadiology: model.radiologyList[index],
model.radiologyList[index],
patient: patient, patient: patient,
isInpatient: isInpatient), isInpatient: isInpatient,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
// false
// model.radiologyList[index].isRecordFromVidaPlus
),
), ),
); );
}, },
@ -191,8 +170,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
], ],
), ),
)), )),
if (model.radiologyList.isEmpty && if (model.radiologyList.isEmpty && patient.patientStatusType != 43)
patient!.patientStatusType != 43)
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,

@ -2,21 +2,22 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/PatientType.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../../routes.dart';
class ReferredPatientDetailScreen extends StatelessWidget { class ReferredPatientDetailScreen extends StatelessWidget {
final MyReferredPatientModel referredPatient; final MyReferredPatientModel referredPatient;
final PatientType patientType; final PatientType patientType;
@ -52,9 +53,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
(Utils.capitalize( (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
"${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5,
fontSize: SizeConfig.textMultiplier!! * 2.5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -70,19 +70,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = PatiantInformtion patient = model.getPatientFromReferral(referredPatient);
model.getPatientFromReferral(referredPatient); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": "isInpatient": patientType == PatientType.IN_PATIENT,
patientType == PatientType.IN_PATIENT,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Icon( child: Icon(
@ -97,19 +92,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
PatiantInformtion patient = PatiantInformtion patient = model.getPatientFromReferral(referredPatient);
model.getPatientFromReferral(referredPatient); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": "isInpatient": patientType == PatientType.IN_PATIENT,
patientType == PatientType.IN_PATIENT,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
}); });
}, },
child: Column( child: Column(
@ -120,9 +110,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child: Image.asset(
referredPatient.gender == 1 referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -133,8 +121,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
AppText( AppText(
TranslationBase.of(context).viewProfile, TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.red[700]!, color: Colors.red[700],
) )
], ],
), ),
@ -146,46 +134,39 @@ class ReferredPatientDetailScreen extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referredPatient.referralStatusDesc!, referredPatient.referralStatusDesc,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier!, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1 color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor ? AppGlobal.inProgressColor
: referredPatient.referralStatus == 46 : referredPatient.referralStatus == 46
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Colors.red[700]!, : Colors.red[700],
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat( AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"),
referredPatient.referralDate!,
"dd MMM,yyyy"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier!, fontSize: 2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E), color: Color(0XFF28353E),
) )
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).fileNumber,
.fileNumber,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
@ -198,40 +179,34 @@ class ReferredPatientDetailScreen extends StatelessWidget {
], ],
), ),
AppText( AppText(
AppDateUtils.convertDateFromServerFormat( AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"),
referredPatient.referralDate!,
"hh:mm a"),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF575757), color: Color(0XFF575757),
) )
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).refClinic}: ", "${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient.referralClinicDescription,
.referralClinicDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 13, fontSize: 13,
@ -240,29 +215,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if (referredPatient if (referredPatient.frequencyDescription != null)
.frequencyDescription !=
null)
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).frequency + ": ",
.frequency +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * fontSize: 1.7 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient.frequencyDescription,
.frequencyDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 14, fontSize: 14,
@ -277,29 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
referredPatient.nationalityName != referredPatient.nationalityName != null ? referredPatient.nationalityName : "",
null
? referredPatient.nationalityName!
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: fontSize: 1.4 * SizeConfig.textMultiplier,
1.4 * SizeConfig.textMultiplier!,
), ),
referredPatient.nationalityFlagURL != referredPatient.nationalityFlagURL != null
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient referredPatient.nationalityFlagURL,
.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
context,
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -311,20 +268,17 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (referredPatient.priorityDescription != null) if (referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).priority + TranslationBase.of(context).priority + ": ",
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
AppText( AppText(
referredPatient.priorityDescription!, referredPatient.priorityDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 14, fontSize: 14,
@ -335,33 +289,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (referredPatient.mAXResponseTime != null) if (referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).maxResponseTime + ": ",
.maxResponseTime +
": ",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: fontSize: 1.7 * SizeConfig.textMultiplier,
1.7 * SizeConfig.textMultiplier!,
color: Color(0XFF575757), color: Color(0XFF575757),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.mAXResponseTime != referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '',
null
? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime!,
"dd MMM,yyyy")
: '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.8 * SizeConfig.textMultiplier,
1.8 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ),
@ -371,8 +313,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 10, right: 0),
EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
'assets/images/patient/ic_ref_arrow_left.png', 'assets/images/patient/ic_ref_arrow_left.png',
height: 50, height: 50,
@ -380,34 +321,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, padding: EdgeInsets.only(left: 4.0, right: 4.0),
top: 25, child: referredPatient.doctorImageURL != null
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL !=
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL!, referredPatient.doctorImageURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
(BuildContext context,
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
: Container( : Container(
child: Image.asset( child: Image.asset(
referredPatient.gender == 1 referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -415,30 +344,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
left: 10,
top: 30,
right: 10,
bottom: 0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * fontSize: 1.5 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Colors.black, color: Colors.black,
), ),
AppText( AppText(
referredPatient referredPatient.referralClinicDescription,
.referralClinicDescription!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.3 * fontSize: 1.3 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -478,14 +399,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).remarks, TranslationBase.of(context).remarks,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier!, fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referringDoctorRemarks!, referredPatient.referringDoctorRemarks,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
SizedBox( SizedBox(
@ -495,27 +416,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0),
left: 0, top: 0, right: 4, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0), padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL != null child: referredPatient.doctorImageURL != null
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
referredPatient.doctorImageURL!, referredPatient.doctorImageURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
: Container( : Container(
child: Image.asset( child: Image.asset(
referredPatient.gender == 1 referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -528,22 +444,18 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).reply, TranslationBase.of(context).reply,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referredDoctorRemarks == referredPatient.referredDoctorRemarks == null
null
? '' ? ''
: referredPatient.referredDoctorRemarks! : referredPatient.referredDoctorRemarks.isNotEmpty
.isNotEmpty ? referredPatient.referredDoctorRemarks
? referredPatient : TranslationBase.of(context).notRepliedYet,
.referredDoctorRemarks!
: TranslationBase.of(context)
.notRepliedYet,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier!, fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -561,14 +473,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).acknowledged, title: TranslationBase.of(context).acknowledged,
color: Colors.red[700]!, color: Colors.red[700],
fontColor: Colors.white, fontColor: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null disabled: referredPatient.referredDoctorRemarks == null
? true ? true
: referredPatient.referredDoctorRemarks!.isNotEmpty : referredPatient.referredDoctorRemarks.isNotEmpty
? false ? false
: true, : true,
onPressed: () async { onPressed: () async {
@ -576,8 +488,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Referral is acknowledged");
"Referral is acknowledged");
Navigator.pop(context); Navigator.pop(context);
} }
}, },

@ -2,18 +2,19 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -26,13 +27,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class AddAssessmentDetails extends StatefulWidget { class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment? mySelectedAssessment; final MySelectedAssessment mySelectedAssessment;
final List<MySelectedAssessment>? mySelectedAssessmentList; final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)? addSelectedAssessment; final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final PatiantInformtion? patientInfo; final PatiantInformtion patientInfo;
final bool isUpdate; final bool isUpdate;
AddAssessmentDetails({Key? key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); AddAssessmentDetails({Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList});
@override @override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -45,23 +46,23 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController typeController = TextEditingController(); TextEditingController typeController = TextEditingController();
TextEditingController icdNameController = TextEditingController(); TextEditingController icdNameController = TextEditingController();
GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>> key = GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment!.remark ?? ""; remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text = widget.mySelectedAssessment!.appointmentId.toString(); appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) { if (widget.isUpdate) {
if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null) if (widget.mySelectedAssessment.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!; conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
if (widget.mySelectedAssessment!.selectedDiagnosisType != null) if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisType!.nameEn!; typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn;
if (widget.mySelectedAssessment!.selectedICD != null) icdNameController.text = widget.mySelectedAssessment!.selectedICD!.code; if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
} }
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) { InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData icon, String validationError}) {
return new InputDecoration( return new InputDecoration(
fillColor: Colors.white, fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@ -91,7 +92,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
heightFactor: 1, heightFactor: 1,
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.callAddAssessmentLookupsServices(); // model.callAddAssessmentLookupsServices();
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -114,76 +115,133 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: AppTextFieldCustom( child: AppTextFieldCustom(
// height: 55.0, // height: 55.0,
height: Utils.getTextFieldHeight(), height: Utils.getTextFieldHeight(),
hintText: TranslationBase.of(context).appointmentNumber, hintText: TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: false, enabled: false,
controller: appointmentIdController, controller: appointmentIdController,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Column(
child: InkWell( children:[ InkWell(
onTap: model.listOfICD10 != null onTap: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment!.selectedICD = null; widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = ""; icdNameController.text = null;
}); });
} }
: null, : null,
child: widget.mySelectedAssessment!.selectedICD == null child: AppTextFieldCustom(
? CustomAutoCompleteTextField( onChanged: (text){
isShowError: isFormSubmitted && widget.mySelectedAssessment!.selectedICD == null, setState(() {
child: AutoCompleteTextField<MasterKeyModel>( icdNameController.text;
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, "", true, suffixIcon: Icons.search), });
itemSubmitted: (item) => setState(() { },
widget.mySelectedAssessment!.selectedICD = item; height: Utils.getTextFieldHeight(),
icdNameController.text = '${item.code.trim()}/${item.description}'; onClick: model.listOfICD10 != null
}), ? () {
key: key, setState(() {
suggestions: model.listOfICD10, widget.mySelectedAssessment.selectedICD = null;
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), padding: EdgeInsets.all(8.0)), icdNameController.text = null;
itemSorter: (a, b) => 1, });
itemFilter: (suggestion, input) => }
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || : null,
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || hintText: TranslationBase.of(context).nameOrICD,
suggestion.code.toLowerCase().startsWith(input.toLowerCase()), maxLines: 1,
), minLines: 1,
) controller: icdNameController,
: AppTextFieldCustom( enabled: true,
height: Utils.getTextFieldHeight(), isTextFieldHasSuffix: true,
onClick: model.listOfICD10 != null suffixIcon: IconButton(
? () { onPressed: () {
setState(() { print(icdNameController.text);
widget.mySelectedAssessment!.selectedICD = null; if (icdNameController.text.length <= 3) {
icdNameController.text = ""; DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
}); } else {
} model.listOfICD10.clear();
: () {}, model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
hintText: TranslationBase.of(context).nameOrICD, }
maxLines: 1, },
minLines: 1, icon: Icon(
controller: icdNameController, Icons.search,
enabled: true, color: Colors.grey.shade600,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
),
onPressed: () {},
),
onChanged: (value) {},
onFieldSubmitted: () {},
)), )),
), )),
if (widget.mySelectedAssessment!.selectedICD != null)
model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child:ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemBuilder: (context, index) {
return InkWell(child:ListTile(
title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: (){
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear();
setState(() {
});
}
);
},
)) :SizedBox()
// CustomAutoCompleteTextField(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// AutoCompleteTextField<MasterKeyModel>(
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// controller: icdNameController,
// itemSubmitted: (item) => setState(() {
// widget.mySelectedAssessment.selectedICD = item;
// // icdNameController.text = '${item.code.trim()}/${item.description}';
// icdNameController.text = '${item.description}';
// }),
// key: key,
// suggestions: model.listOfICD10,
// suggestionsAmount: model.listOfICD10.length,
// itemBuilder: (context, suggestion) =>
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
//
// ),
// Expanded(
// child: IconButton(
// onPressed: () {
// print(icdNameController.text);
// if (icdNameController.text.length <= 3) {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// } else {
// model.listOfICD10.clear();
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// }
// },
// icon: Icon(Icons.search),
// ),
// ),
// ],
// ),
// )
]),
if (widget.mySelectedAssessment.selectedICD != null)
Column( Column(
children: [ children: [
SizedBox( SizedBox(
@ -192,7 +250,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container( Container(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
child: AppText( child: AppText(
widget.mySelectedAssessment!.selectedICD!.description + (' (${widget.mySelectedAssessment!.selectedICD!.code} )'), widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'),
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -211,13 +269,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition, list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment!.selectedDiagnosisCondition!, selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: (MasterKeyModel selectedValue) { okFunction: (MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment!.selectedDiagnosisCondition = selectedValue; widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
conditionController.text = projectViewModel.isArabic conditionController.text =
? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
: widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!;
}); });
}, },
); );
@ -229,7 +286,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
}, },
); );
} }
: () {}, : null,
hintText: TranslationBase.of(context).condition, hintText: TranslationBase.of(context).condition,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
@ -237,9 +294,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -251,11 +306,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment!.selectedDiagnosisType!, selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,
okFunction: (MasterKeyModel selectedValue) { okFunction: (MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment!.selectedDiagnosisType = selectedValue; widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!; typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn;
}); });
}, },
); );
@ -267,7 +322,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
}, },
); );
} }
: () {}, : null,
hintText: TranslationBase.of(context).dType, hintText: TranslationBase.of(context).dType,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
@ -275,9 +330,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
controller: typeController, controller: typeController,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null,
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -291,14 +344,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
controller: remarkController, controller: remarkController,
onChanged: (value) { onChanged: (value) {
widget.mySelectedAssessment!.remark = remarkController.text; widget.mySelectedAssessment.remark = remarkController.text;
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort (SizeConfig.isHeightVeryShort
? 20 ? 20
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
@ -321,12 +372,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;
}); });
widget.mySelectedAssessment!.remark = remarkController.text; widget.mySelectedAssessment.remark = remarkController.text;
widget.mySelectedAssessment!.appointmentId = int.parse(appointmentIdController.text); widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null && if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment!.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedDiagnosisType != null &&
widget.mySelectedAssessment!.selectedICD != null) { widget.mySelectedAssessment.selectedICD != null) {
await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment!); await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment);
} }
}, },
), ),
@ -335,44 +386,50 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
); );
} }
submitAssessment({SOAPViewModel? model, MySelectedAssessment? mySelectedAssessment, bool isUpdate = false}) async { submitAssessment({SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) { if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
patientMRN: widget.patientInfo!.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo!.episodeNo, episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo!.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment!.remark, remarks: mySelectedAssessment.remark,
complexDiagnosis: true, complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code, icdcode10Id: mySelectedAssessment.selectedICD.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID); prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
await model!.patchAssessment(patchAssessmentReqModel); await model.patchAssessment(patchAssessmentReqModel);
} else { } else {
PostAssessmentRequestModel postAssessmentRequestModel = Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
new PostAssessmentRequestModel(patientMRN: widget.patientInfo!.patientMRN, episodeId: widget.patientInfo!.episodeNo, appointmentNo: widget.patientInfo!.appointmentNo, icdCodeDetails: [ DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
new IcdCodeDetails( PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
remarks: mySelectedAssessment!.remark, patientMRN: widget.patientInfo.patientMRN,
complexDiagnosis: true, episodeId: widget.patientInfo.episodeNo,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, appointmentNo: widget.patientInfo.appointmentNo,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, createdByName: doctorProfile.doctorName,
icdcode10Id: mySelectedAssessment.selectedICD!.code) createdBy: doctorProfile.doctorID,
]); icdCodeDetails: [
new IcdCodeDetails(
await model!.postAssessment(postAssessmentRequestModel); remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
]);
await model.postAssessment(postAssessmentRequestModel);
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName; mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment!(mySelectedAssessment, isUpdate); widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} }

@ -25,26 +25,20 @@ import 'assessment_call_back.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function? changePageViewIndex; final Function changePageViewIndex;
final PatiantInformtion? patientInfo; final PatiantInformtion patientInfo;
final Function? changeLoadingState; final Function changeLoadingState;
final int? currentIndex; final int currentIndex;
UpdateAssessmentPage( UpdateAssessmentPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
{Key? key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
@override @override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
} }
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack {
implements AssessmentCallBack {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = []; List<MySelectedAssessment> mySelectedAssessmentList = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -55,7 +49,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
model.setAssessmentCallBack(this); model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear(); mySelectedAssessmentList.clear();
await model.onUpdateAssessmentStepStart(widget.patientInfo!); await model.onUpdateAssessmentStepStart(widget.patientInfo);
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
model.patientAssessmentList.forEach((element) { model.patientAssessmentList.forEach((element) {
@ -71,28 +65,25 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
masterKeys: MasterKeysService.DiagnosisCondition, masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID, id: element.conditionID,
); );
if (diagnosisCondition != null && if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) {
diagnosisType != null && MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment(
diagnosisCondition != null) { appointmentNo: element.appointmentNo,
MySelectedAssessment temMySelectedAssessment = remark: element.remarks,
SoapUtils.generateMySelectedAssessment( diagnosisType: diagnosisType,
appointmentNo: element.appointmentNo, diagnosisCondition: diagnosisCondition,
remark: element.remarks, selectedICD: selectedICD,
diagnosisType: diagnosisType, doctorID: element.doctorID,
diagnosisCondition: diagnosisCondition, doctorName: element.doctorName,
selectedICD: selectedICD, createdBy: element.createdBy,
doctorID: element.doctorID, createdOn: element.createdOn,
doctorName: element.doctorName, icdCode10ID: element.icdCode10ID);
createdBy: element.createdBy,
createdOn: element.createdOn,
icdCode10ID: element.icdCode10ID);
mySelectedAssessmentList.add(temMySelectedAssessment); mySelectedAssessmentList.add(temMySelectedAssessment);
} }
}); });
} }
widget.changeLoadingState!(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -108,9 +99,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex!, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex!, changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo!, patientInfo: widget.patientInfo,
), ),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).assessment, headerTitle: TranslationBase.of(context).assessment,
@ -126,111 +117,73 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
Column( Column(
children: [ children: [
SOAPOpenItems( SOAPOpenItems(
label: label: "${TranslationBase.of(context).addAssessment}",
"${TranslationBase.of(context).addAssessment}",
onTap: () { onTap: () {
openAssessmentDialog(context, openAssessmentDialog(context, isUpdate: false, model: model);
isUpdate: false, model: model);
}, },
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Column( Column(
children: children: mySelectedAssessmentList.map((assessment) {
mySelectedAssessmentList.map((assessment) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15),
left: 5, right: 5, top: 15, bottom: 15),
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() * color: Color(0xFF2E303A),
3.6, fontFamily: 'Poppins',
color: Color(0xFF2E303A), fontWeight: FontWeight.w600,
fontFamily: 'Poppins', letterSpacing: -0.4),
children: <TextSpan>[
new TextSpan(
text: "ICD : ".toUpperCase(),
),
new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.code.trim().toUpperCase() ?? "" : ""),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
assessment.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn), isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.4), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
children: <TextSpan>[ ),
new TextSpan( AppText(
text: "ICD : ".toUpperCase(), assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn)) : AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
), ),
new TextSpan(
text: assessment
.selectedICD!.code
.trim()
.toUpperCase() ??
""),
], ],
), ),
), ],
Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
assessment.createdOn != null
? AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.parse(
assessment
.createdOn!), isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
AppText(
assessment.createdOn != null
? AppDateUtils.getHour(
DateTime.parse(
assessment
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.6,
),
],
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.50,
.size
.width *
0.50,
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.3,
.getTextMultiplierBasedOnWidth() *
4.3,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -238,9 +191,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: assessment text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.description.toString() : "",
.selectedICD!.description // text: assessment.selectedICD.description.toString(),
.toString(),
), ),
], ],
), ),
@ -249,34 +201,24 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(context).appointmentNo,
context)
.appointmentNo,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
new TextSpan( new TextSpan(
text: assessment.appointmentId text: assessment.appointmentId.toString() ?? "",
.toString() ??
"",
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
@ -287,36 +229,19 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(context).condition + " : ",
context)
.condition +
" : ",
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
new TextSpan( new TextSpan(
text: projectViewModel text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition.nameAr : assessment.selectedDiagnosisCondition.nameEn,
.isArabic
? assessment
.selectedDiagnosisCondition
!.nameAr
: assessment
.selectedDiagnosisCondition
!.nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
@ -327,36 +252,19 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(context).dType + ' : ',
context)
.dType +
' : ',
style: new TextStyle( style: new TextStyle(
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
new TextSpan( new TextSpan(
text: projectViewModel text: projectViewModel.isArabic ? assessment.selectedDiagnosisType.nameAr : assessment.selectedDiagnosisType.nameEn,
.isArabic
? assessment
.selectedDiagnosisType
!.nameAr
: assessment
.selectedDiagnosisType
!.nameEn,
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
@ -368,35 +276,20 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
RichText( RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
.getTextMultiplierBasedOnWidth() *
3.6,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of( text: TranslationBase.of(context).doctor + ' : ',
context)
.doctor +
' : ',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
), ),
new TextSpan( new TextSpan(
text: text: assessment.doctorName ?? '',
assessment.doctorName ??
'',
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
@ -408,29 +301,14 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
height: 6, height: 6,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 6, height: 6,
), ),
AppText( AppText((assessment.remark != null && assessment.remark != '') ? TranslationBase.of(context).remarks + " : " : '',
(assessment.remark != null && fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600),
assessment.remark !=
'')
? TranslationBase.of(
context)
.remarks +
" : "
: '',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600),
RemarkText( RemarkText(
remark: assessment.remark ?? "", remark: assessment.remark ?? "",
), ),
@ -439,22 +317,14 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
], ],
), ),
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end,
children: [ children: [
SizedBox( SizedBox(
height: MediaQuery.of(context) height: MediaQuery.of(context).size.height * 0.05,
.size
.height *
0.05,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
openAssessmentDialog(context, openAssessmentDialog(context, isUpdate: true, assessment: assessment, model: model);
isUpdate: true,
assessment: assessment,
model: model);
}, },
child: Icon( child: Icon(
DoctorApp.edit, DoctorApp.edit,
@ -488,11 +358,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
); );
} }
openAssessmentDialog(BuildContext context, openAssessmentDialog(BuildContext context, {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) {
{MySelectedAssessment? assessment, bool isUpdate = false, SOAPViewModel? model}) {
if (assessment == null) { if (assessment == null) {
assessment = SoapUtils.generateMySelectedAssessment( assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo);
remark: '', appointmentNo: widget.patientInfo!.appointmentNo);
} }
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -504,11 +372,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
isUpdate: isUpdate, isUpdate: isUpdate,
mySelectedAssessmentList: mySelectedAssessmentList, mySelectedAssessmentList: mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async {
bool isUpdate) async {
setState(() { setState(() {
if (!isUpdate) if (!isUpdate) mySelectedAssessmentList.add(mySelectedAssessment);
mySelectedAssessmentList.add(mySelectedAssessment);
}); });
}); });
}); });
@ -519,8 +385,8 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage>
if (mySelectedAssessmentList.isEmpty) { if (mySelectedAssessmentList.isEmpty) {
Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
} else { } else {
widget.changeLoadingState!(true); widget.changeLoadingState(true);
widget.changePageViewIndex!(3); widget.changePageViewIndex(3);
} }
} }
} }

@ -26,12 +26,12 @@ import 'examination_item_card.dart';
import 'objective_call_back.dart'; import 'objective_call_back.dart';
class UpdateObjectivePage extends StatefulWidget { class UpdateObjectivePage extends StatefulWidget {
final Function? changePageViewIndex; final Function changePageViewIndex;
final Function? changeLoadingState; final Function changeLoadingState;
final int currentIndex; final int currentIndex;
final PatiantInformtion? patientInfo; final PatiantInformtion patientInfo;
UpdateObjectivePage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex = 0}); UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
@override @override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState(); _UpdateObjectivePageState createState() => _UpdateObjectivePageState();
@ -39,7 +39,7 @@ class UpdateObjectivePage extends StatefulWidget {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack { class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
bool isSysExaminationExpand = false; bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = []; List<MySelectedExamination> mySelectedExamination = List();
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
@ -60,7 +60,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
model.setObjectiveCallBack(this); model.setObjectiveCallBack(this);
mySelectedExamination.clear(); mySelectedExamination.clear();
model.isAddExamInProgress = true; model.isAddExamInProgress = true;
await model.getPatientPhysicalExam(widget.patientInfo!); await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) { if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
@ -85,7 +85,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
mySelectedExamination.add(tempEam); mySelectedExamination.add(tempEam);
}); });
} }
widget.changeLoadingState!(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -101,8 +101,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex!, changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo!, patientInfo: widget.patientInfo,
), ),
ExpandableSOAPWidget( ExpandableSOAPWidget(
headerTitle: TranslationBase.of(context).physicalSystemExamination, headerTitle: TranslationBase.of(context).physicalSystemExamination,
@ -135,7 +135,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
.sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination!); removeExamination(examination.selectedExamination);
}); });
}).toList(), }).toList(),
), ),
@ -155,7 +155,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
.sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination(examination.selectedExamination!); removeExamination(examination.selectedExamination);
}); });
}).toList(), }).toList(),
) )
@ -164,7 +164,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
isExpanded: isSysExaminationExpand, isExpanded: isSysExaminationExpand,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 14 : 12), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12),
) )
], ],
), ),
@ -177,27 +177,27 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
if (!model.isAddExamInProgress && widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
widget.changeLoadingState!(true); widget.changeLoadingState(true);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) { mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM( ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo!.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo!.episodeNo == null ? 0 : widget.patientInfo!.episodeNo, episodeId: widget.patientInfo.episodeNo == null ? 0 : widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo!.appointmentNo == null ? 0 : widget.patientInfo!.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo == null ? 0 : widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID, createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination!.id, examId: exam.selectedExamination.id,
examType: exam.selectedExamination!.typeId, examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
notExamined: exam.notExamined, notExamined: exam.notExamined,
@ -213,12 +213,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
: "Not Examined", : "Not Examined",
isNew: exam.isNew, isNew: exam.isNew,
); );
if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo!.admissionNo!); listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo);
} else { } else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0; listHisProgNotePhysicalExaminationVM.admissionNo = 0;
} }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(listHisProgNotePhysicalExaminationVM); postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM);
}); });
if (model.patientPhysicalExamList.isEmpty) { if (model.patientPhysicalExamList.isEmpty) {
@ -228,20 +228,20 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
} }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState!(false); widget.changeLoadingState(false);
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
} }
} else { } else {
if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
widget.changeLoadingState!(false); widget.changeLoadingState(false);
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
} else { } else {
widget.changeLoadingState!(true); widget.changeLoadingState(true);
widget.changePageViewIndex!(2); widget.changePageViewIndex(2);
} }
} }
} }
@ -251,7 +251,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
} }
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId); Iterable<MySelectedExamination> history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) { if (history.length > 0) {
setState(() { setState(() {
@ -276,13 +276,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
setState(() { setState(() {
{ {
mySelectedExaminationLocal.forEach((element) { mySelectedExaminationLocal.forEach((element) {
if (( if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) {
mySelectedExamination.singleWhere(
(it) => it.selectedExamination!.id == element.selectedExamination!.id,
orElse: () => MySelectedExamination(),
),
) ==
null) {
mySelectedExamination.insert(0, element); mySelectedExamination.insert(0, element);
} }
}); });
@ -290,13 +284,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
/// remove items. /// remove items.
List<MySelectedExamination> removedList = []; List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) { mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) { if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) {
removedList.add(element); removedList.add(element);
} }
}); });
removedList.forEach((element) { removedList.forEach((element) {
removeExamination(element.selectedExamination!); removeExamination(element.selectedExamination);
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

@ -22,15 +22,15 @@ import '../shared_soap_widgets/SOAP_step_header.dart';
import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart';
class UpdatePlanPage extends StatefulWidget { class UpdatePlanPage extends StatefulWidget {
final Function? changePageViewIndex; final Function changePageViewIndex;
final PatiantInformtion? patientInfo; final PatiantInformtion patientInfo;
final Function? changeLoadingState; final Function changeLoadingState;
final Function? changeStateFun; final Function changeStateFun;
final SOAPViewModel? sOAPViewModel; final SOAPViewModel sOAPViewModel;
final int? currentIndex; final int currentIndex;
UpdatePlanPage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun}); UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
@ -67,27 +67,27 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async {
GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel(
appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()), appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo!.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo!.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!); progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn; patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName; patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo; patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = isAddProgress; isAddProgress = isAddProgress;
widget.sOAPViewModel!.isAddProgress = isAddProgress; widget.sOAPViewModel.isAddProgress = isAddProgress;
widget.sOAPViewModel!.progressNoteText = progressNoteController.text; widget.sOAPViewModel.progressNoteText = progressNoteController.text;
}); });
} }
} }
@ -96,31 +96,31 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.sOAPViewModel!.setPlanCallBack(this); widget.sOAPViewModel.setPlanCallBack(this);
GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel(
appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()), appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo!.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo!.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!); progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn; patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName; patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo; patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.progressNoteText = progressNoteController.text; widget.sOAPViewModel.progressNoteText = progressNoteController.text;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
widget.sOAPViewModel!.isAddProgress = false; widget.sOAPViewModel.isAddProgress = false;
}); });
} }
widget.changeLoadingState!(false); widget.changeLoadingState(false);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -133,9 +133,9 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
child: Column( child: Column(
children: [ children: [
SOAPStepHeader( SOAPStepHeader(
currentIndex: widget.currentIndex!, currentIndex: widget.currentIndex,
changePageViewIndex: widget.changePageViewIndex!, changePageViewIndex: widget.changePageViewIndex,
patientInfo: widget.patientInfo!, patientInfo: widget.patientInfo,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -163,15 +163,12 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
maxLines: 4, maxLines: 4,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (value) { onChanged: (value) {
if (value != null) setState(() {
setState(() { patientProgressNote.planNote = value;
patientProgressNote.planNote = value; model.progressNoteText = value;
model.progressNoteText = value; widget.changeStateFun();
widget.changeStateFun!(); });
});
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
@ -209,7 +206,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
), ),
AppText( AppText(
patientProgressNote.createdOn != null patientProgressNote.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn!)) ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn))
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
@ -233,7 +230,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
// ], // ],
// ), // ),
AppText( AppText(
patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getHour(DateTime.now()), patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn)) : AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
@ -256,7 +253,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
onTap: () { onTap: () {
setState(() { setState(() {
isAddProgress = true; isAddProgress = true;
widget.sOAPViewModel!.isAddProgress = true; widget.sOAPViewModel.isAddProgress = true;
}); });
}, },
child: Icon( child: Icon(
@ -275,7 +272,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
isExpanded: isProgressExpanded, isExpanded: isProgressExpanded,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10), height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
], ],
), ),
@ -287,50 +284,56 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
submitPlan(SOAPViewModel model) async { submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
widget.changeLoadingState!(true); widget.changeLoadingState(true);
PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel(
patientMRN: widget.patientInfo!.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo!.episodeNo!, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo!.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
planNote: patientProgressNote.planNote, planNote: patientProgressNote.planNote,
doctorID: '', doctorID: widget.patientInfo.doctorId,
createdBy:widget.patientInfo.doctorId ,
createdByName:widget.patientInfo.doctorName ,
editedBy: ''); editedBy: '');
if (widget.sOAPViewModel!.patientProgressNoteList.isEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel!.postProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel);
} else { } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel!.patchProgressNote(postProgressNoteRequestModel); await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel);
} }
if (widget.sOAPViewModel!.state == ViewState.ErrorLocal) { if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel!.error); Utils.showErrorToast(widget.sOAPViewModel.error);
} else { } else {
GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel(
appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()), appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
patientMRN: widget.patientInfo!.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo!.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '', editedBy: '',
doctorID: ''); doctorID: '');
await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel); await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!); progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn; patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName; patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo; patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;
widget.sOAPViewModel!.isAddProgress = false; widget.sOAPViewModel.isAddProgress = false;
}); });
} }
Navigator.of(context).pop();
Utils.showErrorToast("Episode Created Successfully");
} }
widget.changeLoadingState!(false); widget.changeLoadingState(false);
} else { } else {
Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} }

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

Loading…
Cancel
Save