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"
android {
compileSdkVersion 34
compileSdkVersion 33
signingConfigs {
release {
storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key')
storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor_app_key')
storePassword 'Hmgdoctor1234'
keyAlias 'hmgdoctor'
keyPassword 'Hmgdoctor1234'
@ -59,8 +59,7 @@ android {
buildTypes {
release {
// TODO: Add your own signing config for the release build.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
debug {
@ -91,8 +90,6 @@ flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
@ -115,8 +112,5 @@ dependencies {
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
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:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

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

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

@ -17,6 +17,9 @@ import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
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.model.*
import com.hmg.hmgDr.ui.VideoCallContract

@ -1,4 +1,4 @@
package com.hmg.hmgDr.model;
package com.hmg.hmgDr.Model;
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.Parcelable;

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

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

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

@ -20,9 +20,9 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat
import androidx.fragment.app.DialogFragment
import com.hmg.hmgDr.model.ChangeCallStatusRequestModel
import com.hmg.hmgDr.model.GetSessionStatusModel
import com.hmg.hmgDr.model.SessionStatusModel
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.ui.VideoCallContract.VideoCallPresenter
import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView
@ -143,8 +143,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
return R.style.dialogTheme
}
@SuppressLint("UseRequireInsteadOfGet")
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme
val layoutInflater = activity!!.layoutInflater
val layoutInflater = requireActivity().layoutInflater
this.parentView = onCreateView(layoutInflater, null)
val alertDialogBuilder: AlertDialog.Builder =
@ -230,7 +231,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
handleDragDialog()
mDetector = GestureDetectorCompat(
requireContext(),
requireContext(),
MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() })
)
@ -772,16 +773,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
val mCallBtnLayoutParam: 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 =
context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt()
requireContext().resources.getDimension(R.dimen.video_icon_size_small).toInt()
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 =
context!!.resources.getDimension(R.dimen.local_preview_width).toInt()
requireContext().resources.getDimension(R.dimen.local_preview_width).toInt()
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 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()
@ -792,9 +793,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams
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 =
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 =
mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams
@ -884,17 +885,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
controlPanel.layoutParams as ConstraintLayout.LayoutParams
val layoutNameHeight: Int =
context!!.resources.getDimension(R.dimen.layout_name_height).toInt()
requireContext().resources.getDimension(R.dimen.layout_name_height).toInt()
val layoutMiniHeight: Int =
context!!.resources.getDimension(R.dimen.layout_mini_height).toInt()
val panelHeight: Int = context!!.resources.getDimension(R.dimen.layout_panel_height).toInt()
requireContext().resources.getDimension(R.dimen.layout_mini_height).toInt()
val panelHeight: Int = requireContext().resources.getDimension(R.dimen.layout_panel_height).toInt()
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 =
context!!.resources.getDimension(R.dimen.padding_space_big).toInt()
requireContext().resources.getDimension(R.dimen.padding_space_big).toInt()
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
@ -1152,10 +1153,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
return true
}
override fun onDoubleTap(e: MotionEvent): Boolean {
miniCircleDoubleTap()
return super.onDoubleTap(e)
}
// override fun onDoubleTap(e: MotionEvent?): Boolean {
// miniCircleDoubleTap()
// return super.onDoubleTap(e)
// }
}

@ -1,14 +1,14 @@
buildscript {
ext.kotlin_version = '1.8.21'
ext.kotlin_version = '1.7.20'
repositories {
google()
jcenter()
}
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 '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')
}
tasks.register("clean", Delete) {
task clean(type: Delete) {
delete rootProject.buildDir
}

@ -1,5 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
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
platform :ios, '11.0'
platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -38,10 +38,24 @@ target 'Runner' do
# Plugin Pods
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end
post_install do |installer|
installer.pods_project.targets.each do |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

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
@ -14,8 +14,8 @@
30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; };
30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; };
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 */; };
7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4E9718EA62661304F55A32D /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@ -37,13 +37,10 @@
/* End PBXCopyFilesBuildPhase 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>"; };
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>"; };
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>"; };
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>"; };
@ -61,7 +58,10 @@
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>"; };
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 */
/* Begin PBXFrameworksBuildPhase section */
@ -69,7 +69,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */,
7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -104,9 +104,9 @@
7D66D387293CE5376A07EC5F /* Pods */ = {
isa = PBXGroup;
children = (
2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */,
E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */,
0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */,
C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */,
C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */,
E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -129,7 +129,7 @@
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
7D66D387293CE5376A07EC5F /* Pods */,
C1938275850F66EAA5D7AC0F /* Frameworks */,
A9562A4C43D78E443FA8BFD1 /* Frameworks */,
);
sourceTree = "<group>";
};
@ -171,10 +171,10 @@
name = "Supporting Files";
sourceTree = "<group>";
};
C1938275850F66EAA5D7AC0F /* Frameworks */ = {
A9562A4C43D78E443FA8BFD1 /* Frameworks */ = {
isa = PBXGroup;
children = (
104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */,
E4E9718EA62661304F55A32D /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -186,14 +186,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */,
4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */,
C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -210,11 +210,12 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 3A359E86ZF;
LastSwiftMigration = 1100;
};
};
@ -255,12 +256,10 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
@ -269,7 +268,43 @@
shellPath = /bin/sh;
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;
buildActionMask = 2147483647;
files = (
@ -306,11 +341,14 @@
"${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework",
"${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework",
"${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.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";
outputPaths = (
@ -344,54 +382,20 @@
"${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}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.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}/sqflite.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;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
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 */
/* Begin PBXSourcesBuildPhase section */
@ -484,12 +488,12 @@
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
baseConfigurationReference = E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -497,10 +501,7 @@
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@ -516,6 +517,7 @@
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@ -622,12 +624,12 @@
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
baseConfigurationReference = C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -635,10 +637,7 @@
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@ -655,13 +654,13 @@
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
baseConfigurationReference = C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -669,10 +668,7 @@
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@ -697,7 +693,7 @@
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
@ -707,7 +703,7 @@
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};

@ -67,7 +67,5 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</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: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/service/NavigationService.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/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
import '../locator.dart';
import '../routes.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Utils helpers = new Utils();
class BaseAppClient {
//TODO change the post fun to nun static when you change all service
post(String endPoint,
{required Map<String, dynamic> body,
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isLiveCare = false,
bool isFallLanguage = false}) async {
@ -34,28 +38,34 @@ class BaseAppClient {
bool callLog = true;
try {
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
String? token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile.doctorID;
body['DoctorID'] = doctorProfile?.doctorID;
}
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) {
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 {
String? doctorID = await sharedPref.getString(DOCTOR_ID);
String doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') {
body['DoctorID'] = null;
} 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'] == '') {
body.remove("EditedBy");
}
@ -64,7 +74,7 @@ class BaseAppClient {
}
if (!isFallLanguage) {
String? lang = await sharedPref.getString(APP_Language);
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
@ -88,10 +98,7 @@ class BaseAppClient {
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
int? projectID = await sharedPref.getInt(PROJECT_ID);
// if (projectID != null) {
// projectID = 2;
// }
int projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true;
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3)
@ -99,9 +106,23 @@ class BaseAppClient {
else
body['PatientOutSA'] = false;
// if (!body.containsKey('ProjectID')) {
// if (projectID != null) {
// body['ProjectID'] = projectID;
// } else {
// body['ProjectID'] = 0;
// }
// }
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 asd2;
if (await Utils.checkConnection()) {
@ -111,6 +132,7 @@ class BaseAppClient {
onFailure(Utils.generateContactAdminMsg(), statusCode);
} else {
var parsed = json.decode(response.body.toString());
print("Response : $parsed");
if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']);
}
@ -145,11 +167,12 @@ class BaseAppClient {
}
}
postPatient(String endPoint,
{required Map<String, dynamic> body,
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
PatiantInformtion? patient,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
@required PatiantInformtion patient,
bool isExternal = false}) async {
String url = BASE_URL + endPoint;
@ -157,20 +180,23 @@ class BaseAppClient {
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
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) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
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');
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
: await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID);
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
@ -197,7 +223,7 @@ class BaseAppClient {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: patient!.patientType != null
: patient.patientType != null
? patient.patientType
: PATIENT_TYPE
: PATIENT_TYPE;
@ -205,13 +231,13 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: patient!.patientType != null
: patient.patientType != null
? patient.patientType
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
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['SessionID'] = SESSION_ID; //getSe
@ -222,8 +248,21 @@ class BaseAppClient {
else
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("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
@ -308,4 +347,19 @@ class BaseAppClient {
}
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_DATE = "[0-9/]";
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://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_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL =
"Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL =
"Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_REFER_TO_DOCTOR_URL =
"Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL =
"Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital =
"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 PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";
const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "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 GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
const GET_REFERRAL_FACILITIES =
'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA =
'Services/DoctorApplication.svc/REST/GetVitalSigns';
const GET_PATIENT_LAB_OREDERS =
'Services/DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA = '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_LIVECARE_PENDINGLIST =
'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient';
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL =
"Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport';
const GT_MY_PATIENT_QUESTION =
'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions';
const PRM_SEARCH_PATIENT =
'Services/Patients.svc/REST/GetPatientInformation_PRM';
const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM';
const GET_PATIENT = 'Services/DoctorApplication.svc/REST/';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT =
'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient';
const GET_MY_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient';
const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor';
const ADD_REFERRED_DOCTOR_REMARKS =
'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks';
const GET_MY_REFERRED_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_OUT_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/PendingReferrals';
const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral';
const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/RespondReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF';
const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const GET_PATIENT_LAB_RESULTS =
'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults';
const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI =
'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails';
// 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
// const SELECT_DEVICE_IMEI =
// 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SELECT_DEVICE_IMEI =
'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN =
'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode';
const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp';
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
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 END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD =
'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC =
'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI';
const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics';
const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList';
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_COVERING_DOCTORS =
'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition';
const UPDATE_RESCHDEULE =
'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE =
'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 UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE = '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 GET_PATIENT_IN_PATIENT_LIST =
'Services/DoctorApplication.svc/REST/GetMyInPatient';
const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient';
const Verify_Referral_Doctor_Remarks =
'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'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';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = '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
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode';
const POST_EPISODE_FOR_IN_PATIENT =
'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE =
'/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint';
const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment';
const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies';
const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory';
const PATCH_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE =
'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote';
const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment';
const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory';
const GET_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint';
const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam';
const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_LIST_CATEGORISE =
'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure';
const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure';
const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION =
'Services/DoctorApplication.svc/REST/PatchPrescription';
const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription';
const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG =
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_ROOM_CATEGORIES =
'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES =
'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
const POST_ADMISSION_REQUEST =
'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const GET_ITEM_BY_MEDICINE =
'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode';
const GET_PROCEDURE_VALIDATION =
'Services/DoctorApplication.svc/REST/ValidateProcedures';
const GET_BOX_QUANTITY =
'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures';
const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
///GET ECG
const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUT_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT =
"Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_IN_PATIENT_ORDERS =
'Services/DoctorApplication.svc/REST/GetPatientRadResult';
const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
///Prescriptions
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT_NEW =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
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_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
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_MY_OUT_PATIENT =
"Services/DoctorApplication.svc/REST/GetMyOutPatient";
const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
const PATIENT_MEDICAL_REPORT_GET_LIST =
"Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE =
"Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_INSERT =
"Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED =
"Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID";
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 =
'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet';
const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet';
const GET_PROCEDURE_TEMPLETE_DETAILS =
"Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP =
'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet";
const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp';
const DOCTOR_CHECK_HAS_LIVE_CARE =
"Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
const ADD_REFERRED_REMARKS_NEW =
"Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST =
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST =
"Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const INSERT_MEDICAL_REPORT =
"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_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New";
const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList";
const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList";
const INSERT_MEDICAL_REPORT = "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 REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
const CREATE_DOCTOR_RESPONSE =
"Services/DoctorApplication.svc/REST/CreateDoctorResponse";
const GET_DOCTOR_NOT_REPLIED_COUNTS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const ALL_SPECIAL_LAB_RESULT =
"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";
const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse";
const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const ALL_SPECIAL_LAB_RESULT = "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
const GET_RESERVATIONS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const GET_OPERATION_DETAILS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT =
"Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const NURSING_PROGRESS_NOTE =
"Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";
const GET_DIAGNOSIS_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";
const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient";
const GET_DIABETIC_CHART_VALUES =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_PENDING_ORDERS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_ADMISSION_ORDERS =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
///Patient Registration Services
const CHECK_PATIENT_FOR_REGISTRATION =
"Services/Authentication.svc/REST/CheckPatientForRegisteration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION =
"Services/Authentication.svc/REST/PatientRegistration";
const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
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";
/// Discharge Summary
const GET_PENDING_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary";
const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary";
const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo";
const VTE_ASSESSMENT =
"Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo";
const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications";
const GET_INTERVENTION_MEDICATION =
"Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications";
const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory";
const GET_INTERVENTION_MEDICATION_HISTORY =
"Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory";
const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention";
const SET_ACCEPTED_OR_REJECTED =
"Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention";
const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const GET_STP_MASTER_LIST =
"Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
const DOCTOR_ER_SIGN_ASSESSMENT =
"Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser";
var selectedPatientType = 1;
@ -411,26 +301,8 @@ var SERVICES_PATIANT2 = [
"List_MyReferralPatient",
"patientArrivalList"
];
var SERVICES_PATIANT_HEADER = [
"My OutPatient",
"My InPatient",
"Discharge",
"Referred",
"Referral Discharge",
"Tomorrow",
"Referral",
"Arrival Patient"
];
var SERVICES_PATIANT_HEADER_AR = [
"المريض الخارجي",
"المريض المنوم",
"المريض المعافى",
"المريض المحول الي",
"المريض المحال المعافى",
"مريض الغد",
"المريض المحول مني",
"المريض الواصل"
];
var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"];
var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"];
const PRIMARY_COLOR = 0xff515B5D;
@ -438,7 +310,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 8.3;
const VERSION_ID = 8.7;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;
@ -450,7 +322,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958';
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
/// Timer Info
const TIMER_MIN = 10;
@ -459,7 +330,6 @@ class AppGlobal {
static Color appRedColor = Color(0xFFD02127);
static Color appGreenColor = Color(0xFF359846);
static Color appTextColor = Color(0xFF2B353E);
static Color scheduleTextColor = Color(0xFF2E303A);
static Color inProgressColor = Color(0xFFCC9B14);
static Color scheduleTextColor = Color(0xFF2E303A);
static Color inProgressColor = Color(0xFFCC9B14);
}

@ -800,7 +800,7 @@ const Map<String, Map<String, String>> localizedValues = {
"open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"},
"fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "},
"searchPatient-name": {
"en": "Search Name, Medical File, Phone Number",
"en": "Search Medical File, Phone Number",
"ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"
},
"reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"},
@ -1146,4 +1146,9 @@ const Map<String, Map<String, String>> localizedValues = {
"yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"},
"youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "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 LAST_LOGIN_USER = 'last-login-user';
const CLINIC_NAME = 'clinic-name';
const DOCTOR_SETUP_ID = 'doctor-setup-id';

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

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

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

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

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

@ -1,12 +1,25 @@
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param:
*@return:
*@desc: Clinic Model
*/
class ClinicModel {
String? setupID;
int? projectID;
int? doctorID;
int? clinicID;
bool? isActive;
String? clinicName;
String setupID;
int projectID;
int doctorID;
int clinicID;
bool isActive;
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) {
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 {
int? languageID;
String? stamp;
String? iPAdress;
double? versionID;
int? channel;
String? tokenID;
String? sessionID;
bool? isLoginForDoctorApp;
String? memberID;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
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) {
languageID = json['LanguageID'];
@ -21,6 +33,7 @@ class GetHospitalsRequestModel {
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
memberID = json['MemberID'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
@ -34,6 +47,7 @@ class GetHospitalsRequestModel {
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['MemberID'] = this.memberID;
data['DoctorID'] = this.doctorID;
return data;
}
}

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

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

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

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

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

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

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

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

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

@ -3,14 +3,13 @@ import 'package:firebase_analytics/observer.dart';
import 'package:flutter/cupertino.dart';
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() =>
FirebaseAnalyticsObserver(analytics: _analytics);
Future logEvent(
{required String eventCategory, required String eventAction}) async {
await _analytics.logEvent(name: 'event', parameters: {
Future logEvent({@required String eventCategory, @required String eventAction}) async {
await analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory,
"eventAction": eventAction,
});

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

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

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

@ -2,11 +2,13 @@ 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/model/dashboard/dashboard_model.dart';
import '../../model/dashboard/doctor_schedule.dart';
class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = [];
List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
bool hasVirtualClinic = false;
String? sServiceID;

@ -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/request_schedule.dart';
import '../../../config/shared_pref_kay.dart';
import '../../model/dashboard/doctor_schedule.dart';
class ScheduleService extends BaseService {
List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable =>
_listDoctorWorkingHoursTable;
List<ListDoctorWorkingHoursTable> _listDoctorWorkingHoursTable = [];
RequestSchedule _requestSchedule = RequestSchedule();
List<DoctorSchedule> _doctorRota= [];
List<DoctorSchedule> get doctorRotation => _doctorRota;
Future getDoctorSchedule() async {
await baseAppClient.post(GET_DOCTOR_WORKING_HOURS_TABLE,
onSuccess: (dynamic response, int statusCode) {
@ -23,4 +27,23 @@ class ScheduleService extends BaseService {
super.error = error;
}, 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/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_response_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class HospitalsService extends BaseService {
List<GetHospitalsResponseModel> hospitals = [];
List<GetHospitalsResponseModel> hospitals = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
hasError = false;
@ -15,6 +17,12 @@ class HospitalsService extends BaseService {
response['ProjectInfo'].forEach((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) {
hasError = true;

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

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

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

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

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

@ -100,6 +100,7 @@ class SickLeaveService extends BaseService {
onSuccess: (dynamic response, int statusCode) {
// Future.value(response);
getAllSickLeavePatient = [];
getAllSickLeavePatient.clear();
response['List_SickLeave'].forEach((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';
class PendingOrderService extends BaseService {
List<PendingOrderModel> _pendingOrderList = [];
List<PendingOrderModel> _pendingOrderList = List();
List<PendingOrderModel> get pendingOrderList => _pendingOrderList;
List<AdmissionOrdersModel> _admissionOrderList = [];
List<AdmissionOrdersModel> _admissionOrderList = List();
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel(patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, patientType: 1, setupID: "010266");
Future getPendingOrders(
{PendingOrderRequestModel pendingOrderRequestModel,
int patientId,
int admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
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");
_pendingOrderList.clear();
response['List_PendingOrders'].forEach(
@ -32,11 +41,20 @@ class PendingOrderService extends BaseService {
}, body: pendingOrderRequestModel.toJson());
}
Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, patientType: 1, setupID: "010266");
Future getAdmissionOrders(
{AdmissionOrdersRequestModel admissionOrdersRequestModel,
int patientId,
int admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
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");
//admissionOrderList.clear();
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/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/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel {
bool hasError = false;
ERSignInService _ERSignInService = locator<ERSignInService>();
Future signInERPatient({int? patientId, int? signInType}) async {
Future signInERPatient({int patientId, int signInType}) async {
hasError = false;
await getDoctorProfile();
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(
setupID: "010266",
signInType: signInType,
loginDoctorID: doctorProfile!.doctorID,
patientID: patientId,
);
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId);
setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) {
error = _ERSignInService.error!;
error = _ERSignInService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);

@ -79,7 +79,7 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID!;
int get episodeID => _SOAPService.episodeID;
bool isAddProgress = true;
bool isAddExamInProgress = true;
@ -98,52 +98,52 @@ class SOAPViewModel extends BaseViewModel {
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
SubjectiveCallBack? subjectiveCallBack;
SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack;
}
nextOnSubjectPage(model) {
subjectiveCallBack!.nextFunction(model);
subjectiveCallBack.nextFunction(model);
}
ObjectiveCallBack? objectiveCallBack;
ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack;
}
nextOnObjectivePage(model) {
objectiveCallBack!.nextFunction(model);
objectiveCallBack.nextFunction(model);
}
AssessmentCallBack? assessmentCallBack;
AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack;
}
nextOnAssessmentPage(model) {
assessmentCallBack!.nextFunction(model);
assessmentCallBack.nextFunction(model);
}
PlanCallBack? planCallBack;
PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack;
}
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) {
setState(ViewState.Busy);
} else
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys);
await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
@ -251,7 +251,7 @@ class SOAPViewModel extends BaseViewModel {
String allergiesString = '';
patientAllergiesList.forEach((element) {
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;
}
@ -268,8 +268,8 @@ class SOAPViewModel extends BaseViewModel {
patientInfo.appointmentNo.toString(),
),
);
if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!);
if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty)
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo);
else
getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy);
@ -303,7 +303,7 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async {
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);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -315,7 +315,7 @@ class SOAPViewModel extends BaseViewModel {
}
// ignore: missing_return
MasterKeyModel getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) {
MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) {
switch (masterKeys) {
case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) {
@ -406,35 +406,12 @@ class SOAPViewModel extends BaseViewModel {
return result.first;
}
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;
}
return MasterKeyModel();
}
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) {
return mySelectedExamination.indexOf(examList.first);
@ -444,7 +421,7 @@ class SOAPViewModel extends BaseViewModel {
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null,
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo,
@ -564,15 +541,15 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error! + _prescriptionService.error!;
error = _SOAPService.error + _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
callAddAssessmentLookupsServices({bool allowSetState = true}) async {
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
if (allowSetState) setState(ViewState.Busy);
dynamic services;
var services;
if (listOfDiagnosisCondition.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
@ -589,9 +566,9 @@ class SOAPViewModel extends BaseViewModel {
}
if (listOfICD10.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)];
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
} 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 {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN!,
episodeID: patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: int.parse(
patientInfo.appointmentNo.toString(),
),
);
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)];
@ -631,22 +601,11 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
postSubjectServices({
patientInfo,
String? complaintsText,
String? medicationText,
String? illnessText,
List<MySelectedHistory>? myHistoryList,
List<MySelectedAllergy>? myAllergiesList,
}) async {
postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List<MySelectedHistory> myHistoryList, List<MySelectedAllergy> myAllergiesList}) async {
var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel = createPostChiefComplaintRequestModel(
patientInfo: patientInfo,
illnessText: illnessText!,
medicationText: medicationText!,
complaintsText: complaintsText!,
);
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
@ -655,7 +614,7 @@ class SOAPViewModel extends BaseViewModel {
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
}
if (myHistoryList!.length != 0) {
if (myHistoryList.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
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);
if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel));
@ -683,12 +642,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({
patientInfo,
String? complaintsText,
String? medicationText,
String? illnessText,
}) {
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
@ -703,17 +657,17 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0);
}
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory>? myHistoryList}) {
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
myHistoryList!.forEach((history) {
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
remarks: "",
historyId: history.selectedHistory!.id,
historyType: history.selectedHistory!.typeId,
historyId: history.selectedHistory.id,
historyType: history.selectedHistory.typeId,
isChecked: history.isChecked,
));
});
@ -725,7 +679,7 @@ class SOAPViewModel extends BaseViewModel {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM(
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
@ -733,9 +687,9 @@ class SOAPViewModel extends BaseViewModel {
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile!.doctorID,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile!.doctorID!,
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
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/profile_req_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_response_model.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:firebase_messaging/firebase_messaging.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_ios/local_auth_ios.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@ -49,13 +53,14 @@ class AuthenticationViewModel extends BaseViewModel {
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes;
NewLoginInformationModel? loggedUser;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
GetIMEIDetailsModel? user;
NewLoginInformationModel loggedUser;
GetIMEIDetailsModel user;
UserModel userInfo = UserModel();
final LocalAuthentication auth = LocalAuthentication();
List<BiometricType>? _availableBiometrics;
List<BiometricType> _availableBiometrics;
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
bool isLogin = false;
@ -63,6 +68,7 @@ class AuthenticationViewModel extends BaseViewModel {
bool isFromLogin = false;
APP_STATUS appStatus = APP_STATUS.LOADING;
String localToken = "";
bool isHuawei = false;
AuthenticationViewModel({bool checkDeviceInfo = false}) {
getDeviceInfoFromFirebase();
@ -76,11 +82,13 @@ class AuthenticationViewModel extends BaseViewModel {
if (data != null) {
user = GetIMEIDetailsModel.fromJson(data);
}
var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE);
profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
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.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
@ -88,12 +96,12 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA;
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
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);
if (_authService.hasError) {
@ -111,11 +119,11 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setInt(PROJECT_ID, userInfo.projectID!);
sharedPref.setInt(PROJECT_ID, userInfo.projectID);
loggedUser = loginInfo;
await saveObjToString(LOGGED_IN_USER, loginInfo);
await sharedPref.remove(LAST_LOGIN_USER);
await sharedPref.setString(TOKEN, loginInfo.logInTokenID!);
saveObjToString(LOGGED_IN_USER, loginInfo);
sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, loginInfo.logInTokenID);
setState(ViewState.Idle);
}
}
@ -124,17 +132,17 @@ class AuthenticationViewModel extends BaseViewModel {
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user!.iMEI,
facilityId: user!.projectID,
memberID: user!.doctorID,
loginDoctorID: int.parse(user!.editedBy.toString()),
zipCode: user!.outSA == true ? '971' : '966',
mobileNumber: user!.mobile,
iMEI: user.iMEI,
facilityId: user.projectID,
memberID: user.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1,
vidaAuthTokenID: user!.vidaAuthTokenID,
vidaRefreshTokenID: user!.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString());
vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) {
@ -145,42 +153,42 @@ class AuthenticationViewModel extends BaseViewModel {
}
/// send activation code for silent login
Future sendActivationCodeForDoctorApp({AuthMethodTypes? authMethodType, String? password}) async {
Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async {
setState(ViewState.BusyLocal);
int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID,
memberID: loggedUser!.listMemberInformation![0].memberID,
loginDoctorID: loggedUser!.listMemberInformation![0].employeeID,
otpSendType: authMethodType!.getTypeIdService().toString(),
memberID: loggedUser.listMemberInformation[0].memberID,
loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
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);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!);
await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID);
setState(ViewState.Idle);
}
}
/// 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);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode,
mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID,
zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID,
logInTokenID: await sharedPref.getString(TOKEN),
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,
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),
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,
@ -200,6 +208,7 @@ class AuthenticationViewModel extends BaseViewModel {
Future getHospitalsList(memberID) async {
GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel();
getHospitalsRequestModel.memberID = memberID;
getHospitalsRequestModel.doctorID = memberID;
await _hospitalsService.getHospitals(getHospitalsRequestModel);
if (_hospitalsService.hasError) {
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 {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!);
await sharedPref.setString(
DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : "");
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 {
@ -243,16 +254,10 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric
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 {
await auth.authenticate(
localizedReason: 'Scan your fingerprint to authenticate',
authMessages: [iosStrings],
options: AuthenticationOptions(
useErrorDialogs: true,
stickyAuth: true,
),
);
await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e.toString());
}
@ -280,12 +285,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]);
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
} else {
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);
}
}
@ -295,8 +300,8 @@ class AuthenticationViewModel extends BaseViewModel {
bool isAvailable = false;
await _getAvailableBiometrics();
if (_availableBiometrics != null) {
for (var i = 0; i < _availableBiometrics!.length; i++) {
if (biometricType == _availableBiometrics![i]) isAvailable = true;
for (var i = 0; i < _availableBiometrics.length; i++) {
if (biometricType == _availableBiometrics[i]) isAvailable = true;
}
}
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
getDeviceInfoFromFirebase() async {
// await checkIsHuawei();
var token;
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestPermission();
}
setState(ViewState.Busy);
var token = await _firebaseMessaging.getToken();
try {
token = await _firebaseMessaging.getToken();
} catch (ex) {
print(ex);
}
if (localToken == "") {
localToken = token!;
localToken = token;
await _authService.selectDeviceImei(localToken);
if (_authService.hasError) {
@ -330,8 +350,8 @@ class AuthenticationViewModel extends BaseViewModel {
if (_authService.dashboardItemsList.length > 0) {
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_AUTH_TOKEN_ID, user!.vidaAuthTokenID!);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID);
this.unverified = true;
}
setState(ViewState.Idle);
@ -385,7 +405,7 @@ class AuthenticationViewModel extends BaseViewModel {
}
deleteUser() {
user = GetIMEIDetailsModel();
user = null;
unverified = false;
isLogin = false;
}

@ -1,4 +1,5 @@
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/doctor_reply_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 {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
DashboardService _dashboardService = locator<DashboardService>();
SpecialClinicsService _specialClinicsService = locator<SpecialClinicsService>();
SpecialClinicsService _specialClinicsService =
locator<SpecialClinicsService>();
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList;
List<DashboardModel> get dashboardItemsList =>
_dashboardService.dashboardItemsList;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
String? get sServiceID => _dashboardService.sServiceID;
String get sServiceID => _dashboardService.sServiceID;
int get notRepliedCount => _doctorReplyService.notRepliedCount;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
_specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider,
AuthenticationViewModel authProvider) async {
setState(ViewState.Busy);
await getDoctorProfile(isGetProfile: true);
@ -49,13 +53,14 @@ class DashboardViewModel extends BaseViewModel {
}
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 {
if (token != null && token != '') {
_firebaseMessaging.getToken().then((String token) async {
if (token != '') {
// DEVICE_TOKEN = token;
///TODO Elham* return it back
authProvider.insertDeviceImei(token);
authProvider.insertDeviceImei(token);
}
});
}
@ -80,13 +85,14 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle);
}
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
Future changeClinic(
int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
ClinicModel clinicModel = ClinicModel(
doctorID: doctorProfile!.doctorID,
doctorID: doctorProfile.doctorID,
clinicID: clinicId,
projectID: doctorProfile!.projectID,
projectID: doctorProfile.projectID,
);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) {
@ -96,15 +102,13 @@ class DashboardViewModel extends BaseViewModel {
getPatientCount(DashboardModel inPatientCount) {
int value = 0;
inPatientCount.summaryoptions!.forEach((result) {
value += result.value!;
});
inPatientCount.summaryoptions.forEach((result) => {value += result.value});
return value.toString();
}
GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) {
GetSpecialClinicalCareListResponseModel special = GetSpecialClinicalCareListResponseModel();
GetSpecialClinicalCareListResponseModel special;
specialClinicalCareList.forEach((element) {
if (element.clinicID == clinicId) {
special = element;
@ -126,4 +130,6 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
}

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

@ -18,9 +18,9 @@ import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
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;
@ -28,13 +28,13 @@ class UcafViewModel extends BaseViewModel {
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 weightKg = "0";
String bodyMax = "0";
@ -60,8 +60,8 @@ class UcafViewModel extends BaseViewModel {
Future getUCAFData(PatiantInformtion patient) async {
// setState(ViewState.Busy);
String? from;
String? to;
String from;
String to;
if (from == null || from == "0") {
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
@ -96,7 +96,7 @@ class UcafViewModel extends BaseViewModel {
if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') {
respirationBeatPerMinute = element.respirationBeatPerMinute.toString();
}
if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') {
if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') {
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) {
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) {
@ -166,7 +166,7 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) {
return result.first;
}
return MasterKeyModel();
return null;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
@ -174,9 +174,9 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) {
return result.first;
}
return MasterKeyModel();
return null;
default:
return MasterKeyModel();
return null;
}
}

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

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

@ -38,7 +38,7 @@ class OperationReportViewModel extends BaseViewModel {
GetOperationDetailsRequestModel(
reservationNo: reservation.oTReservationID,
patientID: reservation.patientID,
setupID: "010266");
);
await _operationReportService.getOperationReportDetails(
getOperationReportRequestModel: getOperationReportRequestModel);
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/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/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart';
@ -34,6 +35,10 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic;
late StreamSubscription subscription;
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
ProjectViewModel() {
loadSharedPrefLanguage();
@ -53,6 +58,11 @@ class ProjectViewModel with ChangeNotifier {
});
}
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'en');
@ -100,6 +110,13 @@ class ProjectViewModel with ChangeNotifier {
response['List_DoctorsClinic'].forEach((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;
}, onFailure: (String error, int statusCode) {
throw error;

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

@ -1,4 +1,5 @@
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/model/doctor/list_doctor_working_hours_table_model.dart';
@ -11,6 +12,8 @@ class ScheduleViewModel extends BaseViewModel {
List<ListDoctorWorkingHoursTable> get listDoctorWorkingHoursTable =>
_scheduleService.listDoctorWorkingHoursTable;
List<DoctorSchedule> get getDoctorRotation =>
_scheduleService.doctorRotation;
Future getDoctorSchedule() async {
setState(ViewState.Busy);
await _scheduleService.getDoctorSchedule();
@ -20,4 +23,15 @@ class ScheduleViewModel extends BaseViewModel {
} else
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/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_medical_file/sick_leave/sickleave_service.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>();
PatientService _patientService = locator<PatientService>();
SickLeaveStatisticsModel get sickLeaveStatistics =>
_sickLeaveService.sickLeavestatisitics;
SickLeaveStatisticsModel get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
@ -30,10 +30,7 @@ class SickLeaveViewModel extends BaseViewModel {
get postSechedule => _sickLeaveService.postReschedule;
get getAllSIckLeavePatient => [
..._sickLeaveService.getAllSickLeavePatient,
..._sickLeaveService.getAllSickLeaveDoctor
];
get getAllSIckLeavePatient => removeDuplicates([..._sickLeaveService.getAllSickLeaveDoctor, ..._sickLeaveService.getAllSickLeavePatient]);
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.BusyLocal);
@ -88,17 +85,13 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getSickLeaveForPatient(PatiantInformtion patient,
{bool isLocalBusy = false}) async {
Future getSickLeaveForPatient(PatiantInformtion patient, {bool isLocalBusy = false}) async {
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
var patientMRN = patient.patientMRN ?? patient.patientId;
var services = [
_sickLeaveService.getSickLeavePatient(patientMRN),
_sickLeaveService.getSickLeaveDoctor(patientMRN)
];
var services = [_sickLeaveService.getSickLeavePatient(patientMRN), _sickLeaveService.getSickLeaveDoctor(patientMRN)];
final results = await Future.wait(services);
if (_sickLeaveService.hasError) {
@ -183,4 +176,13 @@ class SickLeaveViewModel extends BaseViewModel {
} else
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:doctor_app_flutter/config/size_config.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/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/scan_qr_view_model.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/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/translations_delegate_base_utils.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/buttons/app_buttons_widget.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../routes.dart';
import '../base/base_view.dart';
Utils helpers = Utils();
@ -27,7 +31,7 @@ class ErSignInScreen extends StatefulWidget {
}
class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel? projectViewModel;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -41,7 +45,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
),
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7),
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
@ -107,12 +111,13 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
}
}
signInERPatient({BuildContext? context, ERSignInViewModel? model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context!);
await model!.signInERPatient(patientId: patientId, signInType: signInType);
signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.signInERPatient(patientId: patientId, signInType: signInType);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
/// TODO Elham* Create this in Utils
DrAppToastMsg.showSuccesToast("Add successfully");
}
GifLoaderDialogUtils.hideDialog(context);
@ -121,12 +126,12 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
/// TODO Elham* Make this as custom Dialog
showMyDialog({
BuildContext? context,
Function? firstAction,
Function? secondAction,
BuildContext context,
Function firstAction,
Function secondAction,
}) {
showDialog(
context: context!,
context: context,
builder: (ctx) => Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
@ -167,7 +172,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel!.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ',
projectViewModel.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ',
fontSize: 15,
textAlign: TextAlign.center,
),
@ -184,23 +189,23 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
children: [
ElevatedButton(
child: AppText(
"Sing In",
"Sign In",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () async {
await firstAction!();
await firstAction();
}),
ElevatedButton(
child: AppText(
"Sing Out",
"Sign Out",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Confirm", ),
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/model/hospitals/get_hospitals_response_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/translations_delegate_base_utils.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/text_fields/app-textfield-custom.dart';
@ -20,7 +21,7 @@ class LoginScreen extends StatefulWidget {
}
class _LoginScreenState extends State<LoginScreen> {
String? platformImei;
String platformImei;
bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom
@ -31,11 +32,13 @@ class _LoginScreenState extends State<LoginScreen> {
List<GetHospitalsResponseModel> projectsList = [];
FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold(
isShowAppBar: false,
backgroundColor: HexColor('#F8F8F8'),
@ -48,6 +51,7 @@ class _LoginScreenState extends State<LoginScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
//TODO Use App Text rather than text
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -70,11 +74,11 @@ class _LoginScreenState extends State<LoginScreen> {
),
Text(
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(
"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,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth! * 0.90,
height: SizeConfig.realScreenHeight! * 0.65,
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(),
AppTextFieldCustom(
@ -97,12 +101,11 @@ class _LoginScreenState extends State<LoginScreen> {
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null) authenticationViewModel.userInfo.userID = value.trim();
print(authenticationViewModel.userInfo.userID);
//setState(() {});
if (value != null)
setState(() {
authenticationViewModel.userInfo.userID = value.trim();
});
},
onClick: () {},
onFieldSubmitted: () {},
),
buildSizedBox(),
AppTextFieldCustom(
@ -111,12 +114,18 @@ class _LoginScreenState extends State<LoginScreen> {
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null) authenticationViewModel.userInfo.password = value.trim();
getProjects(authenticationViewModel.userInfo.userID);
setState(() {});
if (value != null)
setState(() {
authenticationViewModel.userInfo.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(authenticationViewModel.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: () {},
onFieldSubmitted: () {},
),
buildSizedBox(),
AppTextFieldCustom(
@ -126,10 +135,8 @@ class _LoginScreenState extends State<LoginScreen> {
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
if (projectsList.isNotEmpty) Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
},
onFieldSubmitted: () {},
onChanged: (value) {},
),
buildSizedBox()
]),
@ -143,7 +150,7 @@ class _LoginScreenState extends State<LoginScreen> {
]),
),
bottomSheet: Container(
height: 100,
height: 90,
width: double.infinity,
child: Center(
child: FractionallySizedBox(
@ -180,8 +187,8 @@ class _LoginScreenState extends State<LoginScreen> {
login(
context,
) async {
if (loginFormKey.currentState!.validate()) {
loginFormKey.currentState!.save();
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.login(authenticationViewModel.userInfo);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
@ -206,10 +213,10 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) {
setState(() {
authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName!;
projectIdController.text = projectsList[index].facilityName;
});
primaryFocus!.unfocus();
primaryFocus.unfocus();
}
String memberID = "";
@ -222,8 +229,9 @@ class _LoginScreenState extends State<LoginScreen> {
if (authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals;
setState(() {
projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList);
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 '../../widgets/auth/verification_methods_list.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Utils helpers = Utils();
///TODO Elham* check if this still in user or not
@ -39,13 +39,12 @@ class VerificationMethodsScreen extends StatefulWidget {
}
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
late ProjectViewModel projectsProvider;
ProjectViewModel projectsProvider;
bool isMoreOption = false;
bool onlySMSBox = false;
AuthMethodTypes fingerPrintBefore = AuthMethodTypes.Fingerprint;
late AuthMethodTypes selectedOption;
late AuthenticationViewModel authenticationViewModel;
AuthMethodTypes fingerPrintBefore;
AuthMethodTypes selectedOption;
AuthenticationViewModel authenticationViewModel;
@override
Widget build(BuildContext context) {
@ -64,7 +63,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 6 : 4),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4),
),
if (authenticationViewModel.isFromLogin)
InkWell(
@ -79,7 +78,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Column(
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
),
authenticationViewModel.user != null && isMoreOption == false
? Column(
@ -94,14 +93,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.72,
),
AppText(
Utils.convertToTitleCase(authenticationViewModel.user!.doctorName!),
Utils.convertToTitleCase(authenticationViewModel.user.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
),
SizedBox(
height: SizeConfig.heightMultiplier! * 4,
height: SizeConfig.heightMultiplier * 4,
),
AppText(
TranslationBase.of(context).accountInfo,
@ -110,7 +109,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
SizedBox(height: SizeConfig.heightMultiplier! * 4),
SizedBox(height: SizeConfig.heightMultiplier * 4),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
@ -125,7 +124,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth! * .5,
width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -153,7 +152,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.4),
children: <TextSpan>[
TextSpan(
text: authenticationViewModel.getType(authenticationViewModel.user!.logInTypeID, context),
text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context),
style: TextStyle(
color: AppGlobal.appTextColor,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -172,10 +171,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
authenticationViewModel.user!.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!), isMonthShort: true)
: authenticationViewModel.user!.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!), isMonthShort: true)
authenticationViewModel.user.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true)
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true)
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
@ -184,10 +183,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.48,
),
AppText(
authenticationViewModel.user!.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!))
: authenticationViewModel.user!.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!))
authenticationViewModel.user.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn))
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -202,7 +201,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
),
SizedBox(
height: SizeConfig.heightMultiplier! * 3,
height: SizeConfig.heightMultiplier * 3,
),
Row(
children: [
@ -217,7 +216,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
],
),
SizedBox(
height: SizeConfig.heightMultiplier! * 2,
height: SizeConfig.heightMultiplier * 2,
),
],
)
@ -245,12 +244,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Expanded(
child: InkWell(
onTap: () => {
print("Fingerprint"),
// TODO check this logic it seem it will create bug to us
authenticateUser(AuthMethodTypes.Fingerprint, true)
},
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!),
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
),
@ -350,6 +350,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error);
@ -374,7 +375,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context);
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(
context,
type,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user!.mobile,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile,
(value) {
showDialog(
context: context,
@ -442,8 +443,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return;
if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.FaceID)) {
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes);
} else {
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);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
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 LiveCarePatientViewModel model;
VideoCallPage({required this.patientData, this.listContext, required this.model});
VideoCallPage({this.patientData, this.listContext, this.model});
@override
_VideoCallPageState createState() => _VideoCallPageState();
@ -28,10 +28,10 @@ class VideoCallPage extends StatefulWidget {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class _VideoCallPageState extends State<VideoCallPage> {
Timer? _timmerInstance;
Timer _timmerInstance;
int _start = 0;
String _timmer = '';
LiveCareViewModel _liveCareProvider = LiveCareViewModel();
LiveCareViewModel _liveCareProvider;
bool _isInit = true;
var _tokenData;
bool isTransfer = false;
@ -68,13 +68,9 @@ class _VideoCallPageState extends State<VideoCallPage> {
kSessionId: tokenData.openSessionID,
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962',
vcId: widget.patientData.vcId!,
isRecording: tokenData != null ? tokenData.isRecording! : false,
patientName: widget.patientData.fullName == null
? widget.patientData.firstName != null
? "${widget.patientData.firstName} ${widget.patientData.lastName}"
: "-"
: "",
vcId: widget.patientData.vcId,
isRecording: tokenData != null ? tokenData.isRecording : false,
patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
tokenID: token,
//"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958",
@ -140,7 +136,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: MediaQuery.of(context).size.height * 0.02,
),
Text(
widget.patientData.fullName!,
widget.patientData.fullName,
style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20),
),
SizedBox(
@ -202,7 +198,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
width: MediaQuery.of(context).size.width * .9,
child: Stack(
fit: StackFit.loose,
clipBehavior: Clip.none,
// overflow: Overflow.visible,
children: <Widget>[
Positioned(
right: -40.0,
@ -226,43 +223,30 @@ class _VideoCallPageState extends State<VideoCallPage> {
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => {endCall()},
child: Text(TranslationBase.of(context).endcall),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Colors.red,
),
textStyle: MaterialStateProperty.all(
TextStyle(color: Colors.white),
),
),
)),
onPressed: () => {endCall()},
child: Text(TranslationBase.of(context).endcall),
style: ElevatedButton.styleFrom(backgroundColor: Colors.red, textStyle: TextStyle(color: Colors.white))
//color: Colors.red,
//textColor: Colors.white,
)),
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => {resumeCall()},
child: Text(TranslationBase.of(context).resumecall),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
AppGlobal.appGreenColor,
),
textStyle: MaterialStateProperty.all(
TextStyle(color: Colors.white),
onPressed: () => {resumeCall()},
child: Text(TranslationBase.of(context).resumecall),
style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appGreenColor, textStyle: TextStyle(color: Colors.white))
// color: AppGlobal.appGreenColor,
// textColor: Colors.white,
),
),
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => {endCallWithCharge()},
child: Text(TranslationBase.of(context).endcallwithcharge),
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
TextStyle(color: Colors.white),
),
),
),
onPressed: () => {endCallWithCharge()},
child: Text(TranslationBase.of(context).endcallwithcharge),
style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.white))),
),
Padding(
padding: EdgeInsets.all(8.0),
@ -271,11 +255,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
setState(() => {isTransfer = true})
},
child: Text(TranslationBase.of(context).transfertoadmin),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Colors.yellow[900],
),
),
style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])),
// color: Colors.yellow[900],
),
),
isTransfer == true
@ -294,11 +275,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
child: ElevatedButton(
onPressed: () => {this.transferToAdmin(notes)},
child: Text('Transfer'),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Colors.yellow[900],
),
),
style: ElevatedButton.styleFrom(textStyle: TextStyle(color: 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/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/utils/date-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';
class MedicalFileDetails extends StatefulWidget {
String? age;
String? firstName;
String? lastName;
String? gender;
int? encounterNumber;
int? pp;
PatiantInformtion? patient;
String? clinicName;
String? episode;
String? doctorName;
String? vistDate;
String? doctorImage;
String age;
String firstName;
String lastName;
String gender;
int encounterNumber;
int pp;
PatiantInformtion patient;
String clinicName;
String episode;
String doctorName;
String vistDate;
String doctorImage;
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});
@override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState(
firstName: firstName!,
age: age!,
lastName: lastName!,
gender: gender!,
encounterNumber: encounterNumber!,
pp: pp!,
patient: patient!,
clinicName: clinicName!,
doctorName: doctorName!,
episode: episode!,
vistDate: vistDate!,
doctorImage: doctorImage!,
firstName: firstName,
age: age,
lastName: lastName,
gender: gender,
encounterNumber: encounterNumber,
pp: pp,
patient: patient,
clinicName: clinicName,
doctorName: doctorName,
episode: episode,
vistDate: vistDate,
doctorImage: doctorImage,
);
}
class _MedicalFileDetailsState extends State<MedicalFileDetails> {
int? encounterNumber;
String? age;
String? firstName;
String? lastName;
String? gender;
int? pp;
PatiantInformtion? patient;
String? clinicName;
String? episode;
String? doctorName;
String? vistDate;
String? doctorImage;
int encounterNumber;
String age;
String firstName;
String lastName;
String gender;
int pp;
PatiantInformtion patient;
String clinicName;
String episode;
String doctorName;
String vistDate;
String doctorImage;
_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});
@ -77,20 +77,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
return BaseView<MedicalFileViewModel>(
onModelReady: (model) async {
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(
patient!,
doctorName: doctorName!,
profileUrl: doctorImage!,
clinic: clinicName!,
patient,
doctorName: doctorName,
profileUrl: doctorImage,
clinic: clinicName,
isPrescriptions: true,
isMedicalFile: true,
episode: episode!,
episode: episode,
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate!,
vistDate,
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true,
),
@ -103,14 +103,14 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container(
child: Column(
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: EdgeInsets.all(10.0),
child: Container(
child: Column(
children: [
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(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -120,7 +120,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all(
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(
padding: const EdgeInsets.all(15.0),
@ -147,7 +147,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
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) {
return Padding(
padding: EdgeInsets.all(8.0),
@ -159,7 +159,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Expanded(
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(),
),
),
@ -182,7 +182,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
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(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -192,7 +192,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all(
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(
padding: const EdgeInsets.all(15.0),
@ -219,7 +219,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
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) {
return Padding(
padding: EdgeInsets.all(8.0),
@ -234,8 +234,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontSize: 13.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10!
.trim(),
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
),
@ -250,8 +249,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.condition!
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition
.trim(),
fontSize: 13.0,
fontWeight: FontWeight.w700,
@ -263,8 +261,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.description!,
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description,
fontWeight: FontWeight.w700,
fontSize: 15.0,
),
@ -279,7 +276,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
Expanded(
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,
fontWeight: FontWeight.w700,
),
@ -290,8 +287,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks!
.trim(),
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(),
),
Divider(
height: 1,
@ -314,7 +310,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
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(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -324,7 +320,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all(
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(
padding: const EdgeInsets.all(15.0),
@ -351,7 +347,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
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) {
return Padding(
padding: EdgeInsets.all(8.0),
@ -367,8 +363,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'Procedure ID: ',
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.procedureId!
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId
.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
@ -383,8 +378,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
),
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.orderDate!
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate
.trim(),
)),
fontSize: 13.5,
@ -401,7 +395,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Expanded(
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,
),
)
@ -413,7 +407,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'CPT Code : ',
),
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(),
fontWeight: FontWeight.w700,
),
@ -443,7 +437,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
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(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
@ -453,7 +447,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
borderRadius: BorderRadius.all(
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(
padding: const EdgeInsets.all(15.0),
@ -480,7 +474,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
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) {
return Padding(
padding: EdgeInsets.all(8.0),
@ -491,7 +485,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(TranslationBase.of(context).examType + ": "),
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,
),
],
@ -499,7 +493,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row(
children: [
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,
)
],
@ -508,7 +502,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
AppText(TranslationBase.of(context).abnormal + ": "),
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,
),
],
@ -517,7 +511,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0,
),
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(
height: 1,

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

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

@ -29,7 +29,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
builder: (_, model, w) => AppScaffold(
//appBarTitle: 'Discharged Patient',
//subtitle: "Last Three Months",
backgroundColor: Colors.grey[200]!,
backgroundColor: Colors.grey[200],
isShowAppBar: false,
baseViewModel: model,
body: model.myDischargedPatient.isEmpty
@ -59,9 +59,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
color: Colors.black,
),
iconSize: 20,
onPressed: () {},
),
onFieldSubmitted: () {},
),
SizedBox(
height: 5,
@ -117,11 +115,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
children: [
AppText(
model.filterData[index].nationalityName != null
? model.filterData[index].nationalityName!.trim()
? model.filterData[index].nationalityName.trim()
: model.filterData[index].nationality != null
? model.filterData[index].nationality!.trim()
? model.filterData[index].nationality.trim()
: model.filterData[index].nationalityId != null
? model.filterData[index].nationalityId!
? model.filterData[index].nationalityId
: "",
fontWeight: FontWeight.bold,
fontSize: 14,
@ -131,10 +129,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '',
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '',
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
return AppText(
'',
fontSize: 10,
@ -174,7 +172,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
Container(
child: RichText(
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>[
new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')),
new TextSpan(
@ -188,7 +186,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier!,
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
@ -209,7 +207,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier!,
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
@ -232,7 +230,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
fontWeight: FontWeight.w300,
),
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,
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/screens/base/base_view.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/widgets/patients/profile/app_bar/patient-profile-app-bar.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 {
@override
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'];
String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type'];
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMuseViewModel>(
onModelReady: (model) => model.getECGPatient(
patientType: patient.patientType,
patientOutSA: 0,
patientID: patient.patientId),
onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
@ -59,19 +57,24 @@ class ECGPage extends StatelessWidget {
model.patientMuseResultsModelList.length,
(index) => InkWell(
onTap: () async {
await launch(model
.patientMuseResultsModelList[index].imageURL!);
Uri ecgImageURL = Uri.parse(model.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(
width: double.infinity,
height: 120,
margin: EdgeInsets.only(top: 5, bottom: 5),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
border:
Border.all(color: Colors.white, width: 2),
color: Colors.white,
borderRadius: BorderRadius.circular(8)),
decoration: BoxDecoration(border: Border.all(color: Colors.white, width: 2), color: Colors.white, borderRadius: BorderRadius.circular(8)),
child: Column(
children: [
Row(
@ -79,8 +82,7 @@ class ECGPage extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'ECG Report',
@ -90,26 +92,12 @@ class ECGPage extends StatelessWidget {
SizedBox(height: 3),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier!,
color: Colors.black),
style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: TranslationBase.of(
context)
.orderNo,
style: TextStyle(
fontSize: 12,
fontFamily: 'Poppins')),
new TextSpan(
text:
'${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}',
style: TextStyle(
fontWeight:
FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 14)),
text: '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}',
style: TextStyle(fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)),
],
),
)
@ -118,19 +106,18 @@ class ECGPage extends StatelessWidget {
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight: FontWeight.w600,
fontSize: 14,
),
AppText(
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}',
'${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',
fontWeight: FontWeight.w600,
color: Colors.grey[700]!,
color: Colors.grey[700],
fontSize: 14,
),
],

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

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

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

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

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

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

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

@ -32,21 +32,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class ProgressNoteScreen extends StatefulWidget {
final int visitType;
const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key);
const ProgressNoteScreen({Key key, this.visitType}) : super(key: key);
@override
_ProgressNoteState createState() => _ProgressNoteState();
}
class _ProgressNoteState extends State<ProgressNoteScreen> {
List<NoteModel>? notesList;
List<NoteModel> notesList;
var filteredNotesList;
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
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'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
@ -55,7 +55,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo!),
admissionNo: int.parse(patient.admissionNo),
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
@ -69,7 +69,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Widget build(BuildContext context) {
authenticationViewModel = 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'];
String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
@ -118,7 +118,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
widthFactor: 0.95,
child: CardWithBgWidget(
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)
: model.patientProgressNoteList[index].status == 4
? Colors.red.shade700
@ -130,7 +130,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
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(
TranslationBase.of(context).notePending,
fontWeight: FontWeight.bold,
@ -153,7 +153,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
),
if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy)
authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -209,7 +209,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo!),
admissionNo: int.parse(patient.admissionNo),
cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
conditionId: model.patientProgressNoteList[index].condition,
@ -264,7 +264,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context,
);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo!),
admissionNo: int.parse(patient.admissionNo),
conditionId: model.patientProgressNoteList[index].condition,
cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
@ -364,7 +364,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [
AppText(
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)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
@ -373,7 +373,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
),
AppText(
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()),
fontWeight: FontWeight.w600,
fontSize: 14,
@ -390,7 +390,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded(
child: AppText(
model.patientProgressNoteList[index].notes!,
model.patientProgressNoteList[index].notes,
fontSize: 10,
isCopyable: true,
),
@ -416,7 +416,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}
/// 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(
context: context,
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/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/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/translations_delegate_base_utils.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/loader/gif_loader_dialog_utils.dart';
@ -26,20 +27,28 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
import '../../../../base/base_view.dart';
class UpdateNoteOrder extends StatefulWidget {
final NoteModel? note;
final PatientViewModel? patientModel;
final PatiantInformtion? patient;
final int? visitType;
final NoteModel note;
final PatientViewModel patientModel;
final PatiantInformtion patient;
final int visitType;
final bool isUpdate;
final List<dynamic>? elementList;
final Function(dynamic)? okFunction;
final List<dynamic> elementList;
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
_UpdateNoteOrderState createState() => _UpdateNoteOrderState();
@ -47,12 +56,12 @@ class UpdateNoteOrder extends StatefulWidget {
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
dynamic selectValue;
int selectedType = 0;
int selectedType;
bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord;
var event = RobotProvider();
late ProjectViewModel projectViewModel;
ProjectViewModel projectViewModel;
TextEditingController progressNoteController = TextEditingController();
@ -82,10 +91,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
projectViewModel = Provider.of(context);
if (widget.note != null) {
progressNoteController.text = widget.note!.notes!;
if (selectValue == null) selectValue = {};
selectValue[keyId] = widget.note!.condition;
selectValue['Description'] = widget.note!.conditionDescription!;
progressNoteController.text = widget.note.notes;
if(selectValue==null)
selectValue={};
selectValue[keyId] = widget.note.condition;
selectValue['Description'] = widget.note.conditionDescription;
}
return BaseView<PatientViewModel>(
@ -105,8 +116,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [
BottomSheetTitle(
title: widget.visitType == 3
? (widget.isUpdate ? 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,
? (widget.isUpdate
? 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(
height: 10.0,
@ -120,7 +137,11 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
ListSelectDialog dialog = ListSelectDialog(
list: model.stpMasterList,
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,
okFunction: (selectedValue) => {
setState(() {
@ -139,8 +160,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}
: null,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).selectCondition,
//'Select Condition',
hintText: TranslationBase.of(context).selectCondition,//'Select Condition',
dropDownText: model.stpMasterList.length == 1
? model.stpMasterList[0]['Description']
: selectValue == null
@ -148,9 +168,6 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
: selectValue['Description'],
enabled: false,
isTextFieldHasSuffix: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
),
),
),
@ -166,8 +183,19 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [
AppTextFieldCustom(
hintText: widget.visitType == 3
? (widget.isUpdate! ? 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,
? (widget.isUpdate
? 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,
controller: progressNoteController,
maxLines: 40,
@ -175,21 +203,26 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: progressNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
),
Positioned(
top: -2,
//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(
children: [
IconButton(
icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
icon: Icon(DoctorApp.speechtotext,
color: Colors.black, size: 35),
onPressed: () {
initSpeechState().then((value) => {onVoiceText()});
initSpeechState()
.then((value) => {onVoiceText()});
},
),
],
@ -207,7 +240,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
),
bottomSheet: Container(
height: progressNoteController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
if (progressNoteController.text.isNotEmpty)
@ -226,8 +259,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
margin: EdgeInsets.all(5),
child: AppButton(
title: widget.visitType == 3
? (widget.isUpdate ? 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,
? (widget.isUpdate
? 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,
// disabled: progressNoteController.text.isEmpty,
fontWeight: FontWeight.w700,
@ -237,51 +276,61 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
});
if (progressNoteController.text.trim().isNotEmpty) {
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) {
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(widget.patient!.admissionNo!),
admissionNo:
int.parse(widget.patient.admissionNo),
cancelledNote: false,
lineItemNo: widget.note!.lineItemNo!,
createdBy: widget.note!.createdBy!,
lineItemNo: widget.note.lineItemNo,
createdBy: widget.note.createdBy,
notes: progressNoteController.text,
verifiedNote: false,
patientTypeID: widget.patient!.patientType,
patientTypeID: widget.patient.patientType,
patientOutSA: false,
conditionId: selectValue['ParameterCode']);
await widget.patientModel!.updatePatientProgressNote(reqModel);
await widget.patientModel
.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo: int.parse(widget.patient!.admissionNo!),
admissionNo:
int.parse(widget.patient.admissionNo),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient!.patientId,
patientID: widget.patient.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient!.patientType,
patientTypeID: widget.patient.patientType,
patientOutSA: false,
notes: progressNoteController.text,
conditionId: selectValue['ParameterCode']);
await widget.patientModel!.createPatientProgressNote(reqModel);
await widget.patientModel
.createPatientProgressNote(reqModel);
}
if (widget.patientModel!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel!.error);
if (widget.patientModel.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(widget.patientModel.error);
} else {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient!.admissionNo!),
projectID: widget.patient!.projectId,
patientTypeID: widget.patient!.patientType,
languageID: 2);
await widget.patientModel!.getPatientProgressNote(progressNoteRequest.toJson());
ProgressNoteRequest progressNoteRequest =
ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo:
int.parse(widget.patient.admissionNo),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).yourOrderAddedSuccessfully);
Navigator.of(context).pop();
} else {
Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces);
@ -297,7 +346,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
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) {
speech.listen(
onResult: resultListener,
@ -328,12 +378,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
void resultListener(result) {
recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) {
if (result.finalResult ==true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
progressNoteController.text += recognizedWord + '\n';
if (mounted) {
// speech.stop();
progressNoteController.text += recognizedWord + '\n';
SpeechToText.closeAlertDialog(context);
}
});
} else {
print(result.finalResult);
@ -341,7 +393,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}

@ -45,7 +45,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
admissionNo: int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
setupID: "010266");
);
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/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/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/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/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/translations_delegate_base_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/buttons/app_buttons_widget.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:speech_to_text/speech_to_text.dart' as stt;
import '../../../../config/config.dart';
class UpdateOperationReport extends StatefulWidget {
final GetReservationsResponseModel? reservation;
final PatiantInformtion? patient;
final int? visitType;
final bool? isUpdate;
final GetReservationsResponseModel reservation;
// final OperationReportViewModel operationReportViewModel;
final PatiantInformtion patient;
final int visitType;
final bool isUpdate;
const UpdateOperationReport(
{Key? key,
{Key key,
// this.operationReportViewModel,
this.patient,
this.visitType,
@ -41,12 +44,12 @@ class UpdateOperationReport extends StatefulWidget {
}
class _UpdateOperationReportState extends State<UpdateOperationReport> {
int? selectedType;
int selectedType;
bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord;
var event = RobotProvider();
late ProjectViewModel projectViewModel;
ProjectViewModel projectViewModel;
TextEditingController preOpDiagmosisController = TextEditingController();
TextEditingController postOpDiagmosisNoteController = TextEditingController();
@ -60,11 +63,13 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
TextEditingController complicationDetailsController = TextEditingController();
TextEditingController bloodLossDetailController = TextEditingController();
TextEditingController histopathSpecimenController = TextEditingController();
TextEditingController microbiologySpecimenController = TextEditingController();
TextEditingController microbiologySpecimenController =
TextEditingController();
TextEditingController otherSpecimenController = TextEditingController();
TextEditingController scrubNurseController = TextEditingController();
TextEditingController circulatingNurseController = TextEditingController();
TextEditingController BloodTransfusedDetailController = TextEditingController();
TextEditingController BloodTransfusedDetailController =
TextEditingController();
TextEditingController anasthetistController = TextEditingController();
TextEditingController OTReservationID = TextEditingController();
@ -86,30 +91,33 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
return BaseView<OperationReportViewModel>(
onModelReady: (model) async {
await model.getOperationReportDetails(widget.reservation!);
OTReservationID.text = widget.reservation!.oTReservationID.toString();
await model.getOperationReportDetails(widget.reservation);
OTReservationID.text = widget.reservation.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails = model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis!;
surgeonController.text = oldDetails.surgeon!;
assistantNoteController.text = oldDetails.assistant!;
operationController.text = oldDetails.operation!;
inasionController.text = oldDetails.inasion!;
findingController.text = oldDetails.finding!;
surgeryProcedureController.text = oldDetails.surgeryProcedure!;
postOpInstructionController.text = oldDetails.postOpInstruction!;
complicationDetailsController.text = oldDetails.complicationDetail!;
bloodLossDetailController.text = oldDetails.bloodLossDetail!;
histopathSpecimenController.text = oldDetails.histopathSpecimen!;
microbiologySpecimenController.text = oldDetails.microbiologySpecimen!;
otherSpecimenController.text = oldDetails.otherSpecimen!;
GetOperationDetailsResponseModel oldDetails =
model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis;
surgeonController.text = oldDetails.surgeon;
assistantNoteController.text = oldDetails.assistant;
operationController.text = oldDetails.operation;
inasionController.text = oldDetails.inasion;
findingController.text = oldDetails.finding;
surgeryProcedureController.text = oldDetails.surgeryProcedure;
postOpInstructionController.text = oldDetails.postOpInstruction;
complicationDetailsController.text = oldDetails.complicationDetail;
bloodLossDetailController.text = oldDetails.bloodLossDetail;
histopathSpecimenController.text = oldDetails.histopathSpecimen;
microbiologySpecimenController.text =
oldDetails.microbiologySpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen;
scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text = oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist!;
BloodTransfusedDetailController.text =
oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist;
}
},
builder: (_, model, w) => AppScaffold(
@ -138,92 +146,107 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
child: Column(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).reservation,
hintText: TranslationBase.of(context)
.reservation,
controller: OTReservationID,
maxLines: 1,
minLines: 1,
enabled: false,
hasBorder: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).preOperationDiagnosis,
hintText: TranslationBase.of(context)
.preOperationDiagnosis,
controller: preOpDiagmosisController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: preOpDiagmosisController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).postOperationDiagnosis,
hintText: TranslationBase.of(context)
.postOperationDiagnosis,
controller: postOpDiagmosisNoteController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
postOpDiagmosisNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).surgeon,
hintText:
TranslationBase.of(context).surgeon,
controller: surgeonController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
surgeonController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).assistant,
hintText:
TranslationBase.of(context).assistant,
controller: assistantNoteController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: assistantNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).operation,
hintText:
TranslationBase.of(context).operation,
controller: operationController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
operationController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
@ -237,201 +260,248 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
inasionController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).finding,
hintText:
TranslationBase.of(context).finding,
controller: findingController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
findingController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).surgeryProcedure,
hintText: TranslationBase.of(context)
.surgeryProcedure,
controller: surgeryProcedureController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
surgeryProcedureController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).postOperationInstruction,
hintText: TranslationBase.of(context)
.postOperationInstruction,
controller: postOpInstructionController,
maxLines: 20,
minLines: 8,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
postOpInstructionController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).complicationDetails1,
hintText: TranslationBase.of(context)
.complicationDetails1,
controller: complicationDetailsController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
complicationDetailsController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).bloodLossDetail,
hintText: TranslationBase.of(context)
.bloodLossDetail,
controller: bloodLossDetailController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: bloodLossDetailController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).histopathSpecimen,
hintText: TranslationBase.of(context)
.histopathSpecimen,
controller: histopathSpecimenController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
histopathSpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).microbiologySpecimen,
controller: microbiologySpecimenController,
hintText: TranslationBase.of(context)
.microbiologySpecimen,
controller:
microbiologySpecimenController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
microbiologySpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).otherSpecimen,
hintText: TranslationBase.of(context)
.otherSpecimen,
controller: otherSpecimenController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: otherSpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).scrubNurse,
hintText: TranslationBase.of(context)
.scrubNurse,
controller: scrubNurseController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
scrubNurseController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).circulatingNurse,
hintText: TranslationBase.of(context)
.circulatingNurse,
controller: circulatingNurseController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
circulatingNurseController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).bloodTransfusedDetail,
controller: BloodTransfusedDetailController,
hintText: TranslationBase.of(context)
.bloodTransfusedDetail,
controller:
BloodTransfusedDetailController,
maxLines: 20,
minLines: 4,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
BloodTransfusedDetailController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 4,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).anesthetist,
hintText: TranslationBase.of(context)
.anesthetist,
controller: anasthetistController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
validationError:
anasthetistController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
height: 250,
@ -453,13 +523,17 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
)
: Container(
height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(5),
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,
// disabled: operationReportsController.text.isEmpty,
fontWeight: FontWeight.w700,
@ -471,33 +545,55 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
GifLoaderDialogUtils.showMyDialog(context);
await model.getDoctorProfile();
CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel(
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo: widget.reservation!.oTReservationID,
preOpDiagmosis: preOpDiagmosisController.text,
postOpDiagmosis: postOpDiagmosisNoteController.text,
surgeon: surgeonController.text,
assistant: assistantNoteController.text,
anasthetist: assistantNoteController.text,
operation: operationController.text,
finding: findingController.text,
surgeryProcedure: surgeonController.text,
postOpInstruction: postOpInstructionController.text,
complicationDetails: complicationDetailsController.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!,
setupID: "010266");
await model.updateOperationReport(createUpdateOperationReportRequestModel);
CreateUpdateOperationReportRequestModel
createUpdateOperationReportRequestModel =
CreateUpdateOperationReportRequestModel(
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo: widget
.reservation.oTReservationID,
preOpDiagmosis:
preOpDiagmosisController.text,
postOpDiagmosis:
postOpDiagmosisNoteController
.text,
surgeon: surgeonController.text,
assistant:
assistantNoteController.text,
anasthetist:
assistantNoteController.text,
operation: operationController.text,
finding: findingController.text,
surgeryProcedure:
surgeonController.text,
postOpInstruction:
postOpInstructionController.text,
complicationDetails:
complicationDetailsController
.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) {
Utils.showErrorToast(model.error);
@ -505,7 +601,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// await model.(
// operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast("Your Order added Successfully");
DrAppToastMsg.showSuccesToast(
"Your Order added Successfully");
}
GifLoaderDialogUtils.hideDialog(context);
}

@ -1,24 +1,24 @@
import 'dart:async';
import 'package:doctor_app_flutter/config/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/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/VideoCallService.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/model/SOAP/post_episode_req_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/core/viewModel/project_view_model.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/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_search.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/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/shared/app_scaffold_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_svg/svg.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:quiver/async.dart';
import '../../../../locator.dart';
import '../../../../routes.dart';
class PatientProfileScreen extends StatefulWidget {
@override
_PatientProfileScreenState createState() => _PatientProfileScreenState();
}
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
PatiantInformtion patient = PatiantInformtion();
PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false;
bool isFromLiveCare = false;
bool isSigned = false;
bool isInpatient = false;
bool isMyPatient = false;
bool isCallFinished = false;
bool isDischargedPatient = false;
bool isSearchAndOut = false;
bool isCallStarted = false;
String? patientType;
String? arrivalType;
String? from;
String? to;
TabController? _tabController;
String patientType;
String arrivalType;
String from;
String to;
TabController _tabController;
int index = 0;
int _activeTab = 0;
late StreamController<String> videoCallDurationStreamController;
late Stream<String> videoCallDurationStream;
StreamController<String> videoCallDurationStreamController;
Stream<String> videoCallDurationStream = (() async* {})();
@override
void initState() {
@ -67,22 +73,23 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
@override
void dispose() {
_tabController!.dispose();
_tabController.dispose();
super.dispose();
if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId!);
_liveCareViewModel.removePatientFromDoctorList(patient.vcId);
}
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
isSigned = routeArgs['isSigned'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
@ -110,7 +117,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
_activeTab = 1;
}
late StreamSubscription callTimer;
StreamSubscription callTimer;
callConnected() {
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
@ -125,7 +132,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
callDisconnected() {
callTimer.cancel();
videoCallDurationStreamController.sink.add("");
videoCallDurationStreamController.sink.add(null);
setState(() {
isCallStarted = false;
@ -135,9 +142,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
return BaseView<LiveCarePatientViewModel>(
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(
baseViewModel: model,
@ -150,7 +158,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!,
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType,
videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
@ -172,31 +180,32 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
child: isSearchAndOut
? ProfileGridForSearch(
patient: patient,
patientType: patientType!,
arrivalType: arrivalType!,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
from: from!,
to: to!,
from: from,
to: to,
)
: isInpatient
? ProfileGridForInPatient(
patient: patient,
patientType: patientType!,
arrivalType: arrivalType!,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
from: from!,
to: to!,
from: from,
to: to,
isDischargedPatient: isDischargedPatient,
isFromSearch: isFromSearch,
)
: ProfileGridForOther(
patient: patient,
patientType: patientType!,
arrivalType: arrivalType!,
patientType: patientType,
arrivalType: arrivalType,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
from: from!,
to: to!,
from: from,
to: to,
projectViewModel: projectViewModel,
),
),
SizedBox(
@ -238,7 +247,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor,
fontColor: Colors.white,
// vPadding: 8,
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 25,
fontWeight: FontWeight.normal,
@ -257,7 +266,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (patient.episodeNo != 0)
AppButton(
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}",
color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
? AppGlobal.appRedColor
@ -266,7 +275,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor,
fontColor: Colors.white,
// vPadding: 8,
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 25,
fontWeight: FontWeight.normal,
@ -314,7 +323,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
child: Center(
child: AppButton(
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,
disabled: isCallStarted || model.state == ViewState.BusyLocal,
onPressed: () async {
@ -340,7 +349,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
);
} else {
GifLoaderDialogUtils.showMyDialog(context);
await model.startCall(isReCall: false, vCID: patient.vcId!);
await model.startCall(isReCall: false, vCID: patient.vcId);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
@ -358,7 +367,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
context: context,
onTapGrant: () {
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(
eventCategory: "Patient Profile",
eventAction: "Create Episode",
);
GifLoaderDialogUtils.showMyDialog(context);
if (patient!.admissionNo != null && patient.admissionNo!.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId);
await model!.postEpisodeForInPatient(postEpisodeReqModel);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel);
} else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
await model!.postEpisode(postEpisodeReqModel);
await model.postEpisode(postEpisodeReqModel);
}
GifLoaderDialogUtils.hideDialog(context);

@ -1,144 +1,67 @@
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/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:flutter/material.dart';
import '../../../../routes.dart';
// ignore: must_be_immutable
class ProfileGridForOther extends StatelessWidget {
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final double? height;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final double height;
final bool isInpatient;
final bool isFromLiveCare;
String? from;
String? to;
String from;
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
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
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(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
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),
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient),
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),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.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: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
//onTap: () {},
isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null,
),
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(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
@ -155,11 +78,11 @@ class ProfileGridForOther extends StatelessWidget {
//change the number as you want
children: cardsList.map((item) {
return PatientProfileButton(
patient: patient!,
patientType: patientType!,
arrivalType: arrivalType!,
from: from!,
to: to!,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
from: from,
to: to,
nameLine1: item.nameLine1,
nameLine2: item.nameLine2,
route: item.route,
@ -167,8 +90,7 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable,
onTap: () {},
//item.onTap!(),
onTap: item.onTap,
isLoading: item.isLoading,
);
}).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/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/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/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/shared/app_scaffold_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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../../locator.dart';
class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology? finalRadiology;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final FinalRadiology finalRadiology;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
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
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
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(
appBar: PatientProfileAppBar(
patient!,
appointmentDate: finalRadiology!.orderDate!,
doctorName: finalRadiology!.doctorName,
clinic: finalRadiology!.clinicDescription,
branch: finalRadiology!.projectName,
profileUrl: finalRadiology!.doctorImageURL,
invoiceNO: finalRadiology!.invoiceNo.toString(),
patient,
appointmentDate: finalRadiology.orderDate,
doctorName: finalRadiology.doctorName,
clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName,
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
isAppointmentHeader: true,
),
isShowAppBar: true,
@ -68,7 +82,7 @@ class RadiologyDetailsPage extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
'${finalRadiology!.reportData.trim()}',
'${finalRadiology.reportData.trim()}',
textAlign: TextAlign.start,
isCopyable: true,
fontSize: 17,
@ -92,19 +106,18 @@ class RadiologyDetailsPage extends StatelessWidget {
margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton(
color: Color(0xffD02127),
disabled: finalRadiology!.dIAPACSURL == "",
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "RadiologyDetailsPage",
eventAction: "Open Radiology Image",
);
launchUrlString(model.radImageURL);
launch(model.radImageURL);
},
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/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/patients/profile/radiology/radiology_details_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/shared/app_scaffold_widget.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/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../widgets/shared/errors/error_message.dart';
class RadiologyHomePage extends StatefulWidget {
@override
_RadiologyHomePageState createState() => _RadiologyHomePageState();
}
class _RadiologyHomePageState extends State<RadiologyHomePage> {
String? patientType;
PatiantInformtion? patient;
String? arrivalType;
bool isInpatient = false;
bool isFromLiveCare = false;
String patientType;
PatiantInformtion patient;
String arrivalType;
bool isInpatient;
bool isFromLiveCare;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
@ -47,14 +48,13 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient!,
patientType: patientType, isInPatient: false),
onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100]!,
backgroundColor: Colors.grey[100],
// appBarTitle: TranslationBase.of(context).radiology,
appBar: PatientProfileAppBar(
patient!,
patient,
isInpatient: isInpatient,
),
baseViewModel: model,
@ -66,28 +66,24 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SizedBox(
height: 12,
),
if (model.radiologyList.isNotEmpty &&
patient!.patientStatusType != 43)
if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43)
ServiceTitle(
title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result,
),
if (patient!.patientStatusType != null &&
patient!.patientStatusType == 43)
if (patient.patientStatusType != null && patient.patientStatusType == 43)
ServiceTitle(
title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result,
),
if ((patient!.patientStatusType != null &&
patient!.patientStatusType == 43) ||
(isFromLiveCare && patient!.appointmentNo != null))
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
SlideUpPageRoute(
widget: BaseAddProcedureTabPage(
patient: patient!,
patient: patient,
previousProcedureViewModel: model,
procedureType: ProcedureType.RADIOLOGY,
),
@ -96,6 +92,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
},
label: TranslationBase.of(context).applyForRadiologyOrder,
),
///TODO Elham * fix this to be list view builder
...List.generate(
model.radiologyList.length,
@ -117,43 +114,26 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
height: 160,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: model.radiologyList[index]
.isLiveCareAppodynamicment!
? Colors.red[900]!
: !model.radiologyList[index].isInOutPatient!
color: model.radiologyList[index].isLiveCareAppodynamicment
? Colors.red[900]
: !model.radiologyList[index].isInOutPatient
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
bottomLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0)),
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic ? 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(
quarterTurns: 3,
child: Center(
child: Text(
model.radiologyList[index]
.isLiveCareAppodynamicment!
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !model.radiologyList[index]
.isInOutPatient!
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
model.radiologyList[index].isLiveCareAppodynamicment
? TranslationBase.of(context).liveCare.toUpperCase()
: !model.radiologyList[index].isInOutPatient
? TranslationBase.of(context).inPatientLabel.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
@ -161,28 +141,27 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Expanded(
child: DoctorCard(
isNoMargin: true,
doctorName:
Utils.convertToTitleCase(model.radiologyList[index].doctorName),
profileUrl:
model.radiologyList[index].doctorImageURL,
invoiceNO:
'${model.radiologyList[index].invoiceNo}',
branch:
'${model.radiologyList[index].projectName}',
clinic:
Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate:
model.radiologyList[index].orderDate ??
model.radiologyList[index].reportDate!,
doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName),
profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
? '${model.radiologyList[index].invoiceNo_VP}'
: '${model.radiologyList[index].invoiceNo}',
// model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate,
onTap: () {
Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology:
model.radiologyList[index],
finalRadiology: model.radiologyList[index],
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 &&
patient!.patientStatusType != 43)
if (model.radiologyList.isEmpty && patient.patientStatusType != 43)
Center(
child: ErrorMessage(
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/core/enum/PatientType.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/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/utils/date-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/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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import '../../../../../routes.dart';
class ReferredPatientDetailScreen extends StatelessWidget {
final MyReferredPatientModel referredPatient;
final PatientType patientType;
@ -52,9 +53,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
Expanded(
child: AppText(
(Utils.capitalize(
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier!! * 2.5,
(Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -70,19 +70,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
InkWell(
onTap: () {
PatiantInformtion patient =
model.getPatientFromReferral(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromReferral(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient":
patientType == PatientType.IN_PATIENT,
"isInpatient": patientType == PatientType.IN_PATIENT,
"arrivalType": "1",
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
@ -97,19 +92,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
children: [
InkWell(
onTap: () {
PatiantInformtion patient =
model.getPatientFromReferral(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
PatiantInformtion patient = model.getPatientFromReferral(referredPatient);
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient":
patientType == PatientType.IN_PATIENT,
"isInpatient": patientType == PatientType.IN_PATIENT,
"arrivalType": "1",
"from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'),
"from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Column(
@ -120,9 +110,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
width: 60,
height: 60,
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -133,8 +121,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
AppText(
TranslationBase.of(context).viewProfile,
fontWeight: FontWeight.w700,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.red[700]!,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Colors.red[700],
)
],
),
@ -146,46 +134,39 @@ class ReferredPatientDetailScreen extends StatelessWidget {
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
referredPatient.referralStatusDesc!,
referredPatient.referralStatusDesc,
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? AppGlobal.inProgressColor
: referredPatient.referralStatus == 46
? AppGlobal.appGreenColor
: Colors.red[700]!,
: Colors.red[700],
),
AppText(
AppDateUtils.convertDateFromServerFormat(
referredPatient.referralDate!,
"dd MMM,yyyy"),
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier!,
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.fileNumber,
TranslationBase.of(context).fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier!,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
@ -198,40 +179,34 @@ class ReferredPatientDetailScreen extends StatelessWidget {
],
),
AppText(
AppDateUtils.convertDateFromServerFormat(
referredPatient.referralDate!,
"hh:mm a"),
AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier!,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier!,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.referralClinicDescription!,
referredPatient.referralClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 13,
@ -240,29 +215,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
],
),
if (referredPatient
.frequencyDescription !=
null)
if (referredPatient.frequencyDescription != null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.frequency +
": ",
TranslationBase.of(context).frequency + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier!,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription!,
referredPatient.frequencyDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
@ -277,29 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Row(
children: [
AppText(
referredPatient.nationalityName !=
null
? referredPatient.nationalityName!
: "",
referredPatient.nationalityName != null ? referredPatient.nationalityName : "",
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontSize:
1.4 * SizeConfig.textMultiplier!,
fontSize: 1.4 * SizeConfig.textMultiplier,
),
referredPatient.nationalityFlagURL !=
null
referredPatient.nationalityFlagURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient
.nationalityFlagURL!,
referredPatient.nationalityFlagURL,
height: 25,
width: 30,
errorBuilder: (BuildContext
context,
Object exception,
StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
return Text('No Image');
},
))
@ -311,20 +268,17 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (referredPatient.priorityDescription != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).priority +
": ",
TranslationBase.of(context).priority + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier!,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
referredPatient.priorityDescription!,
referredPatient.priorityDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
@ -335,33 +289,21 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (referredPatient.mAXResponseTime != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
TranslationBase.of(context).maxResponseTime + ": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier!,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.mAXResponseTime !=
null
? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime!,
"dd MMM,yyyy")
: '',
referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier!,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
@ -371,8 +313,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 0),
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_left.png',
height: 50,
@ -380,34 +321,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(
left: 0,
top: 25,
right: 0,
bottom: 0),
padding: EdgeInsets.only(
left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL !=
null
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL != null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL!,
referredPatient.doctorImageURL,
height: 25,
width: 30,
errorBuilder:
(BuildContext context,
Object exception,
StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
return Text('No Image');
},
))
: Container(
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -415,30 +344,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10,
top: 30,
right: 10,
bottom: 0),
margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 *
SizeConfig.textMultiplier!,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Colors.black,
),
AppText(
referredPatient
.referralClinicDescription!,
referredPatient.referralClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
SizeConfig.textMultiplier!,
fontSize: 1.3 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
@ -478,14 +399,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier!,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks!,
referredPatient.referringDoctorRemarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier!,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
@ -495,27 +416,22 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(
left: 0, top: 0, right: 4, bottom: 0),
margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: referredPatient.doctorImageURL != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
referredPatient.doctorImageURL!,
referredPatient.doctorImageURL,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
return Text('No Image');
},
))
: Container(
child: Image.asset(
referredPatient.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
@ -528,22 +444,18 @@ class ReferredPatientDetailScreen extends StatelessWidget {
TranslationBase.of(context).reply,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier!,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referredDoctorRemarks ==
null
referredPatient.referredDoctorRemarks == null
? ''
: referredPatient.referredDoctorRemarks!
.isNotEmpty
? referredPatient
.referredDoctorRemarks!
: TranslationBase.of(context)
.notRepliedYet,
: referredPatient.referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks
: TranslationBase.of(context).notRepliedYet,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier!,
fontSize: 1.6 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
@ -561,14 +473,14 @@ class ReferredPatientDetailScreen extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton(
title: TranslationBase.of(context).acknowledged,
color: Colors.red[700]!,
color: Colors.red[700],
fontColor: Colors.white,
fontWeight: FontWeight.w700,
hPadding: 8,
vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null
? true
: referredPatient.referredDoctorRemarks!.isNotEmpty
: referredPatient.referredDoctorRemarks.isNotEmpty
? false
: true,
onPressed: () async {
@ -576,8 +488,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
"Referral is acknowledged");
DrAppToastMsg.showSuccesToast("Referral is acknowledged");
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/size_config.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/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/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/doctor/doctor_profile_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/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/translations_delegate_base_utils.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_texts_widget.dart';
@ -26,13 +27,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment? mySelectedAssessment;
final List<MySelectedAssessment>? mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)? addSelectedAssessment;
final PatiantInformtion? patientInfo;
final MySelectedAssessment mySelectedAssessment;
final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final PatiantInformtion patientInfo;
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
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
@ -45,23 +46,23 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController typeController = TextEditingController();
TextEditingController icdNameController = TextEditingController();
GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>> key = GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment!.remark ?? "";
appointmentIdController.text = widget.mySelectedAssessment!.appointmentId.toString();
remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
if (widget.isUpdate) {
if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!;
if (widget.mySelectedAssessment!.selectedDiagnosisType != null)
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.selectedDiagnosisCondition != null)
conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
if (widget.mySelectedAssessment.selectedDiagnosisType != null)
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn;
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(
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@ -91,7 +92,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
heightFactor: 1,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
model.callAddAssessmentLookupsServices();
// model.callAddAssessmentLookupsServices();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -114,76 +115,133 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: AppTextFieldCustom(
// height: 55.0,
height: Utils.getTextFieldHeight(),
hintText: TranslationBase.of(context).appointmentNumber,
isTextFieldHasSuffix: false,
enabled: false,
controller: appointmentIdController,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
),
),
SizedBox(
height: 10,
),
Container(
child: InkWell(
Column(
children:[ InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment!.selectedICD = null;
icdNameController.text = "";
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
});
}
: null,
child: widget.mySelectedAssessment!.selectedICD == null
? CustomAutoCompleteTextField(
isShowError: isFormSubmitted && widget.mySelectedAssessment!.selectedICD == null,
child: AutoCompleteTextField<MasterKeyModel>(
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, "", true, suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment!.selectedICD = item;
icdNameController.text = '${item.code.trim()}/${item.description}';
}),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), 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()),
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment!.selectedICD = null;
icdNameController.text = "";
});
}
: () {},
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
),
onPressed: () {},
),
onChanged: (value) {},
onFieldSubmitted: () {},
child: AppTextFieldCustom(
onChanged: (text){
setState(() {
icdNameController.text;
});
},
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
});
}
: null,
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: 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,
color: Colors.grey.shade600,
)),
),
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(
children: [
SizedBox(
@ -192,7 +250,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
widget.mySelectedAssessment!.selectedICD!.description + (' (${widget.mySelectedAssessment!.selectedICD!.code} )'),
widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'),
color: Color(0xFF575757),
fontSize: 10,
fontWeight: FontWeight.w700,
@ -211,13 +269,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment!.selectedDiagnosisCondition!,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment!.selectedDiagnosisCondition = selectedValue;
conditionController.text = projectViewModel.isArabic
? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr!
: widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!;
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
conditionController.text =
projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn;
});
},
);
@ -229,7 +286,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
},
);
}
: () {},
: null,
hintText: TranslationBase.of(context).condition,
maxLines: 1,
minLines: 1,
@ -237,9 +294,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true,
enabled: false,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null,
),
SizedBox(
height: 10,
@ -251,11 +306,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment!.selectedDiagnosisType!,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment!.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!;
widget.mySelectedAssessment.selectedDiagnosisType = selectedValue;
typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn;
});
},
);
@ -267,7 +322,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
},
);
}
: () {},
: null,
hintText: TranslationBase.of(context).dType,
maxLines: 1,
minLines: 1,
@ -275,9 +330,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true,
controller: typeController,
hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null,
),
SizedBox(
height: 10,
@ -291,14 +344,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
inputType: TextInputType.multiline,
controller: remarkController,
onChanged: (value) {
widget.mySelectedAssessment!.remark = remarkController.text;
widget.mySelectedAssessment.remark = remarkController.text;
},
onClick: () {},
onFieldSubmitted: () {},
),
),
SizedBox(
height: SizeConfig.heightMultiplier! *
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 20
: SizeConfig.isHeightShort
@ -321,12 +372,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
setState(() {
isFormSubmitted = true;
});
widget.mySelectedAssessment!.remark = remarkController.text;
widget.mySelectedAssessment!.appointmentId = int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment!.selectedDiagnosisType != null &&
widget.mySelectedAssessment!.selectedICD != null) {
await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment!);
widget.mySelectedAssessment.remark = remarkController.text;
widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text);
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null &&
widget.mySelectedAssessment.selectedICD != null) {
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);
if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel(
patientMRN: widget.patientInfo!.patientMRN,
episodeID: widget.patientInfo!.episodeNo,
appointmentNo: widget.patientInfo!.appointmentNo,
remarks: mySelectedAssessment!.remark,
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID);
await model!.patchAssessment(patchAssessmentReqModel);
await model.patchAssessment(patchAssessmentReqModel);
} else {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(patientMRN: widget.patientInfo!.patientMRN, episodeId: widget.patientInfo!.episodeNo, appointmentNo: widget.patientInfo!.appointmentNo, icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment!.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code)
]);
await model!.postAssessment(postAssessmentRequestModel);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
createdByName: doctorProfile.doctorName,
createdBy: doctorProfile.doctorID,
icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
]);
await model.postAssessment(postAssessmentRequestModel);
}
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code;
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName;
widget.addSelectedAssessment!(mySelectedAssessment, isUpdate);
widget.addSelectedAssessment(mySelectedAssessment, isUpdate);
Navigator.of(context).pop();
}
}

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

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

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