diff --git a/android/build.gradle b/android/build.gradle index bf0f679d..ae74fcf6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.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.3' } @@ -17,7 +17,8 @@ allprojects { google() jcenter() mavenCentral() - maven { url 'https://tokbox.bintray.com/maven' } + maven { url 'https://developer.huawei.com/repo/' } +// maven { url 'https://tokbox.bintray.com/maven' } } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..ed1a787b 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip diff --git a/assets/images/Doctor_app_logo.png b/assets/images/Doctor_app_logo.png deleted file mode 100644 index 2de2d460..00000000 Binary files a/assets/images/Doctor_app_logo.png and /dev/null differ diff --git a/assets/images/DrAppEmblemAnimation_v2.gif b/assets/images/DrAppEmblemAnimation_v2.gif deleted file mode 100644 index fd2248b5..00000000 Binary files a/assets/images/DrAppEmblemAnimation_v2.gif and /dev/null differ diff --git a/assets/images/arrow_dropdown_icon.png b/assets/images/arrow_dropdown_icon.png deleted file mode 100644 index 98a94f64..00000000 Binary files a/assets/images/arrow_dropdown_icon.png and /dev/null differ diff --git a/assets/images/booked.png b/assets/images/booked.png deleted file mode 100644 index e07b7d35..00000000 Binary files a/assets/images/booked.png and /dev/null differ diff --git a/assets/images/close_icon.png b/assets/images/close_icon.png deleted file mode 100644 index 84df5ff3..00000000 Binary files a/assets/images/close_icon.png and /dev/null differ diff --git a/assets/images/create-episod.png b/assets/images/create-episod.png deleted file mode 100644 index 02386fd1..00000000 Binary files a/assets/images/create-episod.png and /dev/null differ diff --git a/assets/images/dashboard/3.png b/assets/images/dashboard/3.png deleted file mode 100644 index 38585ec8..00000000 Binary files a/assets/images/dashboard/3.png and /dev/null differ diff --git a/assets/images/dashboard/5.png b/assets/images/dashboard/5.png deleted file mode 100644 index 2a64c27a..00000000 Binary files a/assets/images/dashboard/5.png and /dev/null differ diff --git a/assets/images/femaleIcon.svg b/assets/images/femaleIcon.svg deleted file mode 100644 index c08fc259..00000000 --- a/assets/images/femaleIcon.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/assets/images/filter-512.png b/assets/images/filter-512.png deleted file mode 100644 index ce2f89b8..00000000 Binary files a/assets/images/filter-512.png and /dev/null differ diff --git a/assets/images/heartbeat.png b/assets/images/heartbeat.png deleted file mode 100644 index 3a83ddee..00000000 Binary files a/assets/images/heartbeat.png and /dev/null differ diff --git a/assets/images/lab.png b/assets/images/lab.png deleted file mode 100644 index 3f2f72c9..00000000 Binary files a/assets/images/lab.png and /dev/null differ diff --git a/assets/images/leaves.svg b/assets/images/leaves.svg deleted file mode 100644 index 474585fd..00000000 --- a/assets/images/leaves.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/assets/images/livecare.png b/assets/images/livecare.png deleted file mode 100644 index b1fd3f06..00000000 Binary files a/assets/images/livecare.png and /dev/null differ diff --git a/assets/images/login/101.png b/assets/images/login/101.png deleted file mode 100644 index 90c1c575..00000000 Binary files a/assets/images/login/101.png and /dev/null differ diff --git a/assets/images/login/102.png b/assets/images/login/102.png deleted file mode 100644 index 8502d197..00000000 Binary files a/assets/images/login/102.png and /dev/null differ diff --git a/assets/images/login/103.png b/assets/images/login/103.png deleted file mode 100644 index 3326814b..00000000 Binary files a/assets/images/login/103.png and /dev/null differ diff --git a/assets/images/login/104.png b/assets/images/login/104.png deleted file mode 100644 index ad55ff74..00000000 Binary files a/assets/images/login/104.png and /dev/null differ diff --git a/assets/images/login/fileNum.png b/assets/images/login/fileNum.png deleted file mode 100644 index 386299b7..00000000 Binary files a/assets/images/login/fileNum.png and /dev/null differ diff --git a/assets/images/login/forget.png b/assets/images/login/forget.png deleted file mode 100644 index 57aa7ccc..00000000 Binary files a/assets/images/login/forget.png and /dev/null differ diff --git a/assets/images/login/id.png b/assets/images/login/id.png deleted file mode 100644 index 9260cf11..00000000 Binary files a/assets/images/login/id.png and /dev/null differ diff --git a/assets/images/login/nationalID.png b/assets/images/login/nationalID.png deleted file mode 100644 index 5779d562..00000000 Binary files a/assets/images/login/nationalID.png and /dev/null differ diff --git a/assets/images/login_btn_arrow_icon.png b/assets/images/login_btn_arrow_icon.png deleted file mode 100644 index 4fc877e2..00000000 Binary files a/assets/images/login_btn_arrow_icon.png and /dev/null differ diff --git a/assets/images/login_icon.png b/assets/images/login_icon.png deleted file mode 100644 index bc158303..00000000 Binary files a/assets/images/login_icon.png and /dev/null differ diff --git a/assets/images/menu.png b/assets/images/menu.png deleted file mode 100644 index e62a00e6..00000000 Binary files a/assets/images/menu.png and /dev/null differ diff --git a/assets/images/modilfy-episode.png b/assets/images/modilfy-episode.png deleted file mode 100644 index 6fdd224f..00000000 Binary files a/assets/images/modilfy-episode.png and /dev/null differ diff --git a/assets/images/no-data.png b/assets/images/no-data.png deleted file mode 100644 index 4fd47e0f..00000000 Binary files a/assets/images/no-data.png and /dev/null differ diff --git a/assets/images/note.png b/assets/images/note.png deleted file mode 100644 index 86d42f9b..00000000 Binary files a/assets/images/note.png and /dev/null differ diff --git a/assets/images/password_icon.png b/assets/images/password_icon.png deleted file mode 100644 index 94c82cb3..00000000 Binary files a/assets/images/password_icon.png and /dev/null differ diff --git a/assets/images/patient/Order_Procedures.png b/assets/images/patient/Order_Procedures.png deleted file mode 100644 index a3cd8ae0..00000000 Binary files a/assets/images/patient/Order_Procedures.png and /dev/null differ diff --git a/assets/images/patient/Progress_notes.png b/assets/images/patient/Progress_notes.png deleted file mode 100644 index f5aba841..00000000 Binary files a/assets/images/patient/Progress_notes.png and /dev/null differ diff --git a/assets/images/patient/arrow_forward.png b/assets/images/patient/arrow_forward.png deleted file mode 100644 index df393784..00000000 Binary files a/assets/images/patient/arrow_forward.png and /dev/null differ diff --git a/assets/images/patient/health_summary.png b/assets/images/patient/health_summary.png deleted file mode 100644 index fe374ebc..00000000 Binary files a/assets/images/patient/health_summary.png and /dev/null differ diff --git a/assets/images/patient/lab_results.png b/assets/images/patient/lab_results.png deleted file mode 100644 index 20e6b5ff..00000000 Binary files a/assets/images/patient/lab_results.png and /dev/null differ diff --git a/assets/images/patient/order_prescription.png b/assets/images/patient/order_prescription.png deleted file mode 100644 index 26e7e9c4..00000000 Binary files a/assets/images/patient/order_prescription.png and /dev/null differ diff --git a/assets/images/patient/patient_sick_leave.png b/assets/images/patient/patient_sick_leave.png deleted file mode 100644 index 56196834..00000000 Binary files a/assets/images/patient/patient_sick_leave.png and /dev/null differ diff --git a/assets/images/patient/vital_signs.png b/assets/images/patient/vital_signs.png deleted file mode 100644 index 76017194..00000000 Binary files a/assets/images/patient/vital_signs.png and /dev/null differ diff --git a/assets/images/profile.svg b/assets/images/profile.svg deleted file mode 100644 index 02b2dc19..00000000 --- a/assets/images/profile.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/assets/images/radiology-1.png b/assets/images/radiology-1.png deleted file mode 100644 index ceb0775e..00000000 Binary files a/assets/images/radiology-1.png and /dev/null differ diff --git a/assets/images/sick_leaves_icons.png b/assets/images/sick_leaves_icons.png deleted file mode 100644 index 67a9c937..00000000 Binary files a/assets/images/sick_leaves_icons.png and /dev/null differ diff --git a/assets/images/svgs/bottom_nav/Dr reply.svg b/assets/images/svgs/bottom_nav/Dr reply.svg deleted file mode 100644 index 931b5304..00000000 --- a/assets/images/svgs/bottom_nav/Dr reply.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/images/svgs/bottom_nav/home.svg b/assets/images/svgs/bottom_nav/home.svg deleted file mode 100644 index 725dd1f9..00000000 --- a/assets/images/svgs/bottom_nav/home.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/svgs/bottom_nav/qr reader.svg b/assets/images/svgs/bottom_nav/qr reader.svg deleted file mode 100644 index 403e3137..00000000 --- a/assets/images/svgs/bottom_nav/qr reader.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/assets/images/svgs/bottom_nav/schedule.svg b/assets/images/svgs/bottom_nav/schedule.svg deleted file mode 100644 index 98232af9..00000000 --- a/assets/images/svgs/bottom_nav/schedule.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/images/type-booked.png b/assets/images/type-booked.png deleted file mode 100644 index c42945cf..00000000 Binary files a/assets/images/type-booked.png and /dev/null differ diff --git a/assets/images/type-livecare.png b/assets/images/type-livecare.png deleted file mode 100644 index 05f3d213..00000000 Binary files a/assets/images/type-livecare.png and /dev/null differ diff --git a/assets/images/type-walkin.png b/assets/images/type-walkin.png deleted file mode 100644 index 555023b3..00000000 Binary files a/assets/images/type-walkin.png and /dev/null differ diff --git a/assets/images/user_female.svg b/assets/images/user_female.svg deleted file mode 100644 index 4c9d8cd2..00000000 --- a/assets/images/user_female.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/assets/images/user_id_icon.png b/assets/images/user_id_icon.png deleted file mode 100644 index 283beb2f..00000000 Binary files a/assets/images/user_id_icon.png and /dev/null differ diff --git a/assets/images/user_male.svg b/assets/images/user_male.svg deleted file mode 100644 index bdf4987f..00000000 --- a/assets/images/user_male.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/assets/images/verification_faceid_icon.png b/assets/images/verification_faceid_icon.png deleted file mode 100644 index 408930e2..00000000 Binary files a/assets/images/verification_faceid_icon.png and /dev/null differ diff --git a/assets/images/verification_fingerprint_icon.png b/assets/images/verification_fingerprint_icon.png deleted file mode 100644 index 32174f4c..00000000 Binary files a/assets/images/verification_fingerprint_icon.png and /dev/null differ diff --git a/assets/images/verification_sms_icon.png b/assets/images/verification_sms_icon.png deleted file mode 100644 index 96b4810b..00000000 Binary files a/assets/images/verification_sms_icon.png and /dev/null differ diff --git a/assets/images/verification_whatsapp_icon.png b/assets/images/verification_whatsapp_icon.png deleted file mode 100644 index 5f6034e5..00000000 Binary files a/assets/images/verification_whatsapp_icon.png and /dev/null differ diff --git a/assets/images/verified_icon.png b/assets/images/verified_icon.png deleted file mode 100644 index 28b5ab3d..00000000 Binary files a/assets/images/verified_icon.png and /dev/null differ diff --git a/assets/images/verify-face.png b/assets/images/verify-face.png deleted file mode 100644 index 58e1f4a6..00000000 Binary files a/assets/images/verify-face.png and /dev/null differ diff --git a/assets/images/verify-finger.png b/assets/images/verify-finger.png deleted file mode 100644 index 15d60b03..00000000 Binary files a/assets/images/verify-finger.png and /dev/null differ diff --git a/assets/images/verify-sms.png b/assets/images/verify-sms.png deleted file mode 100644 index e265e1f9..00000000 Binary files a/assets/images/verify-sms.png and /dev/null differ diff --git a/assets/images/verify-whtsapp.png b/assets/images/verify-whtsapp.png deleted file mode 100644 index 9a79516c..00000000 Binary files a/assets/images/verify-whtsapp.png and /dev/null differ diff --git a/assets/images/vital_blood-pressure.png b/assets/images/vital_blood-pressure.png deleted file mode 100644 index 44c9f2e2..00000000 Binary files a/assets/images/vital_blood-pressure.png and /dev/null differ diff --git a/assets/images/vital_blood_type.png b/assets/images/vital_blood_type.png deleted file mode 100644 index fbb5296f..00000000 Binary files a/assets/images/vital_blood_type.png and /dev/null differ diff --git a/assets/images/vital_body_mass.png b/assets/images/vital_body_mass.png deleted file mode 100644 index 08476c51..00000000 Binary files a/assets/images/vital_body_mass.png and /dev/null differ diff --git a/assets/images/vital_heart_rate.png b/assets/images/vital_heart_rate.png deleted file mode 100644 index e788658b..00000000 Binary files a/assets/images/vital_heart_rate.png and /dev/null differ diff --git a/assets/images/vital_height.png b/assets/images/vital_height.png deleted file mode 100644 index 8c324b2c..00000000 Binary files a/assets/images/vital_height.png and /dev/null differ diff --git a/assets/images/vital_respiration.png b/assets/images/vital_respiration.png deleted file mode 100644 index 7e1b4466..00000000 Binary files a/assets/images/vital_respiration.png and /dev/null differ diff --git a/assets/images/vital_signs.png b/assets/images/vital_signs.png deleted file mode 100644 index 7b642d6e..00000000 Binary files a/assets/images/vital_signs.png and /dev/null differ diff --git a/assets/images/vital_temperature.png b/assets/images/vital_temperature.png deleted file mode 100644 index 7fe657de..00000000 Binary files a/assets/images/vital_temperature.png and /dev/null differ diff --git a/assets/images/vital_weight.png b/assets/images/vital_weight.png deleted file mode 100644 index 5247e924..00000000 Binary files a/assets/images/vital_weight.png and /dev/null differ diff --git a/assets/images/walkin.png b/assets/images/walkin.png deleted file mode 100644 index 81f112f5..00000000 Binary files a/assets/images/walkin.png and /dev/null differ diff --git a/assets/images/welcome_login_icon.png b/assets/images/welcome_login_icon.png deleted file mode 100644 index 811b13c2..00000000 Binary files a/assets/images/welcome_login_icon.png and /dev/null differ diff --git a/ios/Podfile b/ios/Podfile index c2335042..1d3f65fc 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -10,83 +10,38 @@ project 'Runner', { 'Release' => :release, } -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches end - generated_key_values + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + target 'Runner' do use_frameworks! use_modular_headers! - - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. - - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end - end - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' - pod 'OpenTok' - pod 'Alamofire', '~> 5.2' - pod 'AADraggableView' - # Plugin Pods + pod 'Flutter', :path => 'Flutter' + pod 'OpenTok' + pod 'Alamofire', '~> 5.2' + pod 'AADraggableView' + # Plugin Pods - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - post_install do |installer| installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end + flutter_additional_ios_build_settings(target) end end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 80868187..3c58fe30 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -14,13 +14,13 @@ 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 */; }; 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 */; }; 9CE61EBD24AB366E008D68DD /* VideoCallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */; }; 9CE61ECD24ADBB4C008D68DD /* ICallProtocoll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */; }; - B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -37,10 +37,13 @@ /* 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 = ""; }; + 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 = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = ""; }; 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + 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 = ""; }; 300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = ""; }; 300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = ""; }; @@ -48,9 +51,7 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 75DD06875D42C7903A76DF9F /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -60,8 +61,7 @@ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = ""; }; 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = ""; }; - 9D4B7DB43C6A6C849D2387CE /* 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 = ""; }; - E698D7B14B12DF768FE47A1A /* 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 = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -69,7 +69,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B650DC3076E9D70CB188286A /* Pods_Runner.framework in Frameworks */, + 3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -104,9 +104,9 @@ 7D66D387293CE5376A07EC5F /* Pods */ = { isa = PBXGroup; children = ( - E698D7B14B12DF768FE47A1A /* Pods-Runner.debug.xcconfig */, - 75DD06875D42C7903A76DF9F /* Pods-Runner.release.xcconfig */, - 9D4B7DB43C6A6C849D2387CE /* Pods-Runner.profile.xcconfig */, + 2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */, + E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */, + 0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -129,7 +129,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 7D66D387293CE5376A07EC5F /* Pods */, - F984EB986238F1809678CD84 /* Frameworks */, + C1938275850F66EAA5D7AC0F /* Frameworks */, ); sourceTree = ""; }; @@ -171,10 +171,10 @@ name = "Supporting Files"; sourceTree = ""; }; - F984EB986238F1809678CD84 /* Frameworks */ = { + C1938275850F66EAA5D7AC0F /* Frameworks */ = { isa = PBXGroup; children = ( - 93A5F83B23AB032D1E096663 /* Pods_Runner.framework */, + 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -186,14 +186,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 986D76F6694E0D6D8C5CDAAB /* [CP] Check Pods Manifest.lock */, + C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 08568E6EE9BA48E55B7C3865 /* [CP] Embed Pods Frameworks */, + 3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -210,7 +210,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -253,34 +253,113 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 08568E6EE9BA48E55B7C3865 /* [CP] Embed Pods Frameworks */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; + name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/AADraggableView/AADraggableView.framework", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/DKImagePickerController/DKImagePickerController.framework", + "${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework", + "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", + "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", + "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", + "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", + "${BUILT_PRODUCTS_DIR}/OrderedSet/OrderedSet.framework", + "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", + "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", + "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", + "${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework", + "${BUILT_PRODUCTS_DIR}/SwiftyGif/SwiftyGif.framework", + "${BUILT_PRODUCTS_DIR}/Toast/Toast.framework", + "${BUILT_PRODUCTS_DIR}/Try/Try.framework", + "${BUILT_PRODUCTS_DIR}/barcode_scan2/barcode_scan2.framework", + "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", + "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", + "${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework", + "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", + "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", + "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", + "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", + "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", + "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.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 = "Thin Binary"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AADraggableView.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKImagePickerController.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OrderedSet.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyGif.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan2.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.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_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 = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -296,7 +375,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 986D76F6694E0D6D8C5CDAAB /* [CP] Check Pods Manifest.lock */ = { + C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -423,7 +502,10 @@ ); 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", @@ -558,7 +640,10 @@ ); 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", @@ -589,7 +674,10 @@ ); 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", diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16..919434a6 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index bfbb2561..c87d15a3 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ > localizedValues = { "fileNo": {"en": "File No : ", "ar": "رقم الملف :"}, "mobileNo": {"en": "Mobile No", "ar": "رقم الجوال"}, "messagesScreenToolbarTitle": {"en": "Messages", "ar": "الرسائل"}, - "mySchedule": {"en": "Schedule", "ar": "جدولي"}, + "mySchedule": {"en": "Schedules", "ar": "جدولي"}, "errorNoSchedule": { "en": "You don't have any Schedule", "ar": "ليس لديك أي جدول" }, "verify": {"en": "VERIFY", "ar": "تحقق"}, + "pharmacy-intervention": {"en": "Pharmacy Intervention", "ar": "التدخل الصيدلاني"}, "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, "frequency": {"en": "Frequency", "ar": "تكرر"}, @@ -56,7 +57,7 @@ const Map> localizedValues = { "myInPatient": {"en": "My\n In Patients", "ar": "مرضاي\nالمنومين"}, "myInPatientTitle": {"en": "My Patients", "ar": "مرضاي المنومين"}, "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, - "inPatientAll": {"en": "All Patients", "ar": "جميع المرضى المنومين"}, + "inPatientAll": {"en": "All Patients", "ar": "المرضى المنومين"}, "operations": {"en": "Operations", "ar": "عمليات"}, "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, "searchMedicineDashboard": { @@ -83,8 +84,8 @@ const Map> localizedValues = { "ar": "المريض الذي حضر للموعد" }, "searchMedicineNameHere": {"en": "Search Medicine ", "ar": "ابحث هنا"}, - "youCanFind": {"en": "You Can Find ", "ar": "تستطيع ان تجد "}, - "itemsInSearch": {"en": "items in search", "ar": "عناصر في البحث"}, + "youCanFind": {"en": "You can find ", "ar": "تستطيع ان تجد "}, + "medicineSearchResult": {"en": "as a search result for", "ar": "كنتيجة بحث عن"}, "qr": {"en": "QR", "ar": "QR"}, "reader": {"en": "Reader", "ar": "قارىء رمز ال"}, "startScanning": {"en": "Start Scanning", "ar": "بدء المسح"}, @@ -537,6 +538,10 @@ const Map> localizedValues = { "selectSeverity": {"en": "Select Severity", "ar": "حدد الخطورة"}, "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, "medications": {"en": "Medications", "ar": "الأدوية"}, + "medication": {"en": "Medication", "ar": "الدواء"}, + "createdByName": {"en": "Created By Name", "ar": "الدواء"}, + "statusDescription": {"en": "Status Description", "ar": "وصف الحالة"}, + "doctorComments": {"en": "Doctor Comments", "ar": "تعليقات الطبيب"}, "procedures": {"en": "Procedures", "ar": "الإجراءات"}, "vitalSignEmptyMsg": { "en": "There is no vital signs for this patient", @@ -663,6 +668,7 @@ const Map> localizedValues = { "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, + "riskScore": {"en": "Risk Score :", "ar": "درجة المخاطر"}, "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, "noItem": { @@ -708,7 +714,7 @@ const Map> localizedValues = { "icd": {"en": "ICD", "ar": "التصنيف الدولي للأمراض"}, "days": {"en": "Days", "ar": "أيام"}, "months": {"en": "Months", "ar": "أشهر"}, - "years": {"en": "Years", "ar": "سنوات"}, + "years": {"en": "Years", "ar": "سنة"}, "hr": {"en": "Hr", "ar": "س"}, "min": {"en": "Min", "ar": "د"}, "appointmentNumber": {"en": "Appointment Number", "ar": "رقم الموعد"}, @@ -1053,6 +1059,8 @@ const Map> localizedValues = { "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, "nursing": {"en": "Nursing", "ar": "تمريض"}, "diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, + "pharmacy": {"en": "Pharmacy", "ar": "الصيدلاني"}, + "intervention": {"en": "Intervention", "ar": "التدخل"}, "chart": {"en": "Chart", "ar": "جدول"}, "operationTimeStart": { "en": "Operation Time Start :", @@ -1118,4 +1126,20 @@ const Map> localizedValues = { }, "planedProcedure": {"en": "Planed Procedure", "ar": "الإجراء المخطط"}, "moreDetails": {"en": "More Details", "ar": "المزيد من التفاصيل"}, + "VTE_Type": {"en": "VTE Type", "ar": "VTE Type"}, + "pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"}, + "reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"}, + "youDoNotHaveFavoritePrescription": {"en": "You Don't Have Favorite Prescription", "ar": "ليس لديك وصفة طبية مفضلة"}, + "pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"}, + "searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"}, + "sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"}, + "thousandIsTheMAXForTheStrength": {"en": "1000 Is The MAX For The Strength", "ar": "ألف هو القيمة الأعلى"}, + "strengthCanNotBeZero": {"en": "Strength Can't Be Zero", "ar": "القوة لا يمكن أن تكون صفر "}, + "old": {"en": "Old", "ar":"القديمه"}, + "orderTypeDescription": {"en": "Order Type Description", "ar":"وصف نوع الطلب"}, + "doseDetails": {"en": "Dose Details", "ar":"تفاصيل الجرعة"}, + "selectCondition": {"en": "Select Condition", "ar":"قم بتحديد الشرط"}, + "yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"}, + "youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""}, + "conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"}, }; diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 21859d3b..f131d30a 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -21,6 +21,7 @@ class SizeConfig { static bool isHeightMiddle = false; static bool isHeightLarge = false; static bool isWidthLarge = false; + void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; diff --git a/lib/core/enum/CalenderType.dart b/lib/core/enum/CalenderType.dart index 51f98512..fbfbbc64 100644 --- a/lib/core/enum/CalenderType.dart +++ b/lib/core/enum/CalenderType.dart @@ -1,4 +1,4 @@ -enum CalenderType{ +enum CalenderType { Gregorian, Hijri, -} \ No newline at end of file +} diff --git a/lib/core/enum/PatientType.dart b/lib/core/enum/PatientType.dart index 96fd9ae5..145aacf2 100644 --- a/lib/core/enum/PatientType.dart +++ b/lib/core/enum/PatientType.dart @@ -1,4 +1,4 @@ -enum PatientType{ +enum PatientType { IN_PATIENT, OUT_PATIENT, -} \ No newline at end of file +} diff --git a/lib/core/enum/auth_method_types.dart b/lib/core/enum/auth_method_types.dart index 82577eeb..cf7befad 100644 --- a/lib/core/enum/auth_method_types.dart +++ b/lib/core/enum/auth_method_types.dart @@ -1,4 +1,5 @@ -enum AuthMethodTypes { SMS, WhatsApp, Fingerprint,FaceID,MoreOptions } +enum AuthMethodTypes { SMS, WhatsApp, Fingerprint, FaceID, MoreOptions } + extension SelectedAuthMethodTypesService on AuthMethodTypes { // ignore: missing_return int getTypeIdService() { @@ -18,12 +19,11 @@ extension SelectedAuthMethodTypesService on AuthMethodTypes { case AuthMethodTypes.MoreOptions: return 5; break; - } } // ignore: missing_return - static getMethodsTypeService( int typeId) { + static getMethodsTypeService(int typeId) { switch (typeId) { case 1: return AuthMethodTypes.SMS; @@ -40,7 +40,6 @@ extension SelectedAuthMethodTypesService on AuthMethodTypes { case 5: return AuthMethodTypes.MoreOptions; break; - } } -} \ No newline at end of file +} diff --git a/lib/core/enum/filter_type.dart b/lib/core/enum/filter_type.dart index bfa781f9..a80b8898 100644 --- a/lib/core/enum/filter_type.dart +++ b/lib/core/enum/filter_type.dart @@ -1,6 +1,3 @@ enum FilterType { Clinic, Hospital } enum OutPatientFilterType { Previous, Today, NextWeek } - - - diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index 25e40d3b..04608719 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -19,7 +19,6 @@ enum MasterKeysService { MedicationFrequency, MedicationDoseTime, MedicationIndications, - AdmissionRequestType, DiagnosisSelectionType, } diff --git a/lib/core/enum/patient_type.dart b/lib/core/enum/patient_type.dart index efea543c..7591f6f5 100644 --- a/lib/core/enum/patient_type.dart +++ b/lib/core/enum/patient_type.dart @@ -1,2 +1 @@ enum PatientType { inPatient, OutPatient } - diff --git a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart index 4b95c1b0..ce65a600 100644 --- a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart +++ b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart @@ -27,30 +27,30 @@ class CheckActivationCodeModel { CheckActivationCodeModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.forRegisteration, - this.activationCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.forRegisteration, + this.activationCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); CheckActivationCodeModel.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart index 3465cf8d..cba0e11d 100644 --- a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart @@ -19,22 +19,22 @@ class CheckPatientForRegistrationModel { CheckPatientForRegistrationModel( {this.patientIdentificationID, - this.patientMobileNumber, - this.zipCode, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.isRegister, - this.dOB, - this.isHijri}); + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister, + this.dOB, + this.isHijri}); CheckPatientForRegistrationModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart index f05131ef..254ddab5 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart @@ -14,17 +14,17 @@ class GetPatientInfoRequestModel { GetPatientInfoRequestModel( {this.patientIdentificationID, - this.dOB, - this.isHijri, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID}); + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); GetPatientInfoRequestModel.fromJson(Map json) { patientIdentificationID = json['PatientIdentificationID']; diff --git a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart index 158bd1e2..1de1ded4 100644 --- a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart +++ b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart @@ -90,93 +90,93 @@ class GetPatientInfoResponseModel { GetPatientInfoResponseModel( {this.date, - this.languageID, - this.serviceName, - this.time, - this.androidLink, - this.authenticationTokenID, - this.data, - this.dataw, - this.dietType, - this.errorCode, - this.errorEndUserMessage, - this.errorEndUserMessageN, - this.errorMessage, - this.errorType, - this.foodCategory, - this.iOSLink, - this.isAuthenticated, - this.mealOrderStatus, - this.mealType, - this.messageStatus, - this.numberOfResultRecords, - this.patientBlodType, - this.successMsg, - this.successMsgN, - this.vidaUpdatedResponse, - this.accessTokenObject, - this.age, - this.clientIdentifierId, - this.createdBy, - this.dateOfBirth, - this.firstNameAr, - this.firstNameEn, - this.gender, - this.genderAr, - this.genderEn, - this.healthId, - this.idNumber, - this.idType, - this.isHijri, - this.isInstertedOrUpdated, - this.isNull, - this.isPatientExistNHIC, - this.isRecordLockedByCurrentUser, - this.lastNameAr, - this.lastNameEn, - this.listActiveAccessToken, - this.maritalStatus, - this.maritalStatusCode, - this.nationalDateOfBirth, - this.nationality, - this.nationalityCode, - this.occupation, - this.pCDTransactionDataResultList, - this.pCDGetVidaPatientForManualVerificationList, - this.pCDNHICHMGPatientDetailsMatchCalulationList, - this.pCDReturnValue, - this.patientStatus, - this.placeofBirth, - this.practitionerStatusCode, - this.practitionerStatusDescAr, - this.practitionerStatusDescEn, - this.rowCount, - this.secondNameAr, - this.secondNameEn, - this.thirdNameAr, - this.thirdNameEn, - this.yakeenVidaPatientDataStatisticsByPatientIdList, - this.yakeenVidaPatientDataStatisticsList, - this.yakeenVidaPatientDataStatisticsPrefferedList, - this.accessToken, - this.categoryCode, - this.categoryNameAr, - this.categoryNameEn, - this.constraintCode, - this.constraintNameAr, - this.constraintNameEn, - this.content, - this.errorList, - this.licenseExpiryDate, - this.licenseIssuedDate, - this.licenseStatusCode, - this.licenseStatusDescAr, - this.licenseStatusDescEn, - this.organizations, - this.registrationNumber, - this.specialtyCode, - this.specialtyNameAr, - this.specialtyNameEn}); + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.vidaUpdatedResponse, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.isRecordLockedByCurrentUser, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationalDateOfBirth, + this.nationality, + this.nationalityCode, + this.occupation, + this.pCDTransactionDataResultList, + this.pCDGetVidaPatientForManualVerificationList, + this.pCDNHICHMGPatientDetailsMatchCalulationList, + this.pCDReturnValue, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.rowCount, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.yakeenVidaPatientDataStatisticsByPatientIdList, + this.yakeenVidaPatientDataStatisticsList, + this.yakeenVidaPatientDataStatisticsPrefferedList, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.errorList, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); GetPatientInfoResponseModel.fromJson(Map json) { date = json['Date']; @@ -233,9 +233,9 @@ class GetPatientInfoResponseModel { occupation = json['Occupation']; pCDTransactionDataResultList = json['PCDTransactionDataResultList']; pCDGetVidaPatientForManualVerificationList = - json['PCD_GetVidaPatientForManualVerificationList']; + json['PCD_GetVidaPatientForManualVerificationList']; pCDNHICHMGPatientDetailsMatchCalulationList = - json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; + json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; pCDReturnValue = json['PCD_ReturnValue']; patientStatus = json['PatientStatus']; placeofBirth = json['PlaceofBirth']; @@ -248,11 +248,11 @@ class GetPatientInfoResponseModel { thirdNameAr = json['ThirdNameAr']; thirdNameEn = json['ThirdNameEn']; yakeenVidaPatientDataStatisticsByPatientIdList = - json['YakeenVidaPatientDataStatisticsByPatientIdList']; + json['YakeenVidaPatientDataStatisticsByPatientIdList']; yakeenVidaPatientDataStatisticsList = - json['YakeenVidaPatientDataStatisticsList']; + json['YakeenVidaPatientDataStatisticsList']; yakeenVidaPatientDataStatisticsPrefferedList = - json['YakeenVidaPatientDataStatisticsPrefferedList']; + json['YakeenVidaPatientDataStatisticsPrefferedList']; accessToken = json['accessToken']; categoryCode = json['categoryCode']; categoryNameAr = json['categoryNameAr']; diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart index 83ff53d7..f7139725 100644 --- a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart @@ -20,23 +20,23 @@ class PatientRegistrationModel { PatientRegistrationModel( {this.patientobject, - this.patientIdentificationID, - this.patientMobileNumber, - this.logInTokenID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.tokenID, - this.dOB, - this.isHijri, - this.healthId, - this.zipCode}); + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.dOB, + this.isHijri, + this.healthId, + this.zipCode}); PatientRegistrationModel.fromJson(Map json) { patientobject = json['Patientobject'] != null @@ -112,26 +112,26 @@ class Patientobject { Patientobject( {this.tempValue, - this.patientIdentificationType, - this.patientIdentificationNo, - this.mobileNumber, - this.patientOutSA, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.firstName, - this.middleName, - this.lastName, - this.strDateofBirth, - this.dateofBirth, - this.gender, - this.nationalityID, - this.dateofBirthN, - this.emailAddress, - this.sourceType, - this.preferredLanguage, - this.marital, - this.eHealthIDField}); + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.firstName, + this.middleName, + this.lastName, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital, + this.eHealthIDField}); Patientobject.fromJson(Map json) { tempValue = json['TempValue']; diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart index 8244a95f..5709e137 100644 --- a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -26,29 +26,29 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel { SendActivationCodeByOTPNotificationTypeForRegistrationModel( {this.patientMobileNumber, - this.mobileNo, - this.projectOutSA, - this.loginType, - this.zipCode, - this.isRegister, - this.logInTokenID, - this.searchType, - this.patientID, - this.nationalID, - this.patientIdentificationID, - this.oTPSendType, - this.languageID, - this.versionID, - this.channel, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.dOB, - this.isHijri, - this.healthId}); + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( Map json) { diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart index c47a813a..1ba6007e 100644 --- a/lib/core/model/Prescriptions/Prescriptions.dart +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -69,7 +69,8 @@ class Prescriptions { this.nationalityFlagURL, this.noOfPatientsRate, this.qR, - this.speciality,this.isLiveCareAppointment}); + this.speciality, + this.isLiveCareAppointment}); Prescriptions.fromJson(Map json) { setupID = json['SetupID']; @@ -105,7 +106,7 @@ class Prescriptions { noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } Map toJson() { diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart index 3adaef7e..4634d30e 100644 --- a/lib/core/model/Prescriptions/perscription_pharmacy.dart +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -26,29 +26,29 @@ class PharmacyPrescriptions { PharmacyPrescriptions( {this.expiryDate, - this.sellingPrice, - this.quantity, - this.itemID, - this.locationID, - this.projectID, - this.setupID, - this.locationDescription, - this.locationDescriptionN, - this.itemDescription, - this.itemDescriptionN, - this.alias, - this.locationTypeID, - this.barcode, - this.companybarcode, - this.cityID, - this.cityName, - this.distanceInKilometers, - this.latitude, - this.locationType, - this.longitude, - this.phoneNumber, - this.projectImageURL, - this.sortOrder}); + this.sellingPrice, + this.quantity, + this.itemID, + this.locationID, + this.projectID, + this.setupID, + this.locationDescription, + this.locationDescriptionN, + this.itemDescription, + this.itemDescriptionN, + this.alias, + this.locationTypeID, + this.barcode, + this.companybarcode, + this.cityID, + this.cityName, + this.distanceInKilometers, + this.latitude, + this.locationType, + this.longitude, + this.phoneNumber, + this.projectImageURL, + this.sortOrder}); PharmacyPrescriptions.fromJson(Map json) { expiryDate = json['ExpiryDate']; diff --git a/lib/core/model/Prescriptions/prescription_entity_model.dart b/lib/core/model/Prescriptions/prescription_entity_model.dart new file mode 100644 index 00000000..166cd599 --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_entity_model.dart @@ -0,0 +1,145 @@ +class PrescriptionEntityModel { + dynamic appointmentNo; + dynamic clinicName; + dynamic createdBy; + dynamic createdOn; + dynamic doctorName; + dynamic doseDailyQuantity; + dynamic doseDailyUnitID; + dynamic doseDetail; + dynamic doseDurationDays; + dynamic doseTimingID; + dynamic episodeID; + dynamic frequencyID; + dynamic icdCode10ID; + dynamic indication; + dynamic isDispensed; + dynamic isMedicineCovered; + dynamic isSIG; + dynamic medicationName; + dynamic medicationPrice; + dynamic medicineCode; + dynamic orderTypeDescription; + dynamic qty; + dynamic quantity; + dynamic remarks; + dynamic routeID; + dynamic startDate; + dynamic status; + dynamic stopDate; + dynamic uom; + dynamic pharmacistRemarks; + dynamic pharmacyInervention; + dynamic refill; + dynamic mediSpanGPICode; + + PrescriptionEntityModel( + {this.appointmentNo, + this.clinicName, + this.createdBy, + this.createdOn, + this.doctorName, + this.doseDailyQuantity, + this.doseDailyUnitID, + this.doseDetail, + this.doseDurationDays, + this.doseTimingID, + this.episodeID, + this.frequencyID, + this.icdCode10ID, + this.indication, + this.isDispensed, + this.isMedicineCovered, + this.isSIG, + this.medicationName, + this.medicationPrice, + this.medicineCode, + this.orderTypeDescription, + this.qty, + this.quantity, + this.remarks, + this.routeID, + this.startDate, + this.status, + this.stopDate, + this.uom, + this.pharmacistRemarks, + this.mediSpanGPICode, + this.pharmacyInervention, + this.refill}); + + PrescriptionEntityModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + clinicName = json['clinicName']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorName = json['doctorName']; + doseDailyQuantity = json['doseDailyQuantity']; + doseDailyUnitID = json['doseDailyUnitID']; + doseDetail = json['doseDetail']; + doseDurationDays = json['doseDurationDays']; + doseTimingID = json['doseTimingID']; + episodeID = json['episodeID']; + frequencyID = json['frequencyID']; + icdCode10ID = json['icdCode10ID']; + indication = json['indication']; + isDispensed = json['isDispensed']; + isMedicineCovered = json['isMedicineCovered']; + isSIG = json['isSIG']; + medicationName = json['medicationName']; + medicationPrice = json['medicationPrice']; + medicineCode = json['medicineCode']; + orderTypeDescription = json['orderTypeDescription']; + qty = json['qty']; + quantity = json['quantity']; + remarks = json['remarks']; + routeID = json['routeID']; + startDate = json['startDate']; + status = json['status']; + stopDate = json['stopDate']; + uom = json['uom']; + pharmacistRemarks = json['pharmacistRemarks']; + mediSpanGPICode = json['mediSpanGPICode']; + refill = json['refill']; + pharmacyInervention = json['interventionID']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['clinicName'] = this.clinicName; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorName'] = this.doctorName; + data['doseDailyQuantity'] = this.doseDailyQuantity; + data['doseDailyUnitID'] = this.doseDailyUnitID; + data['doseDetail'] = this.doseDetail; + data['doseDurationDays'] = this.doseDurationDays; + data['doseTimingID'] = this.doseTimingID; + data['episodeID'] = this.episodeID; + data['frequencyID'] = this.frequencyID; + data['icdCode10ID'] = this.icdCode10ID; + data['indication'] = this.indication; + data['isDispensed'] = this.isDispensed; + data['isMedicineCovered'] = this.isMedicineCovered; + data['isSIG'] = this.isSIG; + data['medicationName'] = this.medicationName; + data['medicationPrice'] = this.medicationPrice; + data['medicineCode'] = this.medicineCode; + data['orderTypeDescription'] = this.orderTypeDescription; + data['qty'] = this.qty; + data['quantity'] = this.quantity; + data['remarks'] = this.remarks; + data['routeID'] = this.routeID; + data['startDate'] = this.startDate; + data['status'] = this.status; + data['stopDate'] = this.stopDate; + data['uom'] = this.uom; + data['pharmacistRemarks'] = this.pharmacistRemarks; + data['mediSpanGPICode'] = this.mediSpanGPICode; + data['refill'] = this.refill; + data['interventionID'] = this.pharmacyInervention; + + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 92574c66..a286908f 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,7 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; + class PrescriptionModel { - List entityList; + List entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +9,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = new List(); json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList.add(new PrescriptionEntityModel.fromJson(v)); }); } rowcount = json['rowcount']; @@ -26,148 +28,3 @@ class PrescriptionModel { return data; } } - -class EntityList { - dynamic appointmentNo; - dynamic clinicName; - dynamic createdBy; - dynamic createdOn; - dynamic doctorName; - dynamic doseDailyQuantity; - dynamic doseDailyUnitID; - dynamic doseDetail; - dynamic doseDurationDays; - dynamic doseTimingID; - dynamic episodeID; - dynamic frequencyID; - dynamic icdCode10ID; - dynamic indication; - dynamic isDispensed; - dynamic isMedicineCovered; - dynamic isSIG; - dynamic medicationName; - dynamic medicationPrice; - dynamic medicineCode; - dynamic orderTypeDescription; - dynamic qty; - dynamic quantity; - dynamic remarks; - dynamic routeID; - dynamic startDate; - dynamic status; - dynamic stopDate; - dynamic uom; - dynamic pharmacistRemarks; - dynamic pharmacyInervention; - dynamic refill; - dynamic mediSpanGPICode; - EntityList( - {this.appointmentNo, - this.clinicName, - this.createdBy, - this.createdOn, - this.doctorName, - this.doseDailyQuantity, - this.doseDailyUnitID, - this.doseDetail, - this.doseDurationDays, - this.doseTimingID, - this.episodeID, - this.frequencyID, - this.icdCode10ID, - this.indication, - this.isDispensed, - this.isMedicineCovered, - this.isSIG, - this.medicationName, - this.medicationPrice, - this.medicineCode, - this.orderTypeDescription, - this.qty, - this.quantity, - this.remarks, - this.routeID, - this.startDate, - this.status, - this.stopDate, - this.uom, - this.pharmacistRemarks, - this.mediSpanGPICode, - this.pharmacyInervention, - this.refill}); - - EntityList.fromJson(Map json) { - appointmentNo = json['appointmentNo']; - clinicName = json['clinicName']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - doctorName = json['doctorName']; - doseDailyQuantity = json['doseDailyQuantity']; - doseDailyUnitID = json['doseDailyUnitID']; - doseDetail = json['doseDetail']; - doseDurationDays = json['doseDurationDays']; - doseTimingID = json['doseTimingID']; - episodeID = json['episodeID']; - frequencyID = json['frequencyID']; - icdCode10ID = json['icdCode10ID']; - indication = json['indication']; - isDispensed = json['isDispensed']; - isMedicineCovered = json['isMedicineCovered']; - isSIG = json['isSIG']; - medicationName = json['medicationName']; - medicationPrice = json['medicationPrice']; - medicineCode = json['medicineCode']; - orderTypeDescription = json['orderTypeDescription']; - qty = json['qty']; - quantity = json['quantity']; - remarks = json['remarks']; - routeID = json['routeID']; - startDate = json['startDate']; - status = json['status']; - stopDate = json['stopDate']; - uom = json['uom']; - pharmacistRemarks = json['pharmacistRemarks']; - mediSpanGPICode = json['mediSpanGPICode']; - refill = json['refill']; - pharmacyInervention = json['interventionID']; - } - - Map toJson() { - final Map data = new Map(); - data['appointmentNo'] = this.appointmentNo; - data['clinicName'] = this.clinicName; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['doctorName'] = this.doctorName; - data['doseDailyQuantity'] = this.doseDailyQuantity; - data['doseDailyUnitID'] = this.doseDailyUnitID; - data['doseDetail'] = this.doseDetail; - data['doseDurationDays'] = this.doseDurationDays; - data['doseTimingID'] = this.doseTimingID; - data['episodeID'] = this.episodeID; - data['frequencyID'] = this.frequencyID; - data['icdCode10ID'] = this.icdCode10ID; - data['indication'] = this.indication; - data['isDispensed'] = this.isDispensed; - data['isMedicineCovered'] = this.isMedicineCovered; - data['isSIG'] = this.isSIG; - data['medicationName'] = this.medicationName; - data['medicationPrice'] = this.medicationPrice; - data['medicineCode'] = this.medicineCode; - data['orderTypeDescription'] = this.orderTypeDescription; - data['qty'] = this.qty; - data['quantity'] = this.quantity; - data['remarks'] = this.remarks; - data['routeID'] = this.routeID; - data['startDate'] = this.startDate; - data['status'] = this.status; - data['stopDate'] = this.stopDate; - data['uom'] = this.uom; - data['pharmacistRemarks'] = this.pharmacistRemarks; - data['mediSpanGPICode'] = this.mediSpanGPICode; - data['refill'] = this.refill; - data['interventionID'] = this.pharmacyInervention; - - return data; - } -} diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index 01b9a5c9..e73034bd 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -35,38 +35,38 @@ class PrescriptionReportEnh { PrescriptionReportEnh( {this.address, - this.appodynamicmentNo, - this.clinic, - this.companyName, - this.days, - this.doctorName, - this.doseDailyQuantity, - this.frequency, - this.frequencyNumber, - this.image, - this.imageExtension, - this.imageSRCUrl, - this.imageString, - this.imageThumbUrl, - this.isCovered, - this.itemDescription, - this.itemID, - this.orderDate, - this.patientID, - this.patientName, - this.phoneOffice1, - this.prescriptionQR, - this.prescriptionTimes, - this.productImage, - this.productImageBase64, - this.productImageString, - this.projectID, - this.projectName, - this.remarks, - this.route, - this.sKU, - this.scaleOffset, - this.startDate}); + this.appodynamicmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); PrescriptionReportEnh.fromJson(Map json) { address = json['Address']; diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index a45878d8..ec69ca33 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,26 +1,20 @@ class PrescriptionReqModel { - String vidaAuthTokenID; dynamic patientMRN; dynamic appNo; - dynamic admissionNo; PrescriptionReqModel( - {this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); + { this.patientMRN, this.appNo}); PrescriptionReqModel.fromJson(Map json) { - vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; appNo = json['AppointmentNo']; - admissionNo = json['AdmissionNo']; + } Map toJson() { final Map data = new Map(); - data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appNo; - data['AdmissionNo'] = this.admissionNo; - return data; } } diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart index f51420ec..33e23fe8 100644 --- a/lib/core/model/Prescriptions/prescriptions_order.dart +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -34,35 +34,35 @@ class PrescriptionsOrder { PrescriptionsOrder( {this.iD, - this.patientID, - this.patientOutSA, - this.isOutPatient, - this.projectID, - this.nearestProjectID, - this.longitude, - this.latitude, - this.appointmentNo, - this.dischargeID, - this.lineItemNo, - this.status, - this.description, - this.descriptionN, - this.createdOn, - this.serviceID, - this.createdBy, - this.editedOn, - this.editedBy, - this.channel, - this.clientRequestID, - this.returnedToQueue, - this.pickupDateTime, - this.pickupLocationName, - this.dropoffLocationName, - this.realRRTHaveTransactions, - this.nearestProjectDescription, - this.nearestProjectDescriptionN, - this.projectDescription, - this.projectDescriptionN}); + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); PrescriptionsOrder.fromJson(Map json) { iD = json['ID']; diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart index 739bb838..e7d968c5 100644 --- a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -14,17 +14,17 @@ class RequestGetListPharmacyForPrescriptions { RequestGetListPharmacyForPrescriptions( {this.latitude, - this.longitude, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.itemID}); + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); RequestGetListPharmacyForPrescriptions.fromJson(Map json) { latitude = json['Latitude']; diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart index c8323740..edd249ee 100644 --- a/lib/core/model/Prescriptions/request_prescription_report.dart +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -21,24 +21,24 @@ class RequestPrescriptionReport { RequestPrescriptionReport( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID, - this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); RequestPrescriptionReport.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart index 4905fc2a..48b4f435 100644 --- a/lib/core/model/Prescriptions/request_prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -21,23 +21,24 @@ class RequestPrescriptionReportEnh { RequestPrescriptionReportEnh( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.appointmentNo, - this.setupID, - this.episodeID, - this.clinicID, - this.projectID,this.dischargeNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); RequestPrescriptionReportEnh.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/core/model/SOAP/Allergy_model.dart similarity index 83% rename from lib/models/SOAP/Allergy_model.dart rename to lib/core/model/SOAP/Allergy_model.dart index c3493832..f1a498da 100644 --- a/lib/models/SOAP/Allergy_model.dart +++ b/lib/core/model/SOAP/Allergy_model.dart @@ -14,17 +14,17 @@ class AllergyModel { AllergyModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); AllergyModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart similarity index 88% rename from lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart rename to lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index f04fd8d4..b8b7f38c 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -7,7 +7,12 @@ class GetChiefComplaintReqModel { int admissionNo; GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); + {this.patientMRN, + this.appointmentNo, + this.episodeId, + this.episodeID, + this.doctorID, + this.admissionNo}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart similarity index 84% rename from lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart rename to lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart index 85ada324..16a524ef 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart +++ b/lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -14,17 +14,17 @@ class GetChiefComplaintResModel { GetChiefComplaintResModel( {this.appointmentNo, - this.ccdate, - this.chiefComplaint, - this.clinicDescription, - this.clinicID, - this.currentMedication, - this.doctorID, - this.doctorName, - this.episodeId, - this.hopi, - this.patientMRN, - this.status}); + this.ccdate, + this.chiefComplaint, + this.clinicDescription, + this.clinicID, + this.currentMedication, + this.doctorID, + this.doctorName, + this.episodeId, + this.hopi, + this.patientMRN, + this.status}); GetChiefComplaintResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/core/model/SOAP/GeneralGetReqForSOAP.dart similarity index 100% rename from lib/models/SOAP/GeneralGetReqForSOAP.dart rename to lib/core/model/SOAP/GeneralGetReqForSOAP.dart diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/core/model/SOAP/GetAllergiesResModel.dart similarity index 84% rename from lib/models/SOAP/GetAllergiesResModel.dart rename to lib/core/model/SOAP/GetAllergiesResModel.dart index 1eeca63e..d3eac57d 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/core/model/SOAP/GetAllergiesResModel.dart @@ -15,17 +15,18 @@ class GetAllergiesResModel { GetAllergiesResModel( {this.allergyDiseaseId, - this.allergyDiseaseName, - this.allergyDiseaseType, - this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.episodeID, - this.isChecked, - this.isUpdatedByNurse, - this.severity, - this.severityName, this.remarks=''}); + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName, + this.remarks = ''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/core/model/SOAP/GetAssessmentReqModel.dart similarity index 85% rename from lib/models/SOAP/GetAssessmentReqModel.dart rename to lib/core/model/SOAP/GetAssessmentReqModel.dart index 965382b5..0c71982e 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/core/model/SOAP/GetAssessmentReqModel.dart @@ -10,13 +10,13 @@ class GetAssessmentReqModel { GetAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/core/model/SOAP/GetAssessmentResModel.dart similarity index 83% rename from lib/models/SOAP/GetAssessmentResModel.dart rename to lib/core/model/SOAP/GetAssessmentResModel.dart index 4d1b1b68..ca460c81 100644 --- a/lib/models/SOAP/GetAssessmentResModel.dart +++ b/lib/core/model/SOAP/GetAssessmentResModel.dart @@ -17,20 +17,20 @@ class GetAssessmentResModel { GetAssessmentResModel( {this.appointmentNo, - this.asciiDesc, - this.clinicDescription, - this.clinicID, - this.complexDiagnosis, - this.conditionID, - this.createdBy, - this.createdOn, - this.diagnosisTypeID, - this.doctorID, - this.doctorName, - this.episodeId, - this.icdCode10ID, - this.patientMRN, - this.remarks}); + this.asciiDesc, + this.clinicDescription, + this.clinicID, + this.complexDiagnosis, + this.conditionID, + this.createdBy, + this.createdOn, + this.diagnosisTypeID, + this.doctorID, + this.doctorName, + this.episodeId, + this.icdCode10ID, + this.patientMRN, + this.remarks}); GetAssessmentResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/core/model/SOAP/GetGetProgressNoteReqModel.dart similarity index 86% rename from lib/models/SOAP/GetGetProgressNoteReqModel.dart rename to lib/core/model/SOAP/GetGetProgressNoteReqModel.dart index 1da4a8bf..47f1861a 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/core/model/SOAP/GetGetProgressNoteReqModel.dart @@ -10,13 +10,13 @@ class GetGetProgressNoteReqModel { GetGetProgressNoteReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to, - this.clinicID, - this.editedBy, - this.doctorID}); + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.editedBy, + this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -27,7 +27,6 @@ class GetGetProgressNoteReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; - } Map toJson() { diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/core/model/SOAP/GetGetProgressNoteResModel.dart similarity index 82% rename from lib/models/SOAP/GetGetProgressNoteResModel.dart rename to lib/core/model/SOAP/GetGetProgressNoteResModel.dart index 4ae7ed8c..1e5cae66 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/core/model/SOAP/GetGetProgressNoteResModel.dart @@ -1,4 +1,4 @@ -class GetPatientProgressNoteResModel { +class GetPatientProgressNoteResModel { int appointmentNo; int createdBy; String createdByName; @@ -13,16 +13,16 @@ class GetPatientProgressNoteResModel { GetPatientProgressNoteResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.dName, - this.editedByName, - this.editedOn, - this.episodeId, - this.mName, - this.patientMRN, - this.planNote}); + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/core/model/SOAP/GetHistoryReqModel.dart similarity index 99% rename from lib/models/SOAP/GetHistoryReqModel.dart rename to lib/core/model/SOAP/GetHistoryReqModel.dart index 720b6342..2211c4f4 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/core/model/SOAP/GetHistoryReqModel.dart @@ -30,7 +30,6 @@ class GetHistoryReqModel { doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; editedBy = json['EditedBy']; - } Map toJson() { diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/core/model/SOAP/GetHistoryResModel.dart similarity index 86% rename from lib/models/SOAP/GetHistoryResModel.dart rename to lib/core/model/SOAP/GetHistoryResModel.dart index c4b4f129..078a2caa 100644 --- a/lib/models/SOAP/GetHistoryResModel.dart +++ b/lib/core/model/SOAP/GetHistoryResModel.dart @@ -9,12 +9,12 @@ class GetHistoryResModel { GetHistoryResModel( {this.appointmentNo, - this.episodeId, - this.historyId, - this.historyType, - this.isChecked, - this.patientMRN, - this.remarks}); + this.episodeId, + this.historyId, + this.historyType, + this.isChecked, + this.patientMRN, + this.remarks}); GetHistoryResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/core/model/SOAP/GetPhysicalExamListResModel.dart similarity index 82% rename from lib/models/SOAP/GetPhysicalExamListResModel.dart rename to lib/core/model/SOAP/GetPhysicalExamListResModel.dart index c97189b1..c8f825ad 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/core/model/SOAP/GetPhysicalExamListResModel.dart @@ -21,24 +21,24 @@ class GetPhysicalExamResModel { GetPhysicalExamResModel( {this.appointmentNo, - this.createdBy, - this.createdByName, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedOn, - this.episodeId, - this.examId, - this.examName, - this.examType, - this.examinationType, - this.examinationTypeName, - this.isAbnormal, - this.isNew, - this.isNormal, - this.notExamined, - this.patientMRN, - this.remarks}); + this.createdBy, + this.createdByName, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedOn, + this.episodeId, + this.examId, + this.examName, + this.examType, + this.examinationType, + this.examinationTypeName, + this.isAbnormal, + this.isNew, + this.isNormal, + this.notExamined, + this.patientMRN, + this.remarks}); GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/core/model/SOAP/GetPhysicalExamReqModel.dart similarity index 100% rename from lib/models/SOAP/GetPhysicalExamReqModel.dart rename to lib/core/model/SOAP/GetPhysicalExamReqModel.dart diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/core/model/SOAP/PatchAssessmentReqModel.dart similarity index 85% rename from lib/models/SOAP/PatchAssessmentReqModel.dart rename to lib/core/model/SOAP/PatchAssessmentReqModel.dart index 8cbf5cb7..fb229127 100644 --- a/lib/models/SOAP/PatchAssessmentReqModel.dart +++ b/lib/core/model/SOAP/PatchAssessmentReqModel.dart @@ -11,14 +11,14 @@ class PatchAssessmentReqModel { PatchAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/core/model/SOAP/PostEpisodeReqModel.dart similarity index 89% rename from lib/models/SOAP/PostEpisodeReqModel.dart rename to lib/core/model/SOAP/PostEpisodeReqModel.dart index 6d3ee45a..bfc4e4bc 100644 --- a/lib/models/SOAP/PostEpisodeReqModel.dart +++ b/lib/core/model/SOAP/PostEpisodeReqModel.dart @@ -6,9 +6,9 @@ class PostEpisodeReqModel { PostEpisodeReqModel( {this.appointmentNo, - this.patientMRN, - this.doctorID, - this.vidaAuthTokenID}); + this.patientMRN, + this.doctorID, + this.vidaAuthTokenID}); PostEpisodeReqModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/core/model/SOAP/get_Allergies_request_model.dart similarity index 88% rename from lib/models/SOAP/get_Allergies_request_model.dart rename to lib/core/model/SOAP/get_Allergies_request_model.dart index 7676d530..2220f243 100644 --- a/lib/models/SOAP/get_Allergies_request_model.dart +++ b/lib/core/model/SOAP/get_Allergies_request_model.dart @@ -7,10 +7,10 @@ class GetAllergiesRequestModel { GetAllergiesRequestModel( {this.vidaAuthTokenID, - this.patientMRN, - this.appointmentNo, - this.episodeId, - this.doctorID}); + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID}); GetAllergiesRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart similarity index 100% rename from lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart rename to lib/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart diff --git a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart b/lib/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart similarity index 100% rename from lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart rename to lib/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart diff --git a/lib/models/SOAP/master_key_model.dart b/lib/core/model/SOAP/master_key_model.dart similarity index 82% rename from lib/models/SOAP/master_key_model.dart rename to lib/core/model/SOAP/master_key_model.dart index a1c32039..070eab08 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/core/model/SOAP/master_key_model.dart @@ -18,21 +18,21 @@ class MasterKeyModel { MasterKeyModel( {this.alias, - this.aliasN, - this.code, - this.description, - this.detail1, - this.detail2, - this.detail3, - this.detail4, - this.detail5, - this.groupID, - this.id, - this.nameAr, - this.nameEn, - this.remarks, - this.typeId, - this.valueList}); + this.aliasN, + this.code, + this.description, + this.detail1, + this.detail2, + this.detail3, + this.detail4, + this.detail5, + this.groupID, + this.id, + this.nameAr, + this.nameEn, + this.remarks, + this.typeId, + this.valueList}); MasterKeyModel.fromJson(Map json) { alias = json['alias']; diff --git a/lib/models/SOAP/order-procedure.dart b/lib/core/model/SOAP/order-procedure.dart similarity index 81% rename from lib/models/SOAP/order-procedure.dart rename to lib/core/model/SOAP/order-procedure.dart index 4e134a07..b49305ef 100644 --- a/lib/models/SOAP/order-procedure.dart +++ b/lib/core/model/SOAP/order-procedure.dart @@ -1,5 +1,4 @@ class OrderProcedure { - String achiCode; String appointmentDate; int appointmentNo; @@ -27,29 +26,29 @@ class OrderProcedure { OrderProcedure( {this.achiCode, - this.appointmentDate, - this.appointmentNo, - this.categoryID, - this.clinicDescription, - this.cptCode, - this.createdBy, - this.createdOn, - this.doctorName, - this.isApprovalCreated, - this.isApprovalRequired, - this.isCovered, - this.isInvoiced, - this.isReferralInvoiced, - this.isUncoveredByDoctor, - this.lineItemNo, - this.orderDate, - this.orderNo, - this.orderType, - this.procedureId, - this.procedureName, - this.remarks, - this.status, - this.template}); + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); OrderProcedure.fromJson(Map json) { achiCode = json['achiCode']; @@ -106,5 +105,4 @@ class OrderProcedure { data['template'] = this.template; return data; } - -} \ No newline at end of file +} diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/core/model/SOAP/post_allergy_request_model.dart similarity index 86% rename from lib/models/SOAP/post_allergy_request_model.dart rename to lib/core/model/SOAP/post_allergy_request_model.dart index 6783d885..a179da06 100644 --- a/lib/models/SOAP/post_allergy_request_model.dart +++ b/lib/core/model/SOAP/post_allergy_request_model.dart @@ -1,13 +1,13 @@ class PostAllergyRequestModel { List - listHisProgNotePatientAllergyDiseaseVM; + listHisProgNotePatientAllergyDiseaseVM; PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); PostAllergyRequestModel.fromJson(Map json) { if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { listHisProgNotePatientAllergyDiseaseVM = - new List(); + new List(); json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { listHisProgNotePatientAllergyDiseaseVM .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); @@ -44,18 +44,18 @@ class ListHisProgNotePatientAllergyDiseaseVM { ListHisProgNotePatientAllergyDiseaseVM( {this.patientMRN, - this.allergyDiseaseType, - this.allergyDiseaseId, - this.episodeId, - this.appointmentNo, - this.severity, - this.isChecked, - this.isUpdatedByNurse, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.allergyDiseaseType, + this.allergyDiseaseId, + this.episodeId, + this.appointmentNo, + this.severity, + this.isChecked, + this.isUpdatedByNurse, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/core/model/SOAP/post_assessment_request_model.dart similarity index 90% rename from lib/models/SOAP/post_assessment_request_model.dart rename to lib/core/model/SOAP/post_assessment_request_model.dart index af577671..5cda0524 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/core/model/SOAP/post_assessment_request_model.dart @@ -6,9 +6,9 @@ class PostAssessmentRequestModel { PostAssessmentRequestModel( {this.patientMRN, - this.appointmentNo, - this.episodeId, - this.icdCodeDetails}); + this.appointmentNo, + this.episodeId, + this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -44,10 +44,10 @@ class IcdCodeDetails { IcdCodeDetails( {this.icdcode10Id, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); IcdCodeDetails.fromJson(Map json) { icdcode10Id = json['icdcode10Id']; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/core/model/SOAP/post_chief_complaint_request_model.dart similarity index 100% rename from lib/models/SOAP/post_chief_complaint_request_model.dart rename to lib/core/model/SOAP/post_chief_complaint_request_model.dart diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/core/model/SOAP/post_histories_request_model.dart similarity index 92% rename from lib/models/SOAP/post_histories_request_model.dart rename to lib/core/model/SOAP/post_histories_request_model.dart index d8be3fb2..7d15974c 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/core/model/SOAP/post_histories_request_model.dart @@ -36,12 +36,12 @@ class ListMedicalHistoryVM { ListMedicalHistoryVM( {this.patientMRN, - this.historyType, - this.historyId, - this.episodeId, - this.appointmentNo, - this.isChecked, - this.remarks}); + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); ListMedicalHistoryVM.fromJson(Map json) { patientMRN = json['patientMRN']; diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/core/model/SOAP/post_physical_exam_request_model.dart similarity index 100% rename from lib/models/SOAP/post_physical_exam_request_model.dart rename to lib/core/model/SOAP/post_physical_exam_request_model.dart diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/core/model/SOAP/post_progress_note_request_model.dart similarity index 100% rename from lib/models/SOAP/post_progress_note_request_model.dart rename to lib/core/model/SOAP/post_progress_note_request_model.dart diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/core/model/SOAP/selected_items/my_selected_allergy.dart similarity index 86% rename from lib/models/SOAP/selected_items/my_selected_allergy.dart rename to lib/core/model/SOAP/selected_items/my_selected_allergy.dart index 512a4f64..86fad1ec 100644 --- a/lib/models/SOAP/selected_items/my_selected_allergy.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_allergy.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedAllergy { MasterKeyModel selectedAllergySeverity; @@ -19,5 +19,4 @@ class MySelectedAllergy { this.isLocal = true, this.createdBy, this.hasValidationError = false}); - } diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/core/model/SOAP/selected_items/my_selected_assement.dart similarity index 63% rename from lib/models/SOAP/selected_items/my_selected_assement.dart rename to lib/core/model/SOAP/selected_items/my_selected_assement.dart index 01572e6d..ab4c9965 100644 --- a/lib/models/SOAP/selected_items/my_selected_assement.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_assement.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedAssessment { MasterKeyModel selectedICD; @@ -16,9 +16,11 @@ class MySelectedAssessment { {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, this.appointmentId, this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); + this.remark, + this.appointmentId, + this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); } diff --git a/lib/models/SOAP/selected_items/my_selected_examination.dart b/lib/core/model/SOAP/selected_items/my_selected_examination.dart similarity index 87% rename from lib/models/SOAP/selected_items/my_selected_examination.dart rename to lib/core/model/SOAP/selected_items/my_selected_examination.dart index 75f67ae2..1e8a128f 100644 --- a/lib/models/SOAP/selected_items/my_selected_examination.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_examination.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedExamination { MasterKeyModel selectedExamination; diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/core/model/SOAP/selected_items/my_selected_history.dart similarity index 74% rename from lib/models/SOAP/selected_items/my_selected_history.dart rename to lib/core/model/SOAP/selected_items/my_selected_history.dart index 3769c418..2aa0b3e3 100644 --- a/lib/models/SOAP/selected_items/my_selected_history.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_history.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedHistory { MasterKeyModel selectedHistory; diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart index 05d34645..3905e67b 100644 --- a/lib/core/model/admissionRequest/clinic-model.dart +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -7,10 +7,10 @@ class Clinic { Clinic( {this.clinicGroupID, - this.clinicGroupName, - this.clinicID, - this.clinicNameArabic, - this.clinicNameEnglish}); + this.clinicGroupName, + this.clinicID, + this.clinicNameArabic, + this.clinicNameEnglish}); Clinic.fromJson(Map json) { clinicGroupID = json['clinicGroupID']; @@ -29,5 +29,4 @@ class Clinic { data['clinicNameEnglish'] = this.clinicNameEnglish; return data; } - -} \ No newline at end of file +} diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart index 606758d3..98479fca 100644 --- a/lib/core/model/admissionRequest/ward-model.dart +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -1,12 +1,10 @@ -class WardModel{ - +class WardModel { String description; String descriptionN; int floorID; bool isActive; - WardModel( - {this.description, this.descriptionN, this.floorID, this.isActive}); + WardModel({this.description, this.descriptionN, this.floorID, this.isActive}); WardModel.fromJson(Map json) { description = json['description']; @@ -23,4 +21,4 @@ class WardModel{ data['isActive'] = this.isActive; return data; } -} \ No newline at end of file +} diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/core/model/admisson_orders/admission_orders_model.dart similarity index 100% rename from lib/models/admisson_orders/admission_orders_model.dart rename to lib/core/model/admisson_orders/admission_orders_model.dart diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/core/model/admisson_orders/admission_orders_request_model.dart similarity index 100% rename from lib/models/admisson_orders/admission_orders_request_model.dart rename to lib/core/model/admisson_orders/admission_orders_request_model.dart diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 85d7f1d3..f6094b9d 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -15,7 +15,8 @@ class ActivationCodeModel { this.memberID, this.facilityId, this.otpSendType, - this.generalid,this.loginDoctorID}); + this.generalid, + this.loginDoctorID}); ActivationCodeModel.fromJson(Map json) { channel = json['Channel']; diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index dae31f8c..631ac0ca 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -13,6 +13,7 @@ class ActivationCodeForVerificationScreenModel { String vidaAuthTokenID; String vidaRefreshTokenID; String iMEI; + ActivationCodeForVerificationScreenModel( {this.oTPSendType, this.mobileNumber, @@ -26,7 +27,8 @@ class ActivationCodeForVerificationScreenModel { this.isMobileFingerPrint, this.vidaAuthTokenID, this.vidaRefreshTokenID, - this.iMEI,this.loginDoctorID}); + this.iMEI, + this.loginDoctorID}); ActivationCodeForVerificationScreenModel.fromJson(Map json) { oTPSendType = json['OTP_SendType']; diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index e39518e6..6fb7eb70 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { String authenticationTokenID; diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index 94502a71..c8040671 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -19,6 +19,7 @@ class CheckActivationCodeRequestModel { String iMEI; bool isForSilentLogin; int oTPSendType; + CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, @@ -33,7 +34,13 @@ class CheckActivationCodeRequestModel { this.activationCode, this.vidaAuthTokenID, this.vidaRefreshTokenID, - this.oTPSendType,this.password,this.facilityId,this.memberID,this.isForSilentLogin=false,this.iMEI,this.loginDoctorID}); + this.oTPSendType, + this.password, + this.facilityId, + this.memberID, + this.isForSilentLogin = false, + this.iMEI, + this.loginDoctorID}); CheckActivationCodeRequestModel.fromJson(Map json) { mobileNumber = json['MobileNumber']; diff --git a/lib/core/model/auth/imei_details.dart b/lib/core/model/auth/imei_details.dart index eb37e736..21416074 100644 --- a/lib/core/model/auth/imei_details.dart +++ b/lib/core/model/auth/imei_details.dart @@ -28,6 +28,7 @@ class GetIMEIDetailsModel { String vidaAuthTokenID; String vidaRefreshTokenID; String password; + GetIMEIDetailsModel( {this.iD, this.iMEI, diff --git a/lib/core/model/auth/insert_imei_model.dart b/lib/core/model/auth/insert_imei_model.dart index 25e22b7a..e779da77 100644 --- a/lib/core/model/auth/insert_imei_model.dart +++ b/lib/core/model/auth/insert_imei_model.dart @@ -32,6 +32,7 @@ class InsertIMEIDetailsModel { String vidaAuthTokenID; String vidaRefreshTokenID; dynamic password; + InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, diff --git a/lib/core/model/auth/new_login_information_response_model.dart b/lib/core/model/auth/new_login_information_response_model.dart index 117060e4..36aa33eb 100644 --- a/lib/core/model/auth/new_login_information_response_model.dart +++ b/lib/core/model/auth/new_login_information_response_model.dart @@ -11,14 +11,14 @@ class NewLoginInformationModel { NewLoginInformationModel( {this.doctorID, - this.listMemberInformation, - this.logInTokenID, - this.mobileNumber, - this.sELECTDeviceIMEIbyIMEIList, - this.userID, - this.zipCode, - this.isActiveCode, - this.isSMSSent}); + this.listMemberInformation, + this.logInTokenID, + this.mobileNumber, + this.sELECTDeviceIMEIbyIMEIList, + this.userID, + this.zipCode, + this.isActiveCode, + this.isSMSSent}); NewLoginInformationModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -70,16 +70,16 @@ class ListMemberInformation { ListMemberInformation( {this.setupID, - this.memberID, - this.memberName, - this.memberNameN, - this.preferredLang, - this.pIN, - this.saltHash, - this.referenceID, - this.employeeID, - this.roleID, - this.projectid}); + this.memberID, + this.memberName, + this.memberNameN, + this.preferredLang, + this.pIN, + this.saltHash, + this.referenceID, + this.employeeID, + this.roleID, + this.projectid}); ListMemberInformation.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart index ceaf4c65..099ac738 100644 --- a/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/send_activation_code_for_doctor_app_response_model.dart @@ -6,9 +6,9 @@ class SendActivationCodeForDoctorAppResponseModel { SendActivationCodeForDoctorAppResponseModel( {this.logInTokenID, - this.verificationCode, - this.vidaAuthTokenID, - this.vidaRefreshTokenID}); + this.verificationCode, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); SendActivationCodeForDoctorAppResponseModel.fromJson( Map json) { diff --git a/lib/models/chart_axis_model.dart b/lib/core/model/chart_axis_model.dart similarity index 100% rename from lib/models/chart_axis_model.dart rename to lib/core/model/chart_axis_model.dart diff --git a/lib/models/countriesModel.dart b/lib/core/model/countriesModel.dart similarity index 100% rename from lib/models/countriesModel.dart rename to lib/core/model/countriesModel.dart diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/core/model/dashboard/dashboard_model.dart similarity index 100% rename from lib/models/dashboard/dashboard_model.dart rename to lib/core/model/dashboard/dashboard_model.dart diff --git a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart b/lib/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart similarity index 88% rename from lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart rename to lib/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart index ec19abb0..4048a402 100644 --- a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart +++ b/lib/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart @@ -7,10 +7,10 @@ class GetSpecialClinicalCareListResponseModel { GetSpecialClinicalCareListResponseModel( {this.projectID, - this.clinicID, - this.clinicDescription, - this.clinicDescriptionN, - this.isActive}); + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.isActive}); GetSpecialClinicalCareListResponseModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart b/lib/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart similarity index 88% rename from lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart rename to lib/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart index 287f40f1..2a5e3565 100644 --- a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart +++ b/lib/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart @@ -8,11 +8,11 @@ class GetSpecialClinicalCareMappingListResponseModel { GetSpecialClinicalCareMappingListResponseModel( {this.mappingProjectID, - this.clinicID, - this.nursingStationID, - this.isActive, - this.projectID, - this.description}); + this.clinicID, + this.nursingStationID, + this.isActive, + this.projectID, + this.description}); GetSpecialClinicalCareMappingListResponseModel.fromJson( Map json) { diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart index 7fad3106..7d42014a 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart @@ -10,13 +10,13 @@ class GetDiabeticChartValuesRequestModel { GetDiabeticChartValuesRequestModel( {this.deviceTypeID, - this.patientID, - this.resultType, - this.admissionNo, - this.setupID, - this.patientOutSA, - this.patientType, - this.patientTypeID}); + this.patientID, + this.resultType, + this.admissionNo, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); GetDiabeticChartValuesRequestModel.fromJson(Map json) { deviceTypeID = json['DeviceTypeID']; diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart index fa2c1ca2..4696f6be 100644 --- a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -8,11 +8,11 @@ class GetDiabeticChartValuesResponseModel { GetDiabeticChartValuesResponseModel( {this.resultType, - this.admissionNo, - this.dateChart, - this.resultValue, - this.createdBy, - this.createdOn}); + this.admissionNo, + this.dateChart, + this.resultValue, + this.createdBy, + this.createdOn}); GetDiabeticChartValuesResponseModel.fromJson(Map json) { resultType = json['ResultType']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart index 310cfb50..cb588e1a 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -7,10 +7,10 @@ class GetDiagnosisForInPatientRequestModel { GetDiagnosisForInPatientRequestModel( {this.patientID, - this.admissionNo, - this.setupID, - this.patientType, - this.patientTypeID}); + this.admissionNo, + this.setupID, + this.patientType, + this.patientTypeID}); GetDiagnosisForInPatientRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index 1ec48964..d35d1022 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -13,14 +13,15 @@ class GetDiagnosisForInPatientResponseModel { GetDiagnosisForInPatientResponseModel( {this.iCDCode10ID, - this.diagnosisTypeID, - this.conditionID, - this.complexDiagnosis, - this.asciiDesc, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, this.createdByName}); + this.diagnosisTypeID, + this.conditionID, + this.complexDiagnosis, + this.asciiDesc, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.createdByName}); GetDiagnosisForInPatientResponseModel.fromJson(Map json) { iCDCode10ID = json['ICDCode10ID']; diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart similarity index 87% rename from lib/models/discharge_summary/GetDischargeSummaryReqModel.dart rename to lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart index 2d2c14ad..3bc5f931 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart @@ -5,7 +5,10 @@ class GetDischargeSummaryReqModel { int patientTypeID; GetDischargeSummaryReqModel( - {this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1}); + {this.patientID, + this.admissionNo, + this.patientType = 1, + this.patientTypeID = 1}); GetDischargeSummaryReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/core/model/discharge_summary/GetDischargeSummaryResModel.dart similarity index 100% rename from lib/models/discharge_summary/GetDischargeSummaryResModel.dart rename to lib/core/model/discharge_summary/GetDischargeSummaryResModel.dart diff --git a/lib/models/doctor/clinic_model.dart b/lib/core/model/doctor/clinic_model.dart similarity index 100% rename from lib/models/doctor/clinic_model.dart rename to lib/core/model/doctor/clinic_model.dart diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/core/model/doctor/doctor_profile_model.dart similarity index 100% rename from lib/models/doctor/doctor_profile_model.dart rename to lib/core/model/doctor/doctor_profile_model.dart diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/core/model/doctor/list_doctor_working_hours_table_model.dart similarity index 100% rename from lib/models/doctor/list_doctor_working_hours_table_model.dart rename to lib/core/model/doctor/list_doctor_working_hours_table_model.dart index 4712d285..ebb63574 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/core/model/doctor/list_doctor_working_hours_table_model.dart @@ -7,7 +7,6 @@ class ListDoctorWorkingHoursTable { String projectName; String clinicName; - ListDoctorWorkingHoursTable({ this.date, this.dayName, @@ -37,5 +36,6 @@ class ListDoctorWorkingHoursTable { class WorkingHours { String from; String to; + WorkingHours({this.from, this.to}); } diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/core/model/doctor/list_gt_my_patients_question_model.dart similarity index 81% rename from lib/models/doctor/list_gt_my_patients_question_model.dart rename to lib/core/model/doctor/list_gt_my_patients_question_model.dart index 656a43dd..9b80518d 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/core/model/doctor/list_gt_my_patients_question_model.dart @@ -35,38 +35,38 @@ class ListGtMyPatientsQuestions { ListGtMyPatientsQuestions( {this.rowID, - this.setupID, - this.projectID, - this.transactionNo, - this.patientType, - this.patientID, - this.doctorID, - this.requestType, - this.requestDate, - this.requestTime, - this.remarks, - this.status, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.patientName, - this.patientNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.infoStatus, - this.infoDesc, - this.doctorResponse, - this.responseDate, - this.memberID, - this.memberName, - this.memberNameN, - this.age, - this.genderDescription, - this.isVidaCall, - this.requestTypeDescription}); + this.setupID, + this.projectID, + this.transactionNo, + this.patientType, + this.patientID, + this.doctorID, + this.requestType, + this.requestDate, + this.requestTime, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.infoStatus, + this.infoDesc, + this.doctorResponse, + this.responseDate, + this.memberID, + this.memberName, + this.memberNameN, + this.age, + this.genderDescription, + this.isVidaCall, + this.requestTypeDescription}); ListGtMyPatientsQuestions.fromJson(Map json) { rowID = json['RowID']; diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/core/model/doctor/profile_req_Model.dart similarity index 100% rename from lib/models/doctor/profile_req_Model.dart rename to lib/core/model/doctor/profile_req_Model.dart diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/core/model/doctor/replay/request_create_doctor_response.dart similarity index 84% rename from lib/models/doctor/replay/request_create_doctor_response.dart rename to lib/core/model/doctor/replay/request_create_doctor_response.dart index 49e421d9..c169eeec 100644 --- a/lib/models/doctor/replay/request_create_doctor_response.dart +++ b/lib/core/model/doctor/replay/request_create_doctor_response.dart @@ -11,14 +11,14 @@ class CreateDoctorResponseModel { CreateDoctorResponseModel( {this.setupID, - this.projectID, - this.transactionNo, - this.infoEnteredBy, - this.infoStatus, - this.createdBy, - this.editedBy, - this.doctorResponse, - this.doctorID}); + this.projectID, + this.transactionNo, + this.infoEnteredBy, + this.infoStatus, + this.createdBy, + this.editedBy, + this.doctorResponse, + this.doctorID}); CreateDoctorResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/doctor/replay/request_doctor_reply.dart b/lib/core/model/doctor/replay/request_doctor_reply.dart similarity index 96% rename from lib/models/doctor/replay/request_doctor_reply.dart rename to lib/core/model/doctor/replay/request_doctor_reply.dart index 82384586..15d1f37d 100644 --- a/lib/models/doctor/replay/request_doctor_reply.dart +++ b/lib/core/model/doctor/replay/request_doctor_reply.dart @@ -68,8 +68,7 @@ class RequestDoctorReply { data['PatientOutSA'] = this.patientOutSA; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; - if(this.infoStatus != null) - data['InfoStatus'] = this.infoStatus; + if (this.infoStatus != null) data['InfoStatus'] = this.infoStatus; return data; } } diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/core/model/doctor/request_add_referred_doctor_remarks.dart similarity index 79% rename from lib/models/doctor/request_add_referred_doctor_remarks.dart rename to lib/core/model/doctor/request_add_referred_doctor_remarks.dart index b396c47f..f74b3dca 100644 --- a/lib/models/doctor/request_add_referred_doctor_remarks.dart +++ b/lib/core/model/doctor/request_add_referred_doctor_remarks.dart @@ -17,25 +17,24 @@ class RequestAddReferredDoctorRemarks { String sessionID; bool isLoginForDoctorApp; bool patientOutSA; - RequestAddReferredDoctorRemarks( {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA}); + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA}); RequestAddReferredDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/doctor/request_schedule.dart b/lib/core/model/doctor/request_schedule.dart similarity index 99% rename from lib/models/doctor/request_schedule.dart rename to lib/core/model/doctor/request_schedule.dart index ae7b80aa..9c5b0fe9 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/core/model/doctor/request_schedule.dart @@ -1,5 +1,3 @@ - - class RequestSchedule { int projectID; int clinicID; diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/core/model/doctor/statstics_for_certain_doctor_request.dart similarity index 100% rename from lib/models/doctor/statstics_for_certain_doctor_request.dart rename to lib/core/model/doctor/statstics_for_certain_doctor_request.dart diff --git a/lib/models/doctor/user_model.dart b/lib/core/model/doctor/user_model.dart similarity index 100% rename from lib/models/doctor/user_model.dart rename to lib/core/model/doctor/user_model.dart diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/core/model/doctor/verify_referral_doctor_remarks.dart similarity index 70% rename from lib/models/doctor/verify_referral_doctor_remarks.dart rename to lib/core/model/doctor/verify_referral_doctor_remarks.dart index b9bfce0a..57cfa743 100644 --- a/lib/models/doctor/verify_referral_doctor_remarks.dart +++ b/lib/core/model/doctor/verify_referral_doctor_remarks.dart @@ -17,36 +17,36 @@ class VerifyReferralDoctorRemarks { String sessionID; bool isLoginForDoctorApp; bool patientOutSA; - String firstName; + String firstName; String middleName; String lastName; String patientMobileNumber; String patientIdentificationID; - VerifyReferralDoctorRemarks( - {this.projectID, - this.admissionNo, - this.lineItemNo, - this.referredDoctorRemarks, - this.editedBy, - this.patientID, - this.referringDoctor, - this.languageID = LANGUAGE_ID, - this.stamp = STAMP, - this.iPAdress = IP_ADDRESS, - this.versionID = VERSION_ID, - this.channel= CHANNEL, - this.tokenID, - this.sessionID = SESSION_ID, - this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, - this.patientOutSA = PATIENT_OUT_SA, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - }); + VerifyReferralDoctorRemarks({ + this.projectID, + this.admissionNo, + this.lineItemNo, + this.referredDoctorRemarks, + this.editedBy, + this.patientID, + this.referringDoctor, + this.languageID = LANGUAGE_ID, + this.stamp = STAMP, + this.iPAdress = IP_ADDRESS, + this.versionID = VERSION_ID, + this.channel = CHANNEL, + this.tokenID, + this.sessionID = SESSION_ID, + this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, + this.patientOutSA = PATIENT_OUT_SA, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + }); VerifyReferralDoctorRemarks.fromJson(Map json) { projectID = json['ProjectID']; @@ -65,14 +65,11 @@ class VerifyReferralDoctorRemarks { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; - firstName= json["FirstName"]; - middleName= json["MiddleName"]; - lastName= json["LastName"]; - patientMobileNumber= json["PatientMobileNumber"]; - patientIdentificationID = json["PatientIdentificationID"]; - - - + firstName = json["FirstName"]; + middleName = json["MiddleName"]; + lastName = json["LastName"]; + patientMobileNumber = json["PatientMobileNumber"]; + patientIdentificationID = json["PatientIdentificationID"]; } Map toJson() { diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 8a5f1bc1..b858bba4 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -11,14 +11,14 @@ class GetHospitalsRequestModel { GetHospitalsRequestModel( {this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.memberID}); + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.memberID}); GetHospitalsRequestModel.fromJson(Map json) { languageID = json['LanguageID']; diff --git a/lib/core/model/hospitals_model.dart b/lib/core/model/hospitals_model.dart index b09807d6..3e9690ba 100644 --- a/lib/core/model/hospitals_model.dart +++ b/lib/core/model/hospitals_model.dart @@ -16,22 +16,23 @@ class HospitalsModel { dynamic projectOutSA; bool usingInDoctorApp; - HospitalsModel({this.desciption, - this.desciptionN, - this.iD, - this.legalName, - this.legalNameN, - this.name, - this.nameN, - this.phoneNumber, - this.setupID, - this.distanceInKilometers, - this.isActive, - this.latitude, - this.longitude, - this.mainProjectID, - this.projectOutSA, - this.usingInDoctorApp}); + HospitalsModel( + {this.desciption, + this.desciptionN, + this.iD, + this.legalName, + this.legalNameN, + this.name, + this.nameN, + this.phoneNumber, + this.setupID, + this.distanceInKilometers, + this.isActive, + this.latitude, + this.longitude, + this.mainProjectID, + this.projectOutSA, + this.usingInDoctorApp}); HospitalsModel.fromJson(Map json) { desciption = json['Desciption']; diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index a3717c42..3320e69b 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -2,6 +2,7 @@ class ApporvalDetails { int approvalNo; String procedureName; + //String procedureNameN; String status; diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart index ecb4ae65..22bcb801 100644 --- a/lib/core/model/labs/LabOrderResult.dart +++ b/lib/core/model/labs/LabOrderResult.dart @@ -21,24 +21,24 @@ class LabOrderResult { LabOrderResult( {this.description, - this.femaleInterpretativeData, - this.gender, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabOrderResult.fromJson(Map json) { description = json['Description']; diff --git a/lib/core/model/labs/LabResultHistory.dart b/lib/core/model/labs/LabResultHistory.dart index 7c4221ca..fed140f8 100644 --- a/lib/core/model/labs/LabResultHistory.dart +++ b/lib/core/model/labs/LabResultHistory.dart @@ -26,29 +26,29 @@ class LabResultHistory { LabResultHistory( {this.description, - this.femaleInterpretativeData, - this.gender, - this.isCertificateAllowed, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.orderLineItemNo, - this.orderNo, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.resultValueBasedLineItemNo, - this.resultValueFlag, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.isCertificateAllowed, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.orderLineItemNo, + this.orderNo, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.resultValueBasedLineItemNo, + this.resultValueFlag, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResultHistory.fromJson(Map json) { description = json['Description']; @@ -105,4 +105,4 @@ class LabResultHistory { data['VerifiedOnDateTime'] = this.verifiedOnDateTime; return data; } -} \ No newline at end of file +} diff --git a/lib/core/model/labs/all_special_lab_result_model.dart b/lib/core/model/labs/all_special_lab_result_model.dart index ffdc5ee5..b1a9cd4b 100644 --- a/lib/core/model/labs/all_special_lab_result_model.dart +++ b/lib/core/model/labs/all_special_lab_result_model.dart @@ -46,6 +46,7 @@ class AllSpecialLabResultModel { String resultDataHTML; dynamic resultDataTxt; String setupID; + //List speciality; dynamic status; dynamic statusDesc; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index ee9f981d..046ab169 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -110,10 +110,9 @@ class LabResult { } else { return 0; } - }catch (e){ + } catch (e) { return 0; } - } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index af60f86f..0aa732a5 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -26,6 +26,7 @@ class PatientLabOrders { String nationalityFlagURL; int noOfPatientsRate; DateTime orderDate; + DateTime createdOn; String orderNo; String patientID; String projectID; @@ -35,6 +36,7 @@ class PatientLabOrders { String setupID; List speciality; bool isLiveCareAppointment; + PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -68,11 +70,12 @@ class PatientLabOrders { this.projectNameN, this.qR, this.setupID, - this.speciality,this.isLiveCareAppointment}); + this.speciality, + this.isLiveCareAppointment}); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']?? json['ClinicName']; + clinicDescription = json['ClinicDescription'] ?? json['ClinicName']; clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; clinicDescriptionN = json['ClinicDescriptionN']; clinicID = json['ClinicID']; @@ -96,6 +99,7 @@ class PatientLabOrders { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); + createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']); orderNo = json['OrderNo'].toString(); patientID = json['PatientID'].toString(); projectID = json['ProjectID'].toString(); @@ -104,7 +108,7 @@ class PatientLabOrders { qR = json['QR']; setupID = json['SetupID']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } Map toJson() { diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart index 2fbcb832..dc53010b 100644 --- a/lib/core/model/labs/patient_lab_special_result.dart +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -7,10 +7,10 @@ class PatientLabSpecialResult { PatientLabSpecialResult( {this.invoiceNo, - this.moduleID, - this.resultData, - this.resultDataHTML, - this.resultDataTxt}); + this.moduleID, + this.resultData, + this.resultDataHTML, + this.resultDataTxt}); PatientLabSpecialResult.fromJson(Map json) { invoiceNo = json['InvoiceNo']; diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart index ce9263ef..3ee099a5 100644 --- a/lib/core/model/labs/request_patient_lab_orders.dart +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -15,18 +15,18 @@ class RequestPatientLabOrders { RequestPatientLabOrders( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); RequestPatientLabOrders.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b48cf0e1..1a149bcd 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -20,23 +20,23 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult( {this.invoiceNo, - this.orderNo, - this.setupID, - this.projectID, - this.clinicID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType}); + this.orderNo, + this.setupID, + this.projectID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); RequestPatientLabSpecialResult.fromJson(Map json) { invoiceNo = json['InvoiceNo']; diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..dd8769bb 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -27,30 +27,30 @@ class RequestSendLabReportEmail { RequestSendLabReportEmail( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/model/live_care/AlternativeServicesList.dart b/lib/core/model/live_care/AlternativeServicesList.dart index 11f27b95..fc511da3 100644 --- a/lib/core/model/live_care/AlternativeServicesList.dart +++ b/lib/core/model/live_care/AlternativeServicesList.dart @@ -25,7 +25,7 @@ class AlternativeService { class AlternativeServicesList with ChangeNotifier { List _alternativeServicesList; - getServicesList(){ + getServicesList() { return _alternativeServicesList; } @@ -35,7 +35,9 @@ class AlternativeServicesList with ChangeNotifier { } setSelected(AlternativeService service, bool isSelected) { - List alternativeService = _alternativeServicesList.where((element) => service.serviceID == element.serviceID).toList(); + List alternativeService = _alternativeServicesList + .where((element) => service.serviceID == element.serviceID) + .toList(); alternativeService[0].isSelected = isSelected; notifyListeners(); diff --git a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart index 1d63e885..809af1b4 100644 --- a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart +++ b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart @@ -5,7 +5,8 @@ class AddPatientToDoctorListRequestModel { int doctorId; bool isOutKsa; - AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); + AddPatientToDoctorListRequestModel( + {this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); AddPatientToDoctorListRequestModel.fromJson(Map json) { vCID = json['VC_ID']; diff --git a/lib/core/model/live_care/live_care_login_reguest_model.dart b/lib/core/model/live_care/live_care_login_reguest_model.dart index e14d4223..b1218420 100644 --- a/lib/core/model/live_care/live_care_login_reguest_model.dart +++ b/lib/core/model/live_care/live_care_login_reguest_model.dart @@ -5,7 +5,12 @@ class LiveCareUserLoginRequestModel { int isOutKsa; int isLogin; - LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin}); + LiveCareUserLoginRequestModel( + {this.tokenID, + this.generalid, + this.doctorId, + this.isOutKsa, + this.isLogin}); LiveCareUserLoginRequestModel.fromJson(Map json) { tokenID = json['TokenID']; diff --git a/lib/models/livecare/end_call_req.dart b/lib/core/model/livecare/end_call_req.dart similarity index 100% rename from lib/models/livecare/end_call_req.dart rename to lib/core/model/livecare/end_call_req.dart diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/core/model/livecare/get_panding_req_list.dart similarity index 100% rename from lib/models/livecare/get_panding_req_list.dart rename to lib/core/model/livecare/get_panding_req_list.dart diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/core/model/livecare/get_pending_res_list.dart similarity index 100% rename from lib/models/livecare/get_pending_res_list.dart rename to lib/core/model/livecare/get_pending_res_list.dart diff --git a/lib/models/livecare/session_status_model.dart b/lib/core/model/livecare/session_status_model.dart similarity index 89% rename from lib/models/livecare/session_status_model.dart rename to lib/core/model/livecare/session_status_model.dart index 7e7a3e43..29f925d7 100644 --- a/lib/models/livecare/session_status_model.dart +++ b/lib/core/model/livecare/session_status_model.dart @@ -6,9 +6,9 @@ class SessionStatusModel { SessionStatusModel( {this.isAuthenticated, - this.messageStatus, - this.result, - this.sessionStatus}); + this.messageStatus, + this.result, + this.sessionStatus}); SessionStatusModel.fromJson(Map json) { isAuthenticated = json['IsAuthenticated']; diff --git a/lib/models/livecare/start_call_req.dart b/lib/core/model/livecare/start_call_req.dart similarity index 84% rename from lib/models/livecare/start_call_req.dart rename to lib/core/model/livecare/start_call_req.dart index b3ceabb5..c298298d 100644 --- a/lib/models/livecare/start_call_req.dart +++ b/lib/core/model/livecare/start_call_req.dart @@ -13,16 +13,16 @@ class StartCallReq { StartCallReq( {this.clincName, - this.clinicId, - this.docSpec, - this.docotrName, - this.doctorId, - this.generalid, - this.isOutKsa, - this.isrecall, - this.projectName, - this.tokenID, - this.vCID}); + this.clinicId, + this.docSpec, + this.docotrName, + this.doctorId, + this.generalid, + this.isOutKsa, + this.isrecall, + this.projectName, + this.tokenID, + this.vCID}); StartCallReq.fromJson(Map json) { clincName = json['clincName']; @@ -53,4 +53,4 @@ class StartCallReq { data['VC_ID'] = this.vCID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/livecare/start_call_res.dart b/lib/core/model/livecare/start_call_res.dart similarity index 82% rename from lib/models/livecare/start_call_res.dart rename to lib/core/model/livecare/start_call_res.dart index 44921d5f..36127da9 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/core/model/livecare/start_call_res.dart @@ -7,15 +7,15 @@ class StartCallRes { String appointmentNo; bool isRecording; - StartCallRes( - {this.result, - this.openSessionID, - this.openTokenID, - this.isAuthenticated, - this.appointmentNo, - this.messageStatus, - this.isRecording = true, - }); + StartCallRes({ + this.result, + this.openSessionID, + this.openTokenID, + this.isAuthenticated, + this.appointmentNo, + this.messageStatus, + this.isRecording = true, + }); StartCallRes.fromJson(Map json) { result = json['Result']; diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/core/model/livecare/transfer_to_admin.dart similarity index 100% rename from lib/models/livecare/transfer_to_admin.dart rename to lib/core/model/livecare/transfer_to_admin.dart diff --git a/lib/core/model/medical_report/medical_file_request_model.dart b/lib/core/model/medical_report/medical_file_request_model.dart index 8703141a..b7fcb095 100644 --- a/lib/core/model/medical_report/medical_file_request_model.dart +++ b/lib/core/model/medical_report/medical_file_request_model.dart @@ -3,7 +3,8 @@ class MedicalFileRequestModel { String vidaAuthTokenID; String iPAdress; - MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID,this.iPAdress}); + MedicalFileRequestModel( + {this.patientMRN, this.vidaAuthTokenID, this.iPAdress}); MedicalFileRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index ce076705..20e27289 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -18,27 +18,29 @@ class CreateNoteModel { String sessionID; bool isLoginForDoctorApp; bool patientOutSA; + int conditionId; CreateNoteModel( {this.visitType, - this.admissionNo, - this.projectID, - this.patientTypeID, - this.patientID, - this.clinicID, - this.notes, - this.createdBy, - this.editedBy, - this.nursingRemarks, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.admissionNo, + this.projectID, + this.patientTypeID, + this.patientID, + this.clinicID, + this.notes, + this.createdBy, + this.editedBy, + this.nursingRemarks, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.conditionId}); CreateNoteModel.fromJson(Map json) { visitType = json['VisitType']; @@ -60,6 +62,7 @@ class CreateNoteModel { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; + conditionId = json['ConditionId']; } Map toJson() { @@ -83,6 +86,7 @@ class CreateNoteModel { data['SessionID'] = this.sessionID; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; + data['ConditionId'] = this.conditionId; return data; } } diff --git a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart index 4335053c..8cad6ea8 100644 --- a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -1,5 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; - class GetNursingProgressNoteRequestModel { int patientID; int admissionNo; @@ -8,7 +6,11 @@ class GetNursingProgressNoteRequestModel { String setupID; GetNursingProgressNoteRequestModel( - {this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID }); + {this.patientID, + this.admissionNo, + this.patientTypeID = 1, + this.patientType = 1, + this.setupID}); GetNursingProgressNoteRequestModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 797f9b6d..bef3a973 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -19,28 +19,33 @@ class NoteModel { Null doctorClinicName; String doctorName; String visitTypeDesc; + int condition; + String conditionDescription; NoteModel( {this.setupID, - this.projectID, - this.patientID, - this.patientType, - this.admissionNo, - this.lineItemNo, - this.visitType, - this.notes, - this.assessmentDate, - this.visitTime, - this.status, - this.nursingRemarks, - this.createdOn, - this.editedOn, - this.createdBy, - this.admissionClinicID, - this.admissionClinicName, - this.doctorClinicName, - this.doctorName, - this.visitTypeDesc}); + this.projectID, + this.patientID, + this.patientType, + this.admissionNo, + this.lineItemNo, + this.visitType, + this.notes, + this.assessmentDate, + this.visitTime, + this.status, + this.nursingRemarks, + this.createdOn, + this.editedOn, + this.createdBy, + this.admissionClinicID, + this.admissionClinicName, + this.doctorClinicName, + this.doctorName, + this.visitTypeDesc, + this.condition, + this.conditionDescription, + }); NoteModel.fromJson(Map json) { setupID = json['SetupID']; @@ -63,6 +68,8 @@ class NoteModel { doctorClinicName = json['DoctorClinicName']; doctorName = json['DoctorName']; visitTypeDesc = json['VisitTypeDesc']; + condition = json['Condition']; + conditionDescription = json['ConditionDescription']; } Map toJson() { @@ -87,6 +94,8 @@ class NoteModel { data['DoctorClinicName'] = this.doctorClinicName; data['DoctorName'] = this.doctorName; data['VisitTypeDesc'] = this.visitTypeDesc; + data['Condition'] = this.condition; + data['ConditionDescription'] = this.conditionDescription; return data; } } diff --git a/lib/core/model/note/stp_master_list_req_model.dart b/lib/core/model/note/stp_master_list_req_model.dart new file mode 100644 index 00000000..067a1623 --- /dev/null +++ b/lib/core/model/note/stp_master_list_req_model.dart @@ -0,0 +1,32 @@ +class StpMasterListRequestModel { + bool isDentalAllowedBackend; + int languageID; + int projectID; + int parameterGroup; + int parameterType; + + StpMasterListRequestModel( + {this.isDentalAllowedBackend, + this.languageID, + this.projectID, + this.parameterGroup, + this.parameterType}); + + StpMasterListRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + projectID = json['ProjectID']; + parameterGroup = json['parameterGroup']; + parameterType = json['parameterType']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['ProjectID'] = this.projectID; + data['parameterGroup'] = this.parameterGroup; + data['parameterType'] = this.parameterType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/note/stp_master_list_res_model.dart b/lib/core/model/note/stp_master_list_res_model.dart new file mode 100644 index 00000000..2533605a --- /dev/null +++ b/lib/core/model/note/stp_master_list_res_model.dart @@ -0,0 +1,22 @@ +class StpMasterListResponseModel { + int parameterCode; + String description; + Null descriptionN; + + StpMasterListResponseModel( + {this.parameterCode, this.description, this.descriptionN}); + + StpMasterListResponseModel.fromJson(Map json) { + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index 20fd4b86..faedb6f7 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -16,25 +16,27 @@ class UpdateNoteReqModel { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; + int conditionId; UpdateNoteReqModel( {this.projectID, - this.createdBy, - this.admissionNo, - this.lineItemNo, - this.notes, - this.verifiedNote, - this.cancelledNote, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.createdBy, + this.admissionNo, + this.lineItemNo, + this.notes, + this.verifiedNote, + this.cancelledNote, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID, + this.conditionId}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -54,6 +56,7 @@ class UpdateNoteReqModel { isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; patientTypeID = json['PatientTypeID']; + conditionId = json['ConditionId']; } Map toJson() { @@ -75,6 +78,7 @@ class UpdateNoteReqModel { data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; data['PatientTypeID'] = this.patientTypeID; + data['ConditionId'] = this.conditionId; return data; } } diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/core/model/operation_report/create_update_operation_report_request_model.dart similarity index 82% rename from lib/models/operation_report/create_update_operation_report_request_model.dart rename to lib/core/model/operation_report/create_update_operation_report_request_model.dart index f6d72b1b..1bc6d51e 100644 --- a/lib/models/operation_report/create_update_operation_report_request_model.dart +++ b/lib/core/model/operation_report/create_update_operation_report_request_model.dart @@ -26,29 +26,29 @@ class CreateUpdateOperationReportRequestModel { CreateUpdateOperationReportRequestModel( {this.setupID, - this.patientID, - this.reservationNo, - this.admissionNo, - this.preOpDiagmosis, - this.postOpDiagmosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.createdBy, - this.editedBy, - this.complicationDetails, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.patientID, + this.reservationNo, + this.admissionNo, + this.preOpDiagmosis, + this.postOpDiagmosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.createdBy, + this.editedBy, + this.complicationDetails, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); CreateUpdateOperationReportRequestModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/core/model/operation_report/get_operation_details_request_modle.dart similarity index 84% rename from lib/models/operation_report/get_operation_details_request_modle.dart rename to lib/core/model/operation_report/get_operation_details_request_modle.dart index 7e23b503..6c8e27fd 100644 --- a/lib/models/operation_report/get_operation_details_request_modle.dart +++ b/lib/core/model/operation_report/get_operation_details_request_modle.dart @@ -16,19 +16,19 @@ class GetOperationDetailsRequestModel { GetOperationDetailsRequestModel( {this.isDentalAllowedBackend = false, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.deviceTypeID, - this.tokenID, - this.patientID, - this.reservationNo, - this.sessionID, - this.projectID, - this.setupID, - this.patientOutSA}); + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.reservationNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA}); GetOperationDetailsRequestModel.fromJson(Map json) { isDentalAllowedBackend = json['isDentalAllowedBackend']; diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/core/model/operation_report/get_operation_details_response_modle.dart similarity index 81% rename from lib/models/operation_report/get_operation_details_response_modle.dart rename to lib/core/model/operation_report/get_operation_details_response_modle.dart index 04540ea6..f050eca3 100644 --- a/lib/models/operation_report/get_operation_details_response_modle.dart +++ b/lib/core/model/operation_report/get_operation_details_response_modle.dart @@ -36,39 +36,39 @@ class GetOperationDetailsResponseModel { GetOperationDetailsResponseModel( {this.setupID, - this.projectID, - this.reservationNo, - this.patientID, - this.admissionID, - this.surgeryDate, - this.preOpDiagnosis, - this.postOpDiagnosis, - this.surgeon, - this.assistant, - this.anasthetist, - this.operation, - this.inasion, - this.finding, - this.surgeryProcedure, - this.postOpInstruction, - this.isActive, - this.createdBy, - this.createdName, - this.createdNameN, - this.createdOn, - this.editedBy, - this.editedByName, - this.editedByNameN, - this.editedOn, - this.oRBookStatus, - this.complicationDetail, - this.bloodLossDetail, - this.histopathSpecimen, - this.microbiologySpecimen, - this.otherSpecimen, - this.scrubNurse, - this.circulatingNurse, - this.bloodTransfusedDetail}); + this.projectID, + this.reservationNo, + this.patientID, + this.admissionID, + this.surgeryDate, + this.preOpDiagnosis, + this.postOpDiagnosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.isActive, + this.createdBy, + this.createdName, + this.createdNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn, + this.oRBookStatus, + this.complicationDetail, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); GetOperationDetailsResponseModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/core/model/operation_report/get_reservations_request_model.dart similarity index 100% rename from lib/models/operation_report/get_reservations_request_model.dart rename to lib/core/model/operation_report/get_reservations_request_model.dart diff --git a/lib/models/operation_report/get_reservations_response_model.dart b/lib/core/model/operation_report/get_reservations_response_model.dart similarity index 100% rename from lib/models/operation_report/get_reservations_response_model.dart rename to lib/core/model/operation_report/get_reservations_response_model.dart diff --git a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart b/lib/core/model/patient/MedicalReport/MedicalReportTemplate.dart similarity index 83% rename from lib/models/patient/MedicalReport/MedicalReportTemplate.dart rename to lib/core/model/patient/MedicalReport/MedicalReportTemplate.dart index f00e84a0..f847c9d5 100644 --- a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart +++ b/lib/core/model/patient/MedicalReport/MedicalReportTemplate.dart @@ -14,17 +14,17 @@ class MedicalReportTemplate { MedicalReportTemplate( {this.setupID, - this.projectID, - this.templateID, - this.procedureID, - this.reportType, - this.templateName, - this.templateNameN, - this.templateText, - this.templateTextN, - this.isActive, - this.templateTextHtml, - this.templateTextNHtml}); + this.projectID, + this.templateID, + this.procedureID, + this.reportType, + this.templateName, + this.templateNameN, + this.templateText, + this.templateTextN, + this.isActive, + this.templateTextHtml, + this.templateTextNHtml}); MedicalReportTemplate.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart similarity index 81% rename from lib/models/patient/MedicalReport/MeidcalReportModel.dart rename to lib/core/model/patient/MedicalReport/MeidcalReportModel.dart index 74ee53a5..1fe7609b 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart @@ -28,31 +28,31 @@ class MedicalReportModel { MedicalReportModel( {this.reportData, - this.setupID, - this.projectID, - this.projectName, - this.projectNameN, - this.patientID, - this.invoiceNo, - this.status, - this.verifiedOn, - this.verifiedBy, - this.editedOn, - this.editedBy, - this.lineItemNo, - this.createdOn, - this.templateID, - this.doctorID, - this.doctorGender, - this.doctorGenderDescription, - this.doctorGenderDescriptionN, - this.doctorImageURL, - this.doctorName, - this.doctorNameN, - this.clinicID, - this.clinicName, - this.clinicNameN, - this.reportDataHtml}); + this.setupID, + this.projectID, + this.projectName, + this.projectNameN, + this.patientID, + this.invoiceNo, + this.status, + this.verifiedOn, + this.verifiedBy, + this.editedOn, + this.editedBy, + this.lineItemNo, + this.createdOn, + this.templateID, + this.doctorID, + this.doctorGender, + this.doctorGenderDescription, + this.doctorGenderDescriptionN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicName, + this.clinicNameN, + this.reportDataHtml}); MedicalReportModel.fromJson(Map json) { reportData = json['ReportData']; diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/core/model/patient/PatientArrivalEntity.dart similarity index 82% rename from lib/models/patient/PatientArrivalEntity.dart rename to lib/core/model/patient/PatientArrivalEntity.dart index 54622cd7..347cc60f 100644 --- a/lib/models/patient/PatientArrivalEntity.dart +++ b/lib/core/model/patient/PatientArrivalEntity.dart @@ -20,23 +20,23 @@ class PatientArrivalEntity { PatientArrivalEntity( {this.age, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.arrivedOn, - this.companyName, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.gender, - this.medicationOrders, - this.mobileNumber, - this.nationality, - this.patientMRN, - this.patientName, - this.rowCount, - this.startTime, - this.visitType}); + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.companyName, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.gender, + this.medicationOrders, + this.mobileNumber, + this.nationality, + this.patientMRN, + this.patientName, + this.rowCount, + this.startTime, + this.visitType}); PatientArrivalEntity.fromJson(Map json) { age = json['age']; @@ -81,4 +81,4 @@ class PatientArrivalEntity { data['visitType'] = this.visitType; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/core/model/patient/get_clinic_by_project_id_request.dart similarity index 96% rename from lib/models/patient/get_clinic_by_project_id_request.dart rename to lib/core/model/patient/get_clinic_by_project_id_request.dart index 47122bf1..5dc820be 100644 --- a/lib/models/patient/get_clinic_by_project_id_request.dart +++ b/lib/core/model/patient/get_clinic_by_project_id_request.dart @@ -1,9 +1,8 @@ class ClinicByProjectIdRequest { - - /* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: + /* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: *@desc: ClinicByProjectIdRequest */ @@ -19,6 +18,7 @@ class ClinicByProjectIdRequest { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; + /* { "ProjectID": 21, diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart similarity index 78% rename from lib/models/patient/get_doctor_by_clinic_id_request.dart rename to lib/core/model/patient/get_doctor_by_clinic_id_request.dart index 9504fc35..0ac6ee62 100644 --- a/lib/models/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart @@ -1,5 +1,4 @@ class DoctorsByClinicIdRequest { - int clinicID; int projectID; bool continueDentalPlan; @@ -13,23 +12,20 @@ class DoctorsByClinicIdRequest { bool license; bool isDentalAllowedBackend; - - DoctorsByClinicIdRequest( - { - this.clinicID, - this.projectID, - this.continueDentalPlan = false, - this.isSearchAppointmnetByClinicID = true, - this.patientID, - this.gender, - this.isGetNearAppointment = false, - this.isVoiceCommand = true, - this.latitude = 0, - this.longitude = 0, - this.license = true, - this.isDentalAllowedBackend = false, - }); - + DoctorsByClinicIdRequest({ + this.clinicID, + this.projectID, + this.continueDentalPlan = false, + this.isSearchAppointmnetByClinicID = true, + this.patientID, + this.gender, + this.isGetNearAppointment = false, + this.isVoiceCommand = true, + this.latitude = 0, + this.longitude = 0, + this.license = true, + this.isDentalAllowedBackend = false, + }); DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; @@ -61,6 +57,5 @@ class DoctorsByClinicIdRequest { data['License'] = this.license; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; return data; - } } diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/core/model/patient/get_list_stp_referral_frequency_request.dart similarity index 95% rename from lib/models/patient/get_list_stp_referral_frequency_request.dart rename to lib/core/model/patient/get_list_stp_referral_frequency_request.dart index edae9f18..597ed6de 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/core/model/patient/get_list_stp_referral_frequency_request.dart @@ -1,11 +1,10 @@ class STPReferralFrequencyRequest { - -/* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: - *@desc: + *@desc: */ int languageID; @@ -18,6 +17,7 @@ class STPReferralFrequencyRequest { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; + /* { "LanguageID": 2, diff --git a/lib/core/model/patient/get_pending_patient_er_model.dart b/lib/core/model/patient/get_pending_patient_er_model.dart new file mode 100644 index 00000000..7791926a --- /dev/null +++ b/lib/core/model/patient/get_pending_patient_er_model.dart @@ -0,0 +1,187 @@ +/* + *@author: Amjad Amireh + *@Date:15/6/2020 + *@param: + *@return: + *@desc: Find list of pending patients Model + */ +import 'dart:convert'; + +ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => + ListPendingPatientListModel.fromJson(json.decode(str)); + +String listPendingPatientListModelToJson(ListPendingPatientListModel data) => + json.encode(data.toJson()); + +class ListPendingPatientListModel { + ListPendingPatientListModel({ + this.acceptedBy, + this.acceptedOn, + this.age, + this.appointmentNo, + this.arrivalTime, + this.arrivalTimeD, + this.callStatus, + this.clientRequestId, + this.clinicName, + this.consoltationEnd, + this.consultationNotes, + this.createdOn, + this.dateOfBirth, + this.deviceToken, + this.deviceType, + this.doctorName, + this.editOn, + this.gender, + this.isFollowUp, + this.isFromVida, + this.isLoginB, + this.isOutKsa, + this.isRejected, + this.language, + this.latitude, + this.longitude, + this.mobileNumber, + this.openSession, + this.openTokenId, + this.patientId, + this.patientName, + this.patientStatus, + this.preferredLanguage, + this.projectId, + this.scoring, + this.serviceId, + this.tokenId, + this.vcId, + this.voipToken, + }); + + dynamic acceptedBy; + dynamic acceptedOn; + int age; + dynamic appointmentNo; + String arrivalTime; + String arrivalTimeD; + int callStatus; + String clientRequestId; + String clinicName; + dynamic consoltationEnd; + dynamic consultationNotes; + dynamic createdOn; + DateTime dateOfBirth; + String deviceToken; + String deviceType; + dynamic doctorName; + String editOn; + String gender; + bool isFollowUp; + dynamic isFromVida; + int isLoginB; + bool isOutKsa; + int isRejected; + String language; + double latitude; + double longitude; + String mobileNumber; + dynamic openSession; + dynamic openTokenId; + String patientId; + String patientName; + int patientStatus; + String preferredLanguage; + int projectId; + int scoring; + int serviceId; + dynamic tokenId; + int vcId; + String voipToken; + + factory ListPendingPatientListModel.fromJson(Map json) => + ListPendingPatientListModel( + acceptedBy: json["AcceptedBy"], + acceptedOn: json["AcceptedOn"], + age: json["Age"], + appointmentNo: json["AppointmentNo"], + arrivalTime: json["ArrivalTime"], + arrivalTimeD: json["ArrivalTimeD"], + callStatus: json["CallStatus"], + clientRequestId: json["ClientRequestID"], + clinicName: json["ClinicName"], + consoltationEnd: json["ConsoltationEnd"], + consultationNotes: json["ConsultationNotes"], + createdOn: json["CreatedOn"], + dateOfBirth: DateTime.parse(json["DateOfBirth"]), + deviceToken: json["DeviceToken"], + deviceType: json["DeviceType"], + doctorName: json["DoctorName"], + editOn: json["EditOn"], + gender: json["Gender"], + isFollowUp: json["IsFollowUP"], + isFromVida: json["IsFromVida"], + isLoginB: json["IsLoginB"], + isOutKsa: json["IsOutKSA"], + isRejected: json["IsRejected"], + language: json["Language"], + latitude: json["Latitude"].toDouble(), + longitude: json["Longitude"].toDouble(), + mobileNumber: json["MobileNumber"], + openSession: json["OpenSession"], + openTokenId: json["OpenTokenID"], + patientId: json["PatientID"], + patientName: json["PatientName"], + patientStatus: json["PatientStatus"], + preferredLanguage: json["PreferredLanguage"], + projectId: json["ProjectID"], + scoring: json["Scoring"], + serviceId: json["ServiceID"], + tokenId: json["TokenID"], + vcId: json["VC_ID"], + voipToken: json["VoipToken"], + ); + + Map toJson() => { + "AcceptedBy": acceptedBy, + "AcceptedOn": acceptedOn, + "Age": age, + "AppointmentNo": appointmentNo, + "ArrivalTime": arrivalTime, + "ArrivalTimeD": arrivalTimeD, + "CallStatus": callStatus, + "ClientRequestID": clientRequestId, + "ClinicName": clinicName, + "ConsoltationEnd": consoltationEnd, + "ConsultationNotes": consultationNotes, + "CreatedOn": createdOn, + "DateOfBirth": + "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", + "DeviceToken": deviceToken, + "DeviceType": deviceType, + "DoctorName": doctorName, + "EditOn": editOn, + "Gender": gender, + "IsFollowUP": isFollowUp, + "IsFromVida": isFromVida, + "IsLoginB": isLoginB, + "IsOutKSA": isOutKsa, + "IsRejected": isRejected, + "Language": language, + "Latitude": latitude, + "Longitude": longitude, + "MobileNumber": mobileNumber, + "OpenSession": openSession, + "OpenTokenID": openTokenId, + "PatientID": patientId, + "PatientName": patientName, + "PatientStatus": patientStatus, + "PreferredLanguage": preferredLanguage, + "ProjectID": projectId, + "Scoring": scoring, + "ServiceID": serviceId, + "TokenID": tokenId, + "VC_ID": vcId, + "VoipToken": voipToken, + }; +} +// To parse this JSON data, do +// +// final listPendingPatientListModel = listPendingPatientListModelFromJson(jsonString); diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/core/model/patient/insurance_aprovals_request.dart similarity index 97% rename from lib/models/patient/insurance_aprovals_request.dart rename to lib/core/model/patient/insurance_aprovals_request.dart index 2d3ac663..f1e4e7bd 100644 --- a/lib/models/patient/insurance_aprovals_request.dart +++ b/lib/core/model/patient/insurance_aprovals_request.dart @@ -36,8 +36,7 @@ class InsuranceAprovalsRequest { int patientTypeID; InsuranceAprovalsRequest( - { - this.exuldAppNO, + {this.exuldAppNO, this.patientID, this.channel = 9, this.projectID = 12, @@ -46,7 +45,7 @@ class InsuranceAprovalsRequest { this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', this.versionID = 5.8, - this.tokenID , + this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, this.patientOutSA = false}); diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/core/model/patient/lab_orders/lab_orders_req_model.dart similarity index 89% rename from lib/models/patient/lab_orders/lab_orders_req_model.dart rename to lib/core/model/patient/lab_orders/lab_orders_req_model.dart index a97f4093..29928f4e 100644 --- a/lib/models/patient/lab_orders/lab_orders_req_model.dart +++ b/lib/core/model/patient/lab_orders/lab_orders_req_model.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Elham Rababah *@Date:6/5/2020 *@param: @@ -27,12 +26,12 @@ class LabOrdersReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.versionID=5.5, - this.channel=9, - this.sessionID='E2bsEeYEJo', - this.isLoginForDoctorApp =true, - this.patientOutSA=false}); + this.iPAdress = '11.11.11.11', + this.versionID = 5.5, + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.isLoginForDoctorApp = true, + this.patientOutSA = false}); LabOrdersReqModel.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/core/model/patient/lab_orders/lab_orders_res_model.dart similarity index 99% rename from lib/models/patient/lab_orders/lab_orders_res_model.dart rename to lib/core/model/patient/lab_orders/lab_orders_res_model.dart index 7f463933..86646cee 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/core/model/patient/lab_orders/lab_orders_res_model.dart @@ -1,5 +1,3 @@ - - import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/core/model/patient/lab_result/lab_result.dart similarity index 81% rename from lib/models/patient/lab_result/lab_result.dart rename to lib/core/model/patient/lab_result/lab_result.dart index ca753f2d..30925f12 100644 --- a/lib/models/patient/lab_result/lab_result.dart +++ b/lib/core/model/patient/lab_result/lab_result.dart @@ -30,33 +30,33 @@ class LabResult { LabResult( {this.setupID, - this.projectID, - this.orderNo, - this.lineItemNo, - this.packageID, - this.testID, - this.description, - this.resultValue, - this.referenceRange, - this.convertedResultValue, - this.convertedReferenceRange, - this.resultValueFlag, - this.status, - this.createdBy, - this.createdByN, - this.createdOn, - this.editedBy, - this.editedByN, - this.editedOn, - this.verifiedBy, - this.verifiedByN, - this.verifiedOn, - this.patientID, - this.gender, - this.maleInterpretativeData, - this.femaleInterpretativeData, - this.testCode, - this.statusDescription}); + this.projectID, + this.orderNo, + this.lineItemNo, + this.packageID, + this.testID, + this.description, + this.resultValue, + this.referenceRange, + this.convertedResultValue, + this.convertedReferenceRange, + this.resultValueFlag, + this.status, + this.createdBy, + this.createdByN, + this.createdOn, + this.editedBy, + this.editedByN, + this.editedOn, + this.verifiedBy, + this.verifiedByN, + this.verifiedOn, + this.patientID, + this.gender, + this.maleInterpretativeData, + this.femaleInterpretativeData, + this.testCode, + this.statusDescription}); LabResult.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/core/model/patient/lab_result/lab_result_req_model.dart similarity index 83% rename from lib/models/patient/lab_result/lab_result_req_model.dart rename to lib/core/model/patient/lab_result/lab_result_req_model.dart index 5e58a4a5..f070d4c2 100644 --- a/lib/models/patient/lab_result/lab_result_req_model.dart +++ b/lib/core/model/patient/lab_result/lab_result_req_model.dart @@ -16,19 +16,19 @@ class RequestLabResult { RequestLabResult( {this.projectID, - this.setupID, - this.orderNo, - this.invoiceNo, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.setupID, + this.orderNo, + this.invoiceNo, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestLabResult.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/core/model/patient/my_referral/PendingReferral.dart similarity index 100% rename from lib/models/patient/my_referral/PendingReferral.dart rename to lib/core/model/patient/my_referral/PendingReferral.dart diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/core/model/patient/my_referral/clinic-doctor.dart similarity index 81% rename from lib/models/patient/my_referral/clinic-doctor.dart rename to lib/core/model/patient/my_referral/clinic-doctor.dart index 843f636c..0679f4c8 100644 --- a/lib/models/patient/my_referral/clinic-doctor.dart +++ b/lib/core/model/patient/my_referral/clinic-doctor.dart @@ -41,44 +41,44 @@ class ClinicDoctor { ClinicDoctor( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); ClinicDoctor.fromJson(Map json) { clinicID = json['ClinicID']; @@ -165,5 +165,4 @@ class ClinicDoctor { data['WorkingHours'] = this.workingHours; return data; } - -} \ No newline at end of file +} diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/core/model/patient/my_referral/my_referral_patient_model.dart similarity index 81% rename from lib/models/patient/my_referral/my_referral_patient_model.dart rename to lib/core/model/patient/my_referral/my_referral_patient_model.dart index f1506f8e..dc7bcdbe 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/core/model/patient/my_referral/my_referral_patient_model.dart @@ -53,54 +53,54 @@ class MyReferralPatientModel { MyReferralPatientModel( {this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.age, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.age, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); MyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/core/model/patient/my_referral/my_referred_patient_model.dart similarity index 79% rename from lib/models/patient/my_referral/my_referred_patient_model.dart rename to lib/core/model/patient/my_referral/my_referred_patient_model.dart index b353e587..4f9aabad 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/core/model/patient/my_referral/my_referred_patient_model.dart @@ -1,5 +1,3 @@ - - class MyReferredPatientModel { String rowID; int projectID; @@ -66,71 +64,71 @@ class MyReferredPatientModel { bool isReferralDoctorSameBranch; String referralStatusDesc; - MyReferredPatientModel({ - this.rowID, - this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.clinicDescription, - this.clinicDescriptionN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.isReferralDoctorSameBranch, - this.referralDoctorName, - this.referralClinicDescription,this.referralStatusDesc - }); + MyReferredPatientModel( + {this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription, + this.referralStatusDesc}); MyReferredPatientModel.fromJson(Map json) { rowID = json['RowID']; @@ -167,7 +165,13 @@ class MyReferredPatientModel { referralClinic = json['ReferralClinic']; referringClinic = json['ReferringClinic']; createdOn = json['CreatedOn']; - referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus']; + referralStatus = json["ReferralStatus"] is String + ? json['ReferralStatus'] == "Accepted" + ? 46 + : json['ReferralStatus'] == "Pending" + ? 1 + : 0 + : json['ReferralStatus']; referralDate = json['ReferralDate'] ?? createdOn; referringDoctorRemarks = json['ReferringDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks']; diff --git a/lib/models/patient/orders_request.dart b/lib/core/model/patient/orders_request.dart similarity index 97% rename from lib/models/patient/orders_request.dart rename to lib/core/model/patient/orders_request.dart index 1372cfd6..4adab686 100644 --- a/lib/models/patient/orders_request.dart +++ b/lib/core/model/patient/orders_request.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -38,14 +37,14 @@ class OrdersRequest { double versionID; OrdersRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, @@ -85,4 +84,4 @@ class OrdersRequest { data['VersionID'] = this.versionID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/patiant_info_model.dart b/lib/core/model/patient/patiant_info_model.dart similarity index 88% rename from lib/models/patient/patiant_info_model.dart rename to lib/core/model/patient/patiant_info_model.dart index df966f03..99127cc9 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/core/model/patient/patiant_info_model.dart @@ -1,6 +1,7 @@ // TODO = it have to be changed. import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; class PatiantInformtion { PatiantInformtion patientDetails; @@ -158,7 +159,9 @@ class PatiantInformtion { PatiantInformtion.fromJson(Map json) { { - patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; + patientDetails = json['patientDetails'] != null + ? new PatiantInformtion.fromJson(json['patientDetails']) + : null; projectId = json["ProjectID"] ?? json["projectID"]; clinicId = json["ClinicID"] ?? json["clinicID"]; doctorId = json["DoctorID"] ?? json["doctorID"]; @@ -186,7 +189,8 @@ class PatiantInformtion { nationalityId = json["NationalityID"] ?? json["nationalityID"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + patientIdentificationNo = + json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; //TODO make 7 dynamic when the backend retrun it in patient arrival patientType = json["PatientType"] ?? json["patientType"] ?? 1; admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; @@ -196,10 +200,16 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; - nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; + clinicDescription = Helpers.convertToTitleCase( + json["ClinicDescription"] ?? json["clinicDescription"]??''); + clinicDescriptionN = + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? + json["nationalityName"] ?? + json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? + json["nationalityNameN"] ?? + json['NationalityNameN']; age = json["Age"] ?? json["age"]; genderDescription = json["GenderDescription"]; nursingStationName = json["NursingStationName"]; @@ -207,7 +217,8 @@ class PatiantInformtion { startTime = json["startTime"] ?? json['StartTime']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentType = json['appointmentType']; - appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; + appointmentTypeId = + json['appointmentTypeId'] ?? json['appointmentTypeid']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; clinicGroupId = json['clinicGroupId']; companyName = json['companyName']; @@ -229,9 +240,12 @@ class PatiantInformtion { ? int?.parse(json["patientId"].toString()) : ''); visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + nationalityFlagURL = + json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = + json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = + json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; startTimes = json['StartTime'] ?? json['StartTime']; dischargeDate = json['DischargeDate']; status = json['Status']; @@ -254,8 +268,9 @@ class PatiantInformtion { ? AppDateUtils.convertStringToDate(json["admissionDate"]) : null; - appointmentDateWithDateTimeForm = - json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; + appointmentDateWithDateTimeForm = json["AppointmentDate"] != null + ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) + : null; } } @@ -303,7 +318,8 @@ class PatiantInformtion { data["gender"] = this.gender; data['Age'] = this.age; - data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null; + data['AppointmentDate'] = + this.appointmentDate.isNotEmpty ? this.appointmentDate : null; data['AppointmentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/core/model/patient/patient_arrival/get_patient_arrival_list_request_model.dart similarity index 99% rename from lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart rename to lib/core/model/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 1d0da9c5..5ec16352 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/core/model/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -40,7 +40,6 @@ class GetPatientArrivalListRequestModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; - return data; } } diff --git a/lib/models/patient/patient_model.dart b/lib/core/model/patient/patient_model.dart similarity index 99% rename from lib/models/patient/patient_model.dart rename to lib/core/model/patient/patient_model.dart index 7368c538..3a8eb9ae 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/core/model/patient/patient_model.dart @@ -31,6 +31,7 @@ class PatientModel { int Searchtype; String IdentificationNo; String MobileNo; + int get getProjectID => ProjectID; set setProjectID(int ProjectID) => this.ProjectID = ProjectID; @@ -42,6 +43,7 @@ class PatientModel { int get getDoctorID => DoctorID; set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; + String get getFirstName => FirstName; set setFirstName(String FirstName) => this.FirstName = FirstName; @@ -141,6 +143,7 @@ class PatientModel { FirstName: json["FirstName"], LastName: json["LasttName"], ); + Map toJson() { final Map data = new Map(); data['ProjectID'] = this.ProjectID; diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/core/model/patient/prescription/prescription_report.dart similarity index 81% rename from lib/models/patient/prescription/prescription_report.dart rename to lib/core/model/patient/prescription/prescription_report.dart index 05d28bdc..d559b9d0 100644 --- a/lib/models/patient/prescription/prescription_report.dart +++ b/lib/core/model/patient/prescription/prescription_report.dart @@ -34,37 +34,37 @@ class PrescriptionReport { PrescriptionReport( {this.address, - this.appointmentNo, - this.clinic, - this.companyName, - this.days, - this.doctorName, - this.doseDailyQuantity, - this.frequency, - this.frequencyNumber, - this.imageExtension, - this.imageSRCUrl, - this.imageString, - this.imageThumbUrl, - this.isCovered, - this.itemDescription, - this.itemID, - this.orderDate, - this.patientID, - this.patientName, - this.phoneOffice1, - this.prescriptionQR, - this.prescriptionTimes, - this.productImage, - this.productImageBase64, - this.productImageString, - this.projectID, - this.projectName, - this.remarks, - this.route, - this.sKU, - this.scaleOffset, - this.startDate}); + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); PrescriptionReport.fromJson(Map json) { address = json['Address']; diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/core/model/patient/prescription/prescription_report_for_in_patient.dart similarity index 80% rename from lib/models/patient/prescription/prescription_report_for_in_patient.dart rename to lib/core/model/patient/prescription/prescription_report_for_in_patient.dart index 21cb13b1..12b5e1e6 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/core/model/patient/prescription/prescription_report_for_in_patient.dart @@ -51,52 +51,52 @@ class PrescriptionReportForInPatient { PrescriptionReportForInPatient( {this.admissionNo, - this.authorizedBy, - this.bedNo, - this.comments, - this.createdBy, - this.createdByName, - this.createdByNameN, - this.createdOn, - this.direction, - this.directionID, - this.directionN, - this.dose, - this.editedBy, - this.iVDiluentLine, - this.iVDiluentType, - this.iVDiluentVolume, - this.iVRate, - this.iVStability, - this.itemDescription, - this.itemID, - this.lineItemNo, - this.locationId, - this.noOfDoses, - this.orderNo, - this.patientID, - this.pharmacyRemarks, - this.prescriptionDatetime, - this.prescriptionNo, - this.processedBy, - this.projectID, - this.refillID, - this.refillType, - this.refillTypeN, - this.reviewedPharmacist, - this.roomId, - this.route, - this.routeId, - this.routeN, - this.setupID, - this.startDatetime, - this.status, - this.statusDescription, - this.statusDescriptionN, - this.stopDatetime, - this.unitofMeasurement, - this.unitofMeasurementDescription, - this.unitofMeasurementDescriptionN}); + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); PrescriptionReportForInPatient.fromJson(Map json) { admissionNo = json['AdmissionNo']; @@ -125,7 +125,8 @@ class PrescriptionReportForInPatient { orderNo = json['OrderNo']; patientID = json['PatientID']; pharmacyRemarks = json['PharmacyRemarks']; - prescriptionDatetime = AppDateUtils.convertStringToDate(json['PrescriptionDatetime']); + prescriptionDatetime = + AppDateUtils.convertStringToDate(json['PrescriptionDatetime']); prescriptionNo = json['PrescriptionNo']; processedBy = json['ProcessedBy']; projectID = json['ProjectID']; @@ -138,7 +139,7 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']) ; + startDatetime = AppDateUtils.convertStringToDate(json['StartDatetime']); status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/core/model/patient/prescription/prescription_req_model.dart similarity index 100% rename from lib/models/patient/prescription/prescription_req_model.dart rename to lib/core/model/patient/prescription/prescription_req_model.dart diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/core/model/patient/prescription/prescription_res_model.dart similarity index 97% rename from lib/models/patient/prescription/prescription_res_model.dart rename to lib/core/model/patient/prescription/prescription_res_model.dart index 9c7e296d..eed34296 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/core/model/patient/prescription/prescription_res_model.dart @@ -16,7 +16,6 @@ class PrescriptionResModel { String name; int episodeID; int actualDoctorRate; - int admission; int clinicID; String companyName; String despensedStatus; @@ -51,7 +50,6 @@ class PrescriptionResModel { this.name, this.episodeID, this.actualDoctorRate, - this.admission, this.clinicID, this.companyName, this.despensedStatus, @@ -86,7 +84,6 @@ class PrescriptionResModel { name = json['Name']; episodeID = json['EpisodeID']; actualDoctorRate = json['ActualDoctorRate']; - admission = json['Admission']; clinicID = json['ClinicID']; companyName = json['CompanyName']; despensedStatus = json['Despensed_Status']; @@ -123,7 +120,6 @@ class PrescriptionResModel { data['Name'] = this.name; data['EpisodeID'] = this.episodeID; data['ActualDoctorRate'] = this.actualDoctorRate; - data['Admission'] = this.admission; data['ClinicID'] = this.clinicID; data['CompanyName'] = this.companyName; data['Despensed_Status'] = this.despensedStatus; diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/core/model/patient/prescription/request_prescription_report.dart similarity index 83% rename from lib/models/patient/prescription/request_prescription_report.dart rename to lib/core/model/patient/prescription/request_prescription_report.dart index 0581692e..99b9762a 100644 --- a/lib/models/patient/prescription/request_prescription_report.dart +++ b/lib/core/model/patient/prescription/request_prescription_report.dart @@ -16,19 +16,19 @@ class RequestPrescriptionReport { RequestPrescriptionReport( {this.projectID, - this.appointmentNo, - this.episodeID, - this.setupID, - this.patientTypeID, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.appointmentNo, + this.episodeID, + this.setupID, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestPrescriptionReport.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/progress_note_request.dart b/lib/core/model/patient/progress_note_request.dart similarity index 97% rename from lib/models/patient/progress_note_request.dart rename to lib/core/model/patient/progress_note_request.dart index 13e1b571..77920b25 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/core/model/patient/progress_note_request.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -35,15 +34,16 @@ class ProgressNoteRequest { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; + ProgressNoteRequest( - {this.visitType , + {this.visitType, this.admissionNo, this.projectID = 12, this.stamp = '2020-04-23T21:01:21.492Z', this.languageID = 2, this.iPAdress = '11.11.11.11', this.channel = 9, - this.tokenID , + this.tokenID, this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, @@ -80,4 +80,4 @@ class ProgressNoteRequest { data['PatientTypeID'] = this.patientTypeID; return data; } -} \ No newline at end of file +} diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/core/model/patient/radiology/radiology_req_model.dart similarity index 100% rename from lib/models/patient/radiology/radiology_req_model.dart rename to lib/core/model/patient/radiology/radiology_req_model.dart diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/core/model/patient/radiology/radiology_res_model.dart similarity index 100% rename from lib/models/patient/radiology/radiology_res_model.dart rename to lib/core/model/patient/radiology/radiology_res_model.dart diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/core/model/patient/reauest_prescription_report_for_in_patient.dart similarity index 84% rename from lib/models/patient/reauest_prescription_report_for_in_patient.dart rename to lib/core/model/patient/reauest_prescription_report_for_in_patient.dart index 857705c4..6299908d 100644 --- a/lib/models/patient/reauest_prescription_report_for_in_patient.dart +++ b/lib/core/model/patient/reauest_prescription_report_for_in_patient.dart @@ -15,18 +15,18 @@ class RequestPrescriptionReportForInPatient { RequestPrescriptionReportForInPatient( {this.patientID, - this.projectID, - this.admissionNo, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA, - this.patientTypeID}); + this.projectID, + this.admissionNo, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); RequestPrescriptionReportForInPatient.fromJson(Map json) { patientID = json['PatientID']; diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/core/model/patient/refer_to_doctor_request.dart similarity index 95% rename from lib/models/patient/refer_to_doctor_request.dart rename to lib/core/model/patient/refer_to_doctor_request.dart index 83db54f4..11e1ca01 100644 --- a/lib/models/patient/refer_to_doctor_request.dart +++ b/lib/core/model/patient/refer_to_doctor_request.dart @@ -1,11 +1,10 @@ import 'package:flutter/cupertino.dart'; class ReferToDoctorRequest { - -/* - *@author: Ibrahim Albitar - *@Date:03/06/2020 - *@param: +/* + *@author: Ibrahim Albitar + *@Date:03/06/2020 + *@param: *@return: *@desc: ReferToDoctor */ @@ -35,7 +34,6 @@ class ReferToDoctorRequest { bool isLoginForDoctorApp; bool patientOutSA; - /* { "ProjectID": 21, @@ -68,17 +66,17 @@ class ReferToDoctorRequest { ReferToDoctorRequest( {@required this.projectID, @required this.admissionNo, - @required this.roomID , + @required this.roomID, @required this.referralClinic, - @required this.referralDoctor , + @required this.referralDoctor, @required this.createdBy, - @required this.editedBy , + @required this.editedBy, @required this.patientID, @required this.patientTypeID, @required this.referringClinic, @required this.referringDoctor, @required this.referringDoctorRemarks, - @required this.priority , + @required this.priority, @required this.frequency, @required this.extension, this.languageID = 2, diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/core/model/patient/request_my_referral_patient_model.dart similarity index 92% rename from lib/models/patient/request_my_referral_patient_model.dart rename to lib/core/model/patient/request_my_referral_patient_model.dart index 219b7b2a..382f6309 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/core/model/patient/request_my_referral_patient_model.dart @@ -1,5 +1,3 @@ - - class RequestMyReferralPatientModel { int projectID; int clinicID; @@ -34,15 +32,15 @@ class RequestMyReferralPatientModel { this.patientID = 0, this.from = "0", this.to = "0", - this.languageID , - this.stamp , - this.iPAdress , - this.versionID , - this.channel , + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, this.tokenID, - this.sessionID , - this.isLoginForDoctorApp , - this.patientOutSA }); + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); RequestMyReferralPatientModel.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/core/model/patient/topten_users_res_model.dart similarity index 69% rename from lib/models/patient/topten_users_res_model.dart rename to lib/core/model/patient/topten_users_res_model.dart index 3454568f..cc47a2f8 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/core/model/patient/topten_users_res_model.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Amjad Amireh *@Date:27/4/2020 *@param: @@ -7,26 +6,25 @@ *@desc: */ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; + //ModelResponse class ModelResponse { final List list; - String firstName; + String firstName; + ModelResponse({ this.list, this.firstName, }); factory ModelResponse.fromJson(List parsedJson) { - - - List list = new List(); - + List list = new List(); + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); return new ModelResponse(list: list); } } -class PatiantInformtionl { -} \ No newline at end of file +class PatiantInformtionl {} diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart similarity index 81% rename from lib/models/patient/vital_sign/patient-vital-sign-data.dart rename to lib/core/model/patient/vital_sign/patient-vital-sign-data.dart index 57133a08..7c0448b9 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart @@ -33,36 +33,36 @@ class VitalSignData { VitalSignData( {this.appointmentNo, - this.bloodPressureCuffLocation, - this.bloodPressureCuffSize, - this.bloodPressureHigher, - this.bloodPressureLower, - this.bloodPressurePatientPosition, - this.bodyMassIndex, - this.fio2, - this.headCircumCm, - this.heightCm, - this.idealBodyWeightLbs, - this.isPainManagementDone, - this.isVitalsRequired, - this.leanBodyWeightLbs, - this.painCharacter, - this.painDuration, - this.painFrequency, - this.painLocation, - this.painScore, - this.patientMRN, - this.patientType, - this.pulseBeatPerMinute, - this.pulseRhythm, - this.respirationBeatPerMinute, - this.respirationPattern, - this.sao2, - this.status, - this.temperatureCelcius, - this.temperatureCelciusMethod, - this.waistSizeInch, - this.weightKg}); + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressureHigher, + this.bloodPressureLower, + this.bloodPressurePatientPosition, + this.bodyMassIndex, + this.fio2, + this.headCircumCm, + this.heightCm, + this.idealBodyWeightLbs, + this.isPainManagementDone, + this.isVitalsRequired, + this.leanBodyWeightLbs, + this.painCharacter, + this.painDuration, + this.painFrequency, + this.painLocation, + this.painScore, + this.patientMRN, + this.patientType, + this.pulseBeatPerMinute, + this.pulseRhythm, + this.respirationBeatPerMinute, + this.respirationPattern, + this.sao2, + this.status, + this.temperatureCelcius, + this.temperatureCelciusMethod, + this.waistSizeInch, + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -133,5 +133,4 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } - } diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-history.dart similarity index 100% rename from lib/models/patient/vital_sign/patient-vital-sign-history.dart rename to lib/core/model/patient/vital_sign/patient-vital-sign-history.dart diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/core/model/patient/vital_sign/vital_sign_req_model.dart similarity index 90% rename from lib/models/patient/vital_sign/vital_sign_req_model.dart rename to lib/core/model/patient/vital_sign/vital_sign_req_model.dart index 8f5be6ba..4861bf8d 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/core/model/patient/vital_sign/vital_sign_req_model.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Elham Rababah *@Date:27/4/2020 *@param: @@ -13,7 +12,8 @@ class VitalSignReqModel { int inOutpatientType; int transNo; int languageID; - String stamp ; + String stamp; + String iPAdress; double versionID; int channel; @@ -30,12 +30,12 @@ class VitalSignReqModel { this.languageID, this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', - this.iPAdress='11.11.11.11', - this.channel=9, - this.sessionID='E2bsEeYEJo', - this.isLoginForDoctorApp=true, + this.iPAdress = '11.11.11.11', + this.channel = 9, + this.sessionID = 'E2bsEeYEJo', + this.isLoginForDoctorApp = true, this.patientTypeID, - this.patientOutSA=false}); + this.patientOutSA = false}); VitalSignReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -72,5 +72,4 @@ class VitalSignReqModel { data['PatientTypeID'] = this.patientTypeID; return data; } - } diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/core/model/patient/vital_sign/vital_sign_res_model.dart similarity index 97% rename from lib/models/patient/vital_sign/vital_sign_res_model.dart rename to lib/core/model/patient/vital_sign/vital_sign_res_model.dart index 78af108d..0645bf1f 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/core/model/patient/vital_sign/vital_sign_res_model.dart @@ -38,7 +38,7 @@ class VitalSignResModel { var status; bool isVitalsRequired; var patientID; - var createdOn; + var createdOn; var doctorID; var clinicID; var triageCategory; @@ -61,9 +61,9 @@ class VitalSignResModel { var bloodPressureCuffLocationDesc; var bloodPressureCuffSizeDesc; var bloodPressurePatientPositionDesc; - var clinicName; - var doctorImageURL; - var doctorName; + var clinicName; + var doctorImageURL; + var doctorName; var painScoreDesc; var pulseRhythmDesc; var respirationPatternDesc; @@ -170,7 +170,9 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? AppDateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = json['VitalSignDate'] != null + ? AppDateUtils.convertStringToDate(json['VitalSignDate']) + : new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; diff --git a/lib/core/model/patient_muse/PatientMuseResultsModel.dart b/lib/core/model/patient_muse/PatientMuseResultsModel.dart index 401fd1a7..33f2cac2 100644 --- a/lib/core/model/patient_muse/PatientMuseResultsModel.dart +++ b/lib/core/model/patient_muse/PatientMuseResultsModel.dart @@ -42,7 +42,8 @@ class PatientMuseResultsModel { imageURL = json['ImageURL']; createdBy = json['CreatedBy']; createdOn = json['CreatedOn']; - createdOnDateTime = AppDateUtils.getDateTimeFromServerFormat(json['CreatedOn']); + createdOnDateTime = + AppDateUtils.getDateTimeFromServerFormat(json['CreatedOn']); } Map toJson() { diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/core/model/pending_orders/pending_order_request_model.dart similarity index 100% rename from lib/models/pending_orders/pending_order_request_model.dart rename to lib/core/model/pending_orders/pending_order_request_model.dart diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/core/model/pending_orders/pending_orders_model.dart similarity index 100% rename from lib/models/pending_orders/pending_orders_model.dart rename to lib/core/model/pending_orders/pending_orders_model.dart diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/core/model/pharmacies/pharmacies_List_request_model.dart similarity index 99% rename from lib/models/pharmacies/pharmacies_List_request_model.dart rename to lib/core/model/pharmacies/pharmacies_List_request_model.dart index a00e217a..69341f09 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/core/model/pharmacies/pharmacies_List_request_model.dart @@ -1,5 +1,4 @@ - -/* +/* *@author: Ibrahim Albitar *@Date:27/4/2020 *@param: @@ -61,4 +60,4 @@ class PharmaciesListRequestModel { data['Channel'] = this.channel; return data; } -} \ No newline at end of file +} diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/core/model/pharmacies/pharmacies_items_request_model.dart similarity index 97% rename from lib/models/pharmacies/pharmacies_items_request_model.dart rename to lib/core/model/pharmacies/pharmacies_items_request_model.dart index e81ce9b3..a09736e2 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/core/model/pharmacies/pharmacies_items_request_model.dart @@ -59,6 +59,8 @@ class PharmaciesItemsRequestModel { data['SessionID'] = this.sessionID; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['DeviceTypeID'] = this.deviceTypeID; + //TODO Elham* fix it later + data['VersionID'] = 40; return data; } } diff --git a/lib/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart b/lib/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart new file mode 100644 index 00000000..67b234de --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart @@ -0,0 +1,66 @@ +class AcceptOrRejectReqModel { + int patientID; + int projectID; + int admissionNo; + int prescriptionNo; + int orderNo; + String remarks; + int memberID; + int accessLevel; + int languageID; + int lineItemNo; + bool patientOutSA; + int interventionStatus; + int status; + + AcceptOrRejectReqModel( + {this.patientID, + this.projectID, + this.admissionNo, + this.prescriptionNo, + this.orderNo, + this.remarks, + this.memberID, + this.accessLevel, + this.languageID, + this.lineItemNo, + this.patientOutSA, + this.interventionStatus, + this.status + }); + + AcceptOrRejectReqModel.fromJson(Map json) { + patientID = json['PatientID']; + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + prescriptionNo = json['PrescriptionNo']; + orderNo = json['OrderNo']; + remarks = json['Remarks']; + memberID = json['MemberID']; + accessLevel = json['AccessLevel']; + languageID = json['LanguageID']; + lineItemNo = json['LineItemNo']; + patientOutSA = json['PatientOutSA']; + interventionStatus = json['InterventionStatus']; + status = json['Status']; + + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['OrderNo'] = this.orderNo; + data['Remarks'] = this.remarks; + data['MemberID'] = this.memberID; + data['AccessLevel'] = this.accessLevel; + data['LanguageID'] = this.languageID; + data['LineItemNo'] = this.lineItemNo; + data['PatientOutSA'] = this.patientOutSA; + data['InterventionStatus'] = this.interventionStatus; + data['Status'] = this.status; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/accept_or_reject_res_model.dart b/lib/core/model/pharmacy-intervention-model/accept_or_reject_res_model.dart new file mode 100644 index 00000000..7e2448f6 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/accept_or_reject_res_model.dart @@ -0,0 +1,4 @@ +class AcceptOrRejectResModel { + + +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart new file mode 100644 index 00000000..122212b7 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart @@ -0,0 +1,32 @@ +class InterventionMedicationHistoryReqModel { + int projectID; + int patientID; + int admissionNo; + int orderNo; + int prescriptionNo; + + InterventionMedicationHistoryReqModel( + {this.projectID, + this.patientID, + this.admissionNo, + this.orderNo, + this.prescriptionNo}); + + InterventionMedicationHistoryReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart new file mode 100644 index 00000000..451cccb8 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart @@ -0,0 +1,96 @@ +class InterventionMedicationHistoryResModel { + String setupId; + String projectId; + int patientId; + int admissionNo; + int prescriptionId; + int orderNo; + int id; + int interventionId; + Null intervention; + String remark; + int commentedBy; + bool isDoctor; + bool isActive; + int createdBy; + String createdByName; + String createdByNameN; + String createdOn; + Null editedBy; + Null editedByName; + Null editedByNameN; + Null editedOn; + + InterventionMedicationHistoryResModel( + {this.setupId, + this.projectId, + this.patientId, + this.admissionNo, + this.prescriptionId, + this.orderNo, + this.id, + this.interventionId, + this.intervention, + this.remark, + this.commentedBy, + this.isDoctor, + this.isActive, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn}); + + InterventionMedicationHistoryResModel.fromJson(Map json) { + setupId = json['SetupId']; + projectId = json['ProjectId']; + patientId = json['PatientId']; + admissionNo = json['AdmissionNo']; + prescriptionId = json['PrescriptionId']; + orderNo = json['OrderNo']; + id = json['Id']; + interventionId = json['InterventionId']; + intervention = json['Intervention']; + remark = json['Remark']; + commentedBy = json['CommentedBy']; + isDoctor = json['IsDoctor']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + editedOn = json['EditedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectId'] = this.projectId; + data['PatientId'] = this.patientId; + data['AdmissionNo'] = this.admissionNo; + data['PrescriptionId'] = this.prescriptionId; + data['OrderNo'] = this.orderNo; + data['Id'] = this.id; + data['InterventionId'] = this.interventionId; + data['Intervention'] = this.intervention; + data['Remark'] = this.remark; + data['CommentedBy'] = this.commentedBy; + data['IsDoctor'] = this.isDoctor; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + data['EditedOn'] = this.editedOn; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/new_medication_req_model.dart b/lib/core/model/pharmacy-intervention-model/new_medication_req_model.dart new file mode 100644 index 00000000..92cde706 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/new_medication_req_model.dart @@ -0,0 +1,25 @@ +class InterventionMedicationReqModel { + int projectID; + int patientID; + String fromDate; + String toDate; + + InterventionMedicationReqModel( + {this.projectID, this.patientID, this.fromDate, this.toDate}); + + InterventionMedicationReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + fromDate = json['FromDate']; + toDate = json['ToDate']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['FromDate'] = this.fromDate; + data['ToDate'] = this.toDate; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/new_medication_res_model.dart b/lib/core/model/pharmacy-intervention-model/new_medication_res_model.dart new file mode 100644 index 00000000..5d3dca39 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/new_medication_res_model.dart @@ -0,0 +1,100 @@ +class InterventionMedicationResModel { + String cS; + String iHR; + String setupID; + int projectID; + int accessLevel; + int patientID; + String patientName; + String description; + int admissionNo; + int orderNo; + int prescriptionNo; + int lineItemNo; + int itemID; + String medication; + String doctorComments; + String startDatetime; + String stopDatetime; + int status; + int createdBy; + int authorizedby; + Null pharmacyRemarks; + String statusDescription; + + InterventionMedicationResModel( + {this.cS, + this.iHR, + this.setupID, + this.projectID, + this.accessLevel, + this.patientID, + this.patientName, + this.description, + this.admissionNo, + this.orderNo, + this.prescriptionNo, + this.lineItemNo, + this.itemID, + this.medication, + this.doctorComments, + this.startDatetime, + this.stopDatetime, + this.status, + this.createdBy, + this.authorizedby, + this.pharmacyRemarks, + this.statusDescription}); + + InterventionMedicationResModel.fromJson(Map json) { + cS = json['CS']; + iHR = json['IHR']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + accessLevel = json['AccessLevel']; + patientID = json['PatientID']; + patientName = json['PatientName']; + description = json['Description']; + admissionNo = json['AdmissionNo']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + lineItemNo = json['LineItemNo']; + itemID = json['ItemID']; + medication = json['Medication']; + doctorComments = json['DoctorComments']; + startDatetime = json['StartDatetime']; + stopDatetime = json['StopDatetime']; + status = json['Status']; + createdBy = json['CreatedBy']; + authorizedby = json['Authorizedby']; + pharmacyRemarks = json['PharmacyRemarks']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['CS'] = this.cS; + data['IHR'] = this.iHR; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AccessLevel'] = this.accessLevel; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['Description'] = this.description; + data['AdmissionNo'] = this.admissionNo; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['LineItemNo'] = this.lineItemNo; + data['ItemID'] = this.itemID; + data['Medication'] = this.medication; + data['DoctorComments'] = this.doctorComments; + data['StartDatetime'] = this.startDatetime; + data['StopDatetime'] = this.stopDatetime; + data['Status'] = this.status; + data['CreatedBy'] = this.createdBy; + data['Authorizedby'] = this.authorizedby; + data['PharmacyRemarks'] = this.pharmacyRemarks; + data['StatusDescription'] = this.statusDescription; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index 5178ab14..454559f9 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -3,7 +3,8 @@ class GetOrderedProcedureRequestModel { int patientMRN; int appointmentNo; - GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); + GetOrderedProcedureRequestModel( + {this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); GetOrderedProcedureRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index 1fc797ae..96e13765 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -104,13 +104,16 @@ class ProcedureTempleteDetailsModel { return data; } } + class ProcedureTempleteDetailsModelList { List procedureTemplate = List(); String templateName; int templateId; ProcedureTempleteDetailsModelList( - {this.templateName, this.templateId, ProcedureTempleteDetailsModel template}) { + {this.templateName, + this.templateId, + ProcedureTempleteDetailsModel template}) { procedureTemplate.add(template); } } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index e09f269a..bb50e6bc 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -85,7 +85,8 @@ class FinalRadiology { this.reportDataTextdynamic, this.speciality, this.isCVI, - this.isRadMedicalReport,this.isLiveCareAppodynamicment}); + this.isRadMedicalReport, + this.isLiveCareAppodynamicment}); FinalRadiology.fromJson(Map json) { try { @@ -108,7 +109,7 @@ class FinalRadiology { admissionNo = json['AdmissionNo']; isInOutPatient = json['IsInOutPatient']; actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']?? json['ClinicName']; + clinicDescription = json['ClinicDescription'] ?? json['ClinicName']; dIAPACSURL = json['DIA_PACS_URL']; doctorImageURL = json['DoctorImageURL']; doctorName = json['DoctorName']; @@ -128,13 +129,11 @@ class FinalRadiology { isLiveCareAppodynamicment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextdynamic = json['ReportDataTextdynamic']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; - } catch (e) { print(e); - } } diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart index 9e3458d5..c511a1fc 100644 --- a/lib/core/model/radiology/request_patient_rad_orders_details.dart +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -22,25 +22,25 @@ class RequestPatientRadOrdersDetails { RequestPatientRadOrdersDetails( {this.projectID, - this.orderNo, - this.invoiceNo, - this.setupID, - this.procedureID, - this.isMedicalReport, - this.isCVI, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType}); + this.orderNo, + this.invoiceNo, + this.setupID, + this.procedureID, + this.isMedicalReport, + this.isCVI, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); RequestPatientRadOrdersDetails.fromJson(Map json) { projectID = json['ProjectID']; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6d68653d..fc778571 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -28,31 +28,31 @@ class RequestSendRadReportEmail { RequestSendRadReportEmail( {this.channel, - this.clinicName, - this.dateofBirth, - this.deviceTypeID, - this.doctorName, - this.generalid, - this.invoiceNo, - this.iPAdress, - this.isDentalAllowedBackend, - this.languageID, - this.orderDate, - this.patientID, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.patientOutSA, - this.patientType, - this.patientTypeID, - this.projectID, - this.projectName, - this.radResult, - this.sessionID, - this.setupID, - this.to, - this.tokenID, - this.versionID}); + this.clinicName, + this.dateofBirth, + this.deviceTypeID, + this.doctorName, + this.generalid, + this.invoiceNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.languageID, + this.orderDate, + this.patientID, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.projectID, + this.projectName, + this.radResult, + this.sessionID, + this.setupID, + this.to, + this.tokenID, + this.versionID}); RequestSendRadReportEmail.fromJson(Map json) { channel = json['Channel']; diff --git a/lib/core/model/referral/DischargeReferralPatient.dart b/lib/core/model/referral/DischargeReferralPatient.dart index dff63bfc..84e7dae4 100644 --- a/lib/core/model/referral/DischargeReferralPatient.dart +++ b/lib/core/model/referral/DischargeReferralPatient.dart @@ -55,56 +55,56 @@ class DischargeReferralPatient { DischargeReferralPatient( {this.rowID, - this.projectID, - this.lineItemNo, - this.doctorID, - this.patientID, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomID, - this.bedID, - this.nursingStationID, - this.description, - this.nationalityName, - this.nationalityNameN, - this.referralDoctor, - this.referringDoctor, - this.referralClinic, - this.referringClinic, - this.referralStatus, - this.referralDate, - this.referringDoctorRemarks, - this.referredDoctorRemarks, - this.referralResponseOn, - this.priority, - this.frequency, - this.mAXResponseTime, - this.dischargeDate, - this.clinicID, - this.age, - this.clinicDescription, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName}); + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.dischargeDate, + this.clinicID, + this.age, + this.clinicDescription, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); DischargeReferralPatient.fromJson(Map json) { rowID = json['RowID']; diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 4f00f455..1bba70d7 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -113,27 +113,36 @@ class MyReferralPatientModel { this.referralResponseOn, this.priority, this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource}); + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.referalStatus, + this.sourceSetupID, + this.sourceAppointmentNo, + this.sourceProjectId, + this.targetProjectId, + this.targetAppointmentNo, + this.targetClinicID, + this.targetSetupID, + this.targetDoctorID, + this.remarksFromSource}); MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; @@ -219,7 +228,6 @@ class MyReferralPatientModel { sourceAppointmentNo = json['SourceAppointmentNo']; targetAppointmentNo = json['TargetAppointmentNo']; remarksFromSource = json['RemarksFromSource']; - } Map toJson() { diff --git a/lib/core/model/referral/MyReferralPatientRequestModel.dart b/lib/core/model/referral/MyReferralPatientRequestModel.dart index 08b98a99..437f5a0d 100644 --- a/lib/core/model/referral/MyReferralPatientRequestModel.dart +++ b/lib/core/model/referral/MyReferralPatientRequestModel.dart @@ -25,28 +25,28 @@ class MyReferralPatientRequestModel { MyReferralPatientRequestModel( {this.channel, - this.clinicID, - this.doctorID, - this.editedBy, - this.firstName, - this.from, - this.iPAdress, - this.isLoginForDoctorApp, - this.languageID, - this.lastName, - this.middleName, - this.patientID, - this.patientIdentificationID, - this.patientMobileNumber, - this.patientOutSA, - this.patientTypeID, - this.projectID, - this.sessionID, - this.stamp, - this.to, - this.tokenID, - this.versionID, - this.vidaAuthTokenID}); + this.clinicID, + this.doctorID, + this.editedBy, + this.firstName, + this.from, + this.iPAdress, + this.isLoginForDoctorApp, + this.languageID, + this.lastName, + this.middleName, + this.patientID, + this.patientIdentificationID, + this.patientMobileNumber, + this.patientOutSA, + this.patientTypeID, + this.projectID, + this.sessionID, + this.stamp, + this.to, + this.tokenID, + this.versionID, + this.vidaAuthTokenID}); MyReferralPatientRequestModel.fromJson(Map json) { channel = json['Channel']; diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index b3ad1f03..cf3c20fb 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -26,29 +26,29 @@ class ReferralRequest { ReferralRequest( {this.roomID, - this.referralClinic, - this.referralDoctor, - this.createdBy, - this.editedBy, - this.patientID, - this.patientTypeID, - this.referringClinic, - this.referringDoctor, - this.projectID, - this.admissionNo, - this.referringDoctorRemarks, - this.priority, - this.frequency, - this.extension, - this.languageID, - this.stamp, - this.iPAdress, - this.versionID, - this.channel, - this.tokenID, - this.sessionID, - this.isLoginForDoctorApp, - this.patientOutSA}); + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); ReferralRequest.fromJson(Map json) { roomID = json['RoomID']; diff --git a/lib/core/model/search_drug/get_medication_response_model.dart b/lib/core/model/search_drug/get_medication_response_model.dart index a42a8b47..e48c41fe 100644 --- a/lib/core/model/search_drug/get_medication_response_model.dart +++ b/lib/core/model/search_drug/get_medication_response_model.dart @@ -8,6 +8,7 @@ class GetMedicationResponseModel { dynamic mediSpanGPICode; bool isNarcotic; String uom; + GetMedicationResponseModel( {this.description, this.genericName, diff --git a/lib/core/model/search_drug/search_drug_request_model.dart b/lib/core/model/search_drug/search_drug_request_model.dart index b64e7d18..8548fd32 100644 --- a/lib/core/model/search_drug/search_drug_request_model.dart +++ b/lib/core/model/search_drug/search_drug_request_model.dart @@ -1,5 +1,6 @@ class SearchDrugRequestModel { List search; + // String vidaAuthTokenID; SearchDrugRequestModel({this.search}); diff --git a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart index 26bb76bd..c6837c03 100644 --- a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart @@ -6,7 +6,11 @@ class GetSickLeaveDoctorRequestModel { String vidaRefreshTokenID; GetSickLeaveDoctorRequestModel( - {this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID}); + {this.patientMRN, + this.appointmentNo, + this.status, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); GetSickLeaveDoctorRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 1e79833c..d4c15368 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -1,5 +1,3 @@ -import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; - class SickLeavePatientModel { dynamic setupID; dynamic projectID; @@ -32,6 +30,7 @@ class SickLeavePatientModel { dynamic patientName; dynamic projectName; dynamic qR; + // List speciality; dynamic strRequestDate; dynamic startDate; diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/core/model/sickleave/add_sickleave_request.dart similarity index 100% rename from lib/models/sickleave/add_sickleave_request.dart rename to lib/core/model/sickleave/add_sickleave_request.dart diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/core/model/sickleave/extend_sick_leave_request.dart similarity index 100% rename from lib/models/sickleave/extend_sick_leave_request.dart rename to lib/core/model/sickleave/extend_sick_leave_request.dart diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/core/model/sickleave/get_all_sickleave_response.dart similarity index 99% rename from lib/models/sickleave/get_all_sickleave_response.dart rename to lib/core/model/sickleave/get_all_sickleave_response.dart index de831213..cc8f489c 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/core/model/sickleave/get_all_sickleave_response.dart @@ -8,6 +8,7 @@ class GetAllSickLeaveResponse { String startDate; int status; String statusDescription; + GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, diff --git a/lib/models/sickleave/sick_leave_statisitics_model.dart b/lib/core/model/sickleave/sick_leave_statisitics_model.dart similarity index 91% rename from lib/models/sickleave/sick_leave_statisitics_model.dart rename to lib/core/model/sickleave/sick_leave_statisitics_model.dart index f679807c..aa715e3f 100644 --- a/lib/models/sickleave/sick_leave_statisitics_model.dart +++ b/lib/core/model/sickleave/sick_leave_statisitics_model.dart @@ -5,8 +5,8 @@ class SickLeaveStatisticsModel { SickLeaveStatisticsModel( {this.recommendedSickLeaveDays, - this.totalLeavesByAllClinics, - this.totalLeavesByDoctor}); + this.totalLeavesByAllClinics, + this.totalLeavesByDoctor}); SickLeaveStatisticsModel.fromJson(Map json) { recommendedSickLeaveDays = json['recommendedSickLeaveDays']; diff --git a/lib/core/model/vte_assessment/vte_assessment_req_model.dart b/lib/core/model/vte_assessment/vte_assessment_req_model.dart new file mode 100644 index 00000000..1f0bd1fa --- /dev/null +++ b/lib/core/model/vte_assessment/vte_assessment_req_model.dart @@ -0,0 +1,22 @@ +class VteAssessmentRequestModel { + String setupID; + int parameterGroup; + int transactionNo; + + VteAssessmentRequestModel( + {this.setupID = "010266", this.parameterGroup = 7, this.transactionNo}); + + VteAssessmentRequestModel.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + transactionNo = json['TransactionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['TransactionNo'] = this.transactionNo; + return data; + } +} diff --git a/lib/core/model/vte_assessment/vte_assessment_res_model.dart b/lib/core/model/vte_assessment/vte_assessment_res_model.dart new file mode 100644 index 00000000..8bd2c441 --- /dev/null +++ b/lib/core/model/vte_assessment/vte_assessment_res_model.dart @@ -0,0 +1,48 @@ +class VteAssessmentResponseModel { + int lineItemNo; + String vTEType; + String ambulationProtocol; + String pharmacology; + String reasonsThrombo; + String riskScore; + int totalScore; + int createdBy; + String createdOn; + + VteAssessmentResponseModel( + {this.lineItemNo, + this.vTEType, + this.ambulationProtocol, + this.pharmacology, + this.reasonsThrombo, + this.riskScore, + this.totalScore, + this.createdBy, + this.createdOn}); + + VteAssessmentResponseModel.fromJson(Map json) { + lineItemNo = json['LineItemNo']; + vTEType = json['VTE_Type']; + ambulationProtocol = json['AmbulationProtocol']; + pharmacology = json['Pharmacology']; + reasonsThrombo = json['ReasonsThrombo']; + riskScore = json['Risk_Score']; + totalScore = json['Total_Score']; + createdBy = json['Created_By']; + createdOn = json['Created_On']; + } + + Map toJson() { + final Map data = new Map(); + data['LineItemNo'] = this.lineItemNo; + data['VTE_Type'] = this.vTEType; + data['AmbulationProtocol'] = this.ambulationProtocol; + data['Pharmacology'] = this.pharmacology; + data['ReasonsThrombo'] = this.reasonsThrombo; + data['Risk_Score'] = this.riskScore; + data['Total_Score'] = this.totalScore; + data['Created_By'] = this.createdBy; + data['Created_On'] = this.createdOn; + return data; + } +} diff --git a/lib/core/provider/robot_provider.dart b/lib/core/provider/robot_provider.dart index a01b1318..4a6f2826 100644 --- a/lib/core/provider/robot_provider.dart +++ b/lib/core/provider/robot_provider.dart @@ -8,6 +8,7 @@ class RobotProvider { getData() { // return data; } + intStream() { controller.add({}); } diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index 0ad669ab..e194ed9a 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -5,9 +5,11 @@ import 'package:flutter/cupertino.dart'; class AnalyticsService { final FirebaseAnalytics _analytics = FirebaseAnalytics(); - FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics); + FirebaseAnalyticsObserver getAnalyticsObserver() => + FirebaseAnalyticsObserver(analytics: _analytics); - Future logEvent({@required String eventCategory, @required String eventAction}) async { + Future logEvent( + {@required String eventCategory, @required String eventAction}) async { await _analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 5690c01e..b94306b9 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -2,25 +2,28 @@ import 'package:flutter/material.dart'; class NavigationService { final GlobalKey navigatorKey = - new GlobalKey(); - Future navigateTo(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushNamed(routeName,arguments: arguments); - } + new GlobalKey(); - Future pushReplacementNamed(String routeName,{Object arguments}) { - return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments); + Future navigateTo(String routeName, {Object arguments}) { + return navigatorKey.currentState.pushNamed(routeName, arguments: arguments); } + Future pushReplacementNamed(String routeName, {Object arguments}) { + return navigatorKey.currentState + .pushReplacementNamed(routeName, arguments: arguments); + } Future pushNamedAndRemoveUntil(String routeName) { - return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); + return navigatorKey.currentState + .pushNamedAndRemoveUntil(routeName, (asd) => false); } Future pushAndRemoveUntil(Route newRoute) { - return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); + return navigatorKey.currentState + .pushAndRemoveUntil(newRoute, (asd) => false); } - pop() { + pop() { return navigatorKey.currentState.pop(); } -} \ No newline at end of file +} diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 236bcd42..d9ad718f 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -63,7 +63,7 @@ class PatientRegistrationService extends BaseService { isDentalAllowedBackend: false, projectOutSA: 0, searchType: 1, - versionID: 7.1, + versionID: 7.1, channel: 3, nationalID: model.checkPatientForRegistrationModel.patientIdentificationID, @@ -74,8 +74,9 @@ class PatientRegistrationService extends BaseService { logInTokenID: logInTokenID); hasError = false; - await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient + .post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION, + onSuccess: (dynamic response, int statusCode) { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( response); diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 31cc2cd6..6fdbf045 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -22,17 +22,21 @@ class VideoCallService extends BaseService { LiveCarePatientServices _liveCarePatientServices = locator(); - openVideo(StartCallRes startModel, PatiantInformtion patientModel, - bool isRecording,VoidCallback onCallConnected, VoidCallback onCallDisconnected) async { + openVideo( + StartCallRes startModel, + PatiantInformtion patientModel, + bool isRecording, + VoidCallback onCallConnected, + VoidCallback onCallDisconnected) async { this.startCallRes = startModel; this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - // TODO MOSA TEST - kToken: startCallRes.openTokenID, - kSessionId: startCallRes.openSessionID, - kApiKey:'46209962', + // TODO MOSA TEST + kToken: startCallRes.openTokenID, + kSessionId: startCallRes.openSessionID, + kApiKey: '46209962', // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", // kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg", // kApiKey:'47247954', @@ -57,7 +61,6 @@ class VideoCallService extends BaseService { endCall( patient.vcId, false, - ).then((value) { GifLoaderDialogUtils.hideDialog( locator().navigatorKey.currentContext); diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 49e89881..4de0a7e4 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -8,32 +8,42 @@ import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/doctor/user_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'; class AuthenticationService extends BaseService { List _imeiDetails = []; + List get dashboardItemsList => _imeiDetails; NewLoginInformationModel _loginInfo = NewLoginInformationModel(); - NewLoginInformationModel get loginInfo => _loginInfo; - SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); - - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes; - - SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); - SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); - - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; + NewLoginInformationModel get loginInfo => _loginInfo; + SendActivationCodeForDoctorAppResponseModel + _activationCodeVerificationScreenRes = + SendActivationCodeForDoctorAppResponseModel(); + + SendActivationCodeForDoctorAppResponseModel + get activationCodeVerificationScreenRes => + _activationCodeVerificationScreenRes; + + SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = + SendActivationCodeForDoctorAppResponseModel(); + + SendActivationCodeForDoctorAppResponseModel + get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel + _checkActivationCodeForDoctorAppRes = + CheckActivationCodeForDoctorAppResponseModel(); + + CheckActivationCodeForDoctorAppResponseModel + get checkActivationCodeForDoctorAppRes => + _checkActivationCodeForDoctorAppRes; Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; - List get doctorProfilesList => _doctorProfilesList; - - + List get doctorProfilesList => _doctorProfilesList; Future selectDeviceImei(imei) async { try { @@ -68,94 +78,99 @@ class AuthenticationService extends BaseService { hasError = true; super.error = error; } - } - Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { + Future sendActivationCodeVerificationScreen( + ActivationCodeForVerificationScreenModel activationCodeModel) async { hasError = false; - _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); + _activationCodeVerificationScreenRes = + SendActivationCodeForDoctorAppResponseModel(); try { await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) { - _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + _activationCodeVerificationScreenRes = + SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; super.error = error; } - } - Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel)async { + Future sendActivationCodeForDoctorApp( + ActivationCodeModel activationCodeModel) async { hasError = false; - _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); + _activationCodeForDoctorAppRes = + SendActivationCodeForDoctorAppResponseModel(); try { await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: activationCodeModel.toJson()); + _activationCodeForDoctorAppRes = + SendActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; super.error = error; } } - Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel)async { + Future checkActivationCodeForDoctorApp( + CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { hasError = false; - _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); + _checkActivationCodeForDoctorAppRes = + CheckActivationCodeForDoctorAppResponseModel(); try { await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: checkActivationCodeRequestModel.toJson()); + _checkActivationCodeForDoctorAppRes = + CheckActivationCodeForDoctorAppResponseModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; super.error = error; } - } - - Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel)async { + Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { hasError = false; - // insertIMEIDetailsModel.tokenID = "@dm!n"; + // insertIMEIDetailsModel.tokenID = "@dm!n"; _insertDeviceImeiRes = {}; try { await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - _insertDeviceImeiRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: insertIMEIDetailsModel.toJson()); + _insertDeviceImeiRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; super.error = error; } } - Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel)async { + Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { hasError = false; try { await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { - _doctorProfilesList.clear(); - response['DoctorProfileList'].forEach((v) { - _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: profileReqModel.toJson()); + _doctorProfilesList.clear(); + response['DoctorProfileList'].forEach((v) { + _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: profileReqModel.toJson()); } catch (error) { hasError = true; super.error = error; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 58526da7..9334a61b 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { @@ -13,14 +13,14 @@ class BaseService { List patientArrivalList = []; - BaseService(){ + BaseService() { doctorProfile = null; } //TODO add the user login model when we need it - Future getDoctorProfile({bool isGetProfile = false}) async { - if(isGetProfile) - { + Future getDoctorProfile( + {bool isGetProfile = false}) async { + if (isGetProfile) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = DoctorProfileModel.fromJson(profile); @@ -42,6 +42,4 @@ class BaseService { return doctorProfile; } } - - } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 7f277fa8..f68aa01a 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'base_service.dart'; @@ -17,6 +17,7 @@ class LookupService extends BaseService { List medicationFrequencyList = []; List medicationDoseTimeList = []; List medicationIndicationsList = []; + // TODO make the person who create the list dynamic to change it. List medicationStrengthListWithModel = []; List medicationFrequencyListWithModel = []; @@ -52,7 +53,7 @@ class LookupService extends BaseService { List listOfTemperatureMethods = []; List listOfSpeciality = []; List listOfAdmissionType = []; - List listOfDiagnosisSelectionTypes = []; + List listOfDiagnosisSelectionTypes = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index ad3ec887..43d76c80 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; class DashboardService extends BaseService { List _dashboardItemsList = []; + List get dashboardItemsList => _dashboardItemsList; - bool hasVirtualClinic = false; String sServiceID; @@ -25,14 +24,13 @@ class DashboardService extends BaseService { hasError = true; super.error = error; }, - body: { - }, + body: {}, ); } Future checkDoctorHasLiveCare() async { hasError = false; - await getDoctorProfile(isGetProfile: true); + await getDoctorProfile(isGetProfile: true); await baseAppClient.post( DOCTOR_CHECK_HAS_LIVE_CARE, onSuccess: (dynamic response, int statusCode) { @@ -44,9 +42,8 @@ class DashboardService extends BaseService { super.error = error; }, body: { - "DoctorID": doctorProfile?.doctorID// test user 9920 + "DoctorID": doctorProfile?.doctorID // test user 9920 }, ); } - } diff --git a/lib/core/service/home/doctor_reply_service.dart b/lib/core/service/home/doctor_reply_service.dart index c3f4584d..c9561bf7 100644 --- a/lib/core/service/home/doctor_reply_service.dart +++ b/lib/core/service/home/doctor_reply_service.dart @@ -1,15 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; -import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; class DoctorReplyService extends BaseService { List get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable; + List get listDoctorNotRepliedQuestions => _listDoctorNotRepliedQuestions; List _listDoctorWorkingHoursTable = []; @@ -27,20 +26,19 @@ class DoctorReplyService extends BaseService { GT_MY_PATIENT_QUESTION, onSuccess: (dynamic response, int statusCode) { if (clearData) { - if(isGettingNotReply) + if (isGettingNotReply) _listDoctorNotRepliedQuestions.clear(); - else - _listDoctorWorkingHoursTable.clear(); + else + _listDoctorWorkingHoursTable.clear(); } - response['List_GtMyPatientsQuestions'].forEach((v) { - - if(isGettingNotReply) - _listDoctorNotRepliedQuestions.add(ListGtMyPatientsQuestions.fromJson(v)); + if (isGettingNotReply) + _listDoctorNotRepliedQuestions + .add(ListGtMyPatientsQuestions.fromJson(v)); else - _listDoctorWorkingHoursTable - .add(ListGtMyPatientsQuestions.fromJson(v)); + _listDoctorWorkingHoursTable + .add(ListGtMyPatientsQuestions.fromJson(v)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index b21768f9..dac56e17 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -1,13 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class ScanQrService extends BaseService { List myInPatientList = List(); List inPatientList = List(); - Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { + Future getInPatient( + PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); diff --git a/lib/core/service/home/schedule_service.dart b/lib/core/service/home/schedule_service.dart index 1776b470..f884516f 100644 --- a/lib/core/service/home/schedule_service.dart +++ b/lib/core/service/home/schedule_service.dart @@ -1,19 +1,19 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; -import 'package:doctor_app_flutter/models/doctor/request_schedule.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'; class ScheduleService extends BaseService { - - List get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => + _listDoctorWorkingHoursTable; List _listDoctorWorkingHoursTable = []; - RequestSchedule _requestSchedule = RequestSchedule(); + Future getDoctorSchedule() async { await baseAppClient.post(GET_DOCTOR_WORKING_HOURS_TABLE, onSuccess: (dynamic response, int statusCode) { - _listDoctorWorkingHoursTable.clear(); + _listDoctorWorkingHoursTable.clear(); response['List_DoctorWorkingHoursTable'].forEach((v) { _listDoctorWorkingHoursTable .add(ListDoctorWorkingHoursTable.fromJson(v)); @@ -21,6 +21,6 @@ class ScheduleService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestSchedule.toJson(),isFallLanguage: true); + }, body: _requestSchedule.toJson(), isFallLanguage: true); } } diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index f8a7579d..96267d01 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -4,8 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - -List hospitals =List(); + List hospitals = List(); Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 2b353016..c270be8e 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { List myDischargedPatients = List(); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 10af0ea2..bdf8d1b5 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDocto import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart'; import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class LiveCarePatientServices extends BaseService { List _patientList = []; @@ -35,7 +35,8 @@ class LiveCarePatientServices extends BaseService { StartCallRes get startCallRes => _startCallRes; Future getPendingPatientERForDoctorApp( - PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async { + PendingPatientERForDoctorAppRequestModel + pendingPatientERForDoctorAppRequestModel) async { hasError = false; await baseAppClient.post( GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, @@ -48,7 +49,10 @@ class LiveCarePatientServices extends BaseService { /// add new items. localPatientList.forEach((element) { - if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((_patientList.singleWhere( + (it) => it.patientId == element.patientId, + orElse: () => null)) == + null) { _patientList.add(element); } }); @@ -56,7 +60,10 @@ class LiveCarePatientServices extends BaseService { /// remove items. List removedPatientList = []; _patientList.forEach((element) { - if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((localPatientList.singleWhere( + (it) => it.patientId == element.patientId, + orElse: () => null)) == + null) { removedPatientList.add(element); } }); @@ -85,7 +92,8 @@ class LiveCarePatientServices extends BaseService { Future startCall(StartCallReq startCallReq) async { hasError = false; - await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async { + await baseAppClient.post(START_LIVE_CARE_CALL, + onSuccess: (response, statusCode) async { _startCallRes = StartCallRes.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -95,17 +103,23 @@ class LiveCarePatientServices extends BaseService { Future endCallWithCharge(int vcID, List altServiceList) async { hasError = false; - await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(END_CALL_WITH_CHARGE, + onSuccess: (dynamic response, int statusCode) { endCallResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive); + }, body: { + "VC_ID": vcID, + "AltServiceList": altServiceList, + "generalid": GENERAL_ID + }, isLiveCare: _isLive); } Future transferToAdmin(int vcID, String notes) async { hasError = false; - await baseAppClient.post(TRANSFERT_TO_ADMIN, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(TRANSFERT_TO_ADMIN, + onSuccess: (dynamic response, int statusCode) { transferToAdminResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; @@ -119,7 +133,8 @@ class LiveCarePatientServices extends BaseService { Future sendSMSInstruction(int vcID) async { hasError = false; - await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEND_SMS_INSTRUCTIONS, + onSuccess: (dynamic response, int statusCode) { transferToAdminResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; @@ -127,11 +142,14 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { + Future isLogin( + {LiveCareUserLoginRequestModel isLoginRequestModel, + int loginStatus}) async { hasError = false; await getDoctorProfile(); isLoginRequestModel.doctorId = super.doctorProfile.doctorID; - await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { + await baseAppClient.post(LIVE_CARE_IS_LOGIN, + onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; @@ -143,7 +161,8 @@ class LiveCarePatientServices extends BaseService { hasError = false; alternativeServicesList.clear(); - await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALTERNATIVE_SERVICE, + onSuccess: (dynamic response, int statusCode) { response['AlternativeServicesList'].forEach((v) { alternativeServicesList.add(AlternativeService.fromJson(v)); }); @@ -156,14 +175,16 @@ class LiveCarePatientServices extends BaseService { Future addPatientToDoctorList({int vcID}) async { hasError = false; await getDoctorProfile(); - AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); + AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = + AddPatientToDoctorListRequestModel(); addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; - await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async { + await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, + onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; @@ -173,14 +194,16 @@ class LiveCarePatientServices extends BaseService { Future removePatientFromDoctorList({int vcID}) async { hasError = false; - AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); + AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = + AddPatientToDoctorListRequestModel(); await getDoctorProfile(); addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; - await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async { + await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, + onSuccess: (response, statusCode) async { isLoginResponse = response; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 35729def..18146986 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.da import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; +import 'package:doctor_app_flutter/core/model/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { List myReferralPatients = List(); @@ -12,19 +12,20 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); - MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, - firstName: "0", - middleName: "0", - lastName: "0", - patientMobileNumber: "0", - patientIdentificationID: "0", - patientID: 0, - from: "0", - to: "0", - stamp: DateTime.now().toIso8601String(), - isLoginForDoctorApp: true, - patientTypeID: 1); + MyReferralPatientRequestModel myReferralPatientRequestModel = + MyReferralPatientRequestModel( + doctorID: doctorProfile.doctorID, + firstName: "0", + middleName: "0", + lastName: "0", + patientMobileNumber: "0", + patientIdentificationID: "0", + patientID: 0, + from: "0", + to: "0", + stamp: DateTime.now().toIso8601String(), + isLoginForDoctorApp: true, + patientTypeID: 1); myReferralPatients.clear(); await baseAppClient.post( GET_MY_REFERRAL_INPATIENT, @@ -47,19 +48,20 @@ class MyReferralInPatientService extends BaseService { hasError = false; await getDoctorProfile(); - MyReferralPatientRequestModel myReferralPatientRequestModel = MyReferralPatientRequestModel( - doctorID: doctorProfile.doctorID, - firstName: "0", - middleName: "0", - lastName: "0", - patientMobileNumber: "0", - patientIdentificationID: "0", - patientID: 0, - from: "0", - to: "0", - stamp: DateTime.now().toIso8601String(), - isLoginForDoctorApp: true, - patientTypeID: 1); + MyReferralPatientRequestModel myReferralPatientRequestModel = + MyReferralPatientRequestModel( + doctorID: doctorProfile.doctorID, + firstName: "0", + middleName: "0", + lastName: "0", + patientMobileNumber: "0", + patientIdentificationID: "0", + patientID: 0, + from: "0", + to: "0", + stamp: DateTime.now().toIso8601String(), + isLoginForDoctorApp: true, + patientTypeID: 1); myReferralPatients.clear(); await baseAppClient.post( GET_MY_REFERRAL_OUT_PATIENT, @@ -78,14 +80,18 @@ class MyReferralInPatientService extends BaseService { ); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay( + String referredDoctorRemarks, MyReferralPatientModel referral) async { hasError = false; await getDoctorProfile(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = + RequestAddReferredDoctorRemarks(); _requestAddReferredDoctorRemarks.projectID = referral.projectID; - _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.admissionNo = + referral.admissionNo.toString(); _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = + referredDoctorRemarks; _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.patientID = referral.patientID; _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; @@ -100,20 +106,24 @@ class MyReferralInPatientService extends BaseService { ); } - Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async { + Future replayReferred(String referredDoctorRemarks, + MyReferralPatientModel referral, int referralStatus) async { hasError = false; await getDoctorProfile(); - AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( - editedBy: doctorProfile.doctorID, - projectID: doctorProfile.projectID, - referredDoctorRemarks: referredDoctorRemarks, - referalStatus: referralStatus); + AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = + AddReferredRemarksRequestModel( + editedBy: doctorProfile.doctorID, + projectID: doctorProfile.projectID, + referredDoctorRemarks: referredDoctorRemarks, + referalStatus: referralStatus); _requestAddReferredDoctorRemarks.projectID = referral.projectID; //TODO Check this in case out patient - _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo); + _requestAddReferredDoctorRemarks.admissionNo = + int.parse(referral.admissionNo); _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = + referredDoctorRemarks; _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; _requestAddReferredDoctorRemarks.referalStatus = referralStatus; diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 004bb59f..74db4453 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -1,10 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class OutPatientService extends BaseService { List _patientList = []; + List get patientList => _patientList; Future getOutPatient( diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 5b659631..b61e18b9 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/clinic-doctor.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/request_my_referral_patient_model.dart'; import '../base/lookup-service.dart'; @@ -161,7 +161,7 @@ class PatientReferralService extends LookupService { Future getMyReferredOutPatient() async { hasError = false; RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); + RequestMyReferralPatientModel(); DoctorProfileModel doctorProfile = await getDoctorProfile(); await baseAppClient.post( diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index bc7f1283..86e7d236 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { List inPatientList = List(); @@ -27,7 +27,7 @@ class PatientInPatientService extends BaseService { response['List_MyInPatient'].forEach((v) { PatiantInformtion patient = PatiantInformtion.fromJson(v); inPatientList.add(patient); - if(patient.doctorId == doctorProfile.doctorID){ + if (patient.doctorId == doctorProfile.doctorID) { myInPatientList.add(patient); } }); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index f79e342c..7db9fd1b 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -5,27 +5,29 @@ import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartVal import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/stp_master_list_req_model.dart'; +import 'package:doctor_app_flutter/core/model/note/stp_master_list_res_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_list_stp_referral_frequency_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/radiology/radiology_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/refer_to_doctor_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart'; -import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; class PatientService extends BaseService { List _patientVitalSignList = []; @@ -37,12 +39,15 @@ class PatientService extends BaseService { List _patientLabResultOrdersList = []; - List get patientLabResultOrdersList => _patientLabResultOrdersList; + List get patientLabResultOrdersList => + _patientLabResultOrdersList; - List get patientPrescriptionsList => _patientPrescriptionsList; + List get patientPrescriptionsList => + _patientPrescriptionsList; List _patientPrescriptionsList = []; - List get prescriptionReportForInPatientList => _prescriptionReportForInPatientList; + List get prescriptionReportForInPatientList => + _prescriptionReportForInPatientList; List _prescriptionReportForInPatientList = []; List _patientRadiologyList = []; @@ -63,14 +68,19 @@ class PatientService extends BaseService { List _patientNursingProgressNoteList = []; - List get patientNursingProgressNoteList => _patientNursingProgressNoteList; + List get patientNursingProgressNoteList => + _patientNursingProgressNoteList; List _diagnosisForInPatientList = []; - List get diagnosisForInPatientList => _diagnosisForInPatientList; + List get diagnosisForInPatientList => + _diagnosisForInPatientList; List _diabeticChartValuesList = []; - List get diabeticChartValuesList => _diabeticChartValuesList; + List get diabeticChartValuesList => + _diabeticChartValuesList; + + List stpMasterList = []; // TODO: replace var with model var _insuranceApporvalsList = []; @@ -96,9 +106,12 @@ class PatientService extends BaseService { get referalFrequancyList => _referalFrequancyList; - DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest(); - STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest(); - ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest(); + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = + DoctorsByClinicIdRequest(); + STPReferralFrequencyRequest _referralFrequencyRequest = + STPReferralFrequencyRequest(); + ClinicByProjectIdRequest _clinicByProjectIdRequest = + ClinicByProjectIdRequest(); ReferToDoctorRequest _referToDoctorRequest; Future getPatientList(patient, patientType, {isView}) async { @@ -152,7 +165,8 @@ class PatientService extends BaseService { return Future.value(localRes); } - Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async { + Future getInPatient( + PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; await getDoctorProfile(); @@ -227,7 +241,8 @@ class PatientService extends BaseService { onSuccess: (dynamic response, int statusCode) { _prescriptionReportForInPatientList = []; response['List_PrescriptionReportForInPatient'].forEach((v) { - prescriptionReportForInPatientList.add(PrescriptionReportForInPatient.fromJson(v)); + prescriptionReportForInPatientList + .add(PrescriptionReportForInPatient.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -259,7 +274,7 @@ class PatientService extends BaseService { Future getPatientRadiology(patient) async { hasError = false; await baseAppClient.post( - GET_RADIOLOGY, + GET_IN_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { _patientRadiologyList = []; response['List_GetRadOreders'].forEach((v) { @@ -482,8 +497,9 @@ class PatientService extends BaseService { ); } - - Future getNursingProgressNote(GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel) async { + Future getNursingProgressNote( + GetNursingProgressNoteRequestModel + getNursingProgressNoteRequestModel) async { hasError = false; await baseAppClient.post( @@ -491,7 +507,8 @@ class PatientService extends BaseService { onSuccess: (dynamic response, int statusCode) { _patientNursingProgressNoteList = []; response['List_NursingProgressNote'].forEach((v) { - _patientNursingProgressNoteList.add( GetNursingProgressNoteResposeModel.fromJson(v)); + _patientNursingProgressNoteList + .add(GetNursingProgressNoteResposeModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -502,7 +519,9 @@ class PatientService extends BaseService { ); } - Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel) async { + Future getDiagnosisForInPatient( + GetDiagnosisForInPatientRequestModel + getDiagnosisForInPatientRequestModel) async { hasError = false; await baseAppClient.post( @@ -510,7 +529,8 @@ class PatientService extends BaseService { onSuccess: (dynamic response, int statusCode) { _diagnosisForInPatientList = []; response['List_DiagnosisForInPatient'].forEach((v) { - _diagnosisForInPatientList.add( GetDiagnosisForInPatientResponseModel.fromJson(v)); + _diagnosisForInPatientList + .add(GetDiagnosisForInPatientResponseModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -521,8 +541,9 @@ class PatientService extends BaseService { ); } - - Future getDiabeticChartValues(GetDiabeticChartValuesRequestModel getDiabeticChartValuesRequestModel) async { + Future getDiabeticChartValues( + GetDiabeticChartValuesRequestModel + getDiabeticChartValuesRequestModel) async { hasError = false; await baseAppClient.post( @@ -530,7 +551,8 @@ class PatientService extends BaseService { onSuccess: (dynamic response, int statusCode) { _diabeticChartValuesList = []; response['List_DiabeticChartValues'].forEach((v) { - _diabeticChartValuesList.add( GetDiabeticChartValuesResponseModel.fromJson(v)); + _diabeticChartValuesList + .add(GetDiabeticChartValuesResponseModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -540,4 +562,22 @@ class PatientService extends BaseService { body: getDiabeticChartValuesRequestModel.toJson(), ); } + + Future getStpMasterList( + StpMasterListRequestModel stpMasterListRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_STP_MASTER_LIST, + onSuccess: (dynamic response, int statusCode) { + stpMasterList = []; + stpMasterList = response['List_STPMasterList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: stpMasterListRequestModel.toJson(), + ); + } } diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index a92ef0eb..2b3476a3 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -1,19 +1,16 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; class DischargeSummaryService extends BaseService { List _pendingDischargeSummaryList = []; + List get pendingDischargeSummaryList => _pendingDischargeSummaryList; List _allDischargeSummaryList = []; + List get allDischargeSummaryList => _allDischargeSummaryList; diff --git a/lib/core/service/patient/profile/intervention_medication_service.dart b/lib/core/service/patient/profile/intervention_medication_service.dart new file mode 100644 index 00000000..a48a560e --- /dev/null +++ b/lib/core/service/patient/profile/intervention_medication_service.dart @@ -0,0 +1,66 @@ +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/pharmacy-intervention-model/accept_or_reject_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_res_model.dart'; +class InterventionMedicationService extends BaseService { + + List _allInterventionList = []; + + List _allInterventionHistoryList = []; + + List get allInterventionList => + _allInterventionList; + + List get allInterventionHistoryList => + _allInterventionHistoryList; + + Future getInterventionMedication( + {InterventionMedicationReqModel interventionMedicationReqModel}) async { + hasError = false; + await baseAppClient.post(GET_INTERVENTION_MEDICATION, + onSuccess: (dynamic response, int statusCode) { + _allInterventionList.clear(); + response['List_InterventionMedications'].forEach( + (v) { + _allInterventionList.add(InterventionMedicationResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: interventionMedicationReqModel.toJson()); + } + + Future getInterventionMedicationHistory( + {InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel}) async { + hasError = false; + await baseAppClient.post(GET_INTERVENTION_MEDICATION_HISTORY, + onSuccess: (dynamic response, int statusCode) { + _allInterventionHistoryList.clear(); + response['List_InterventionHistory'].forEach( + (v) { + _allInterventionHistoryList.add(InterventionMedicationHistoryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: interventionMedicationHistoryReqModel.toJson()); + } + + Future setAcceptedOrRejected( + {AcceptOrRejectReqModel acceptOrRejectReqModel}) async { + hasError = false; + await baseAppClient.post(SET_ACCEPTED_OR_REJECTED, + onSuccess: (dynamic response, int statusCode) { + _allInterventionHistoryList.clear(); + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: acceptOrRejectReqModel.toJson()); + } +} diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 7ac4ade7..0ef6a503 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -1,17 +1,20 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_request_model.dart'; class OperationReportService extends BaseService { List _reservationList = []; + List get reservationList => _reservationList; List _operationDetailsList = []; - List get operationDetailsList => _operationDetailsList; + + List get operationDetailsList => + _operationDetailsList; Future getReservations( {GetReservationsRequestModel getReservationsRequestModel, @@ -35,10 +38,9 @@ class OperationReportService extends BaseService { }, body: getReservationsRequestModel.toJson()); } - Future getOperationReportDetails( - {GetOperationDetailsRequestModel getOperationReportRequestModel, - }) async { - + Future getOperationReportDetails({ + GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { hasError = false; await baseAppClient.post(GET_OPERATION_DETAILS, onSuccess: (dynamic response, int statusCode) { @@ -46,7 +48,8 @@ class OperationReportService extends BaseService { _operationDetailsList.clear(); response['List_OperationDetails'].forEach( (v) { - _operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v)); + _operationDetailsList + .add(GetOperationDetailsResponseModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient/profile/vte_assessment_service.dart b/lib/core/service/patient/profile/vte_assessment_service.dart new file mode 100644 index 00000000..651f2b50 --- /dev/null +++ b/lib/core/service/patient/profile/vte_assessment_service.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; + +class VteAssessmentService extends BaseService { + + List _allVteHistoryList = []; + + List get allVteHistoryList => + _allVteHistoryList; + Future getVteAssessment( + {VteAssessmentRequestModel vteAssessmentRequestModel}) async { + hasError = false; + await baseAppClient.post(VTE_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + _allVteHistoryList.clear(); + response['INP_VTEHistoryByTransactionNo_List'].forEach( + (v) { + _allVteHistoryList.add(VteAssessmentResponseModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: vteAssessmentRequestModel.toJson()); + } +} diff --git a/lib/core/service/patient/referral_patient_service.dart b/lib/core/service/patient/referral_patient_service.dart index 9fc163bd..2e79d41e 100644 --- a/lib/core/service/patient/referral_patient_service.dart +++ b/lib/core/service/patient/referral_patient_service.dart @@ -1,48 +1,58 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/request_add_referred_doctor_remarks.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/request_my_referral_patient_model.dart'; class ReferralPatientService extends BaseService { - List _listMyReferralPatientModel = []; - List get listMyReferralPatientModel => _listMyReferralPatientModel; + List get listMyReferralPatientModel => + _listMyReferralPatientModel; - RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + RequestMyReferralPatientModel _requestMyReferralPatient = + RequestMyReferralPatientModel(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = + RequestAddReferredDoctorRemarks(); Future getMyReferralPatient() async { - await baseAppClient.post(GET_MY_REFERRAL_PATIENT, - onSuccess: (dynamic response, int statusCode) { - _listMyReferralPatientModel.clear(); - response['List_MyReferralPatient'].forEach((v) { - listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v)); - }); - print(response['List_MyReferralPatient']); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestMyReferralPatient .toJson(),); + await baseAppClient.post( + GET_MY_REFERRAL_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _listMyReferralPatientModel.clear(); + response['List_MyReferralPatient'].forEach((v) { + listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v)); + }); + print(response['List_MyReferralPatient']); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _requestMyReferralPatient.toJson(), + ); } Future replay( String referredDoctorRemarks, MyReferralPatientModel model) async { - _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo; _requestAddReferredDoctorRemarks.patientID = model.patientID; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = + referredDoctorRemarks; _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; - await baseAppClient.post(GET_MY_REFERRAL_PATIENT, - onSuccess: (dynamic response, int statusCode) { - model.referredDoctorRemarks = referredDoctorRemarks; - listMyReferralPatientModel[ - listMyReferralPatientModel.indexOf(model)] = model; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestMyReferralPatient .toJson(),); + await baseAppClient.post( + GET_MY_REFERRAL_PATIENT, + onSuccess: (dynamic response, int statusCode) { + model.referredDoctorRemarks = referredDoctorRemarks; + listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] = + model; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _requestMyReferralPatient.toJson(), + ); } } diff --git a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart index c97f8426..6a38b1fd 100644 --- a/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart +++ b/lib/core/service/patient_medical_file/admission_request/patient-admission-request-service.dart @@ -14,7 +14,6 @@ class AdmissionRequestService extends LookupService { List dietTypesList = []; List icdCodes = []; - setSpecialityList() { specialityList.clear(); listOfSpeciality.forEach((element) { @@ -199,8 +198,8 @@ class AdmissionRequestService extends LookupService { if (response['ICDCodesList'] != null) { icdCodes.addAll(response['ICDCodesList']); // response['ICDCodesList'].forEach((v) { - // diagnosisTypesList.add(MasterKeyModel.fromJson(v)); - // icdCodes.add(v); + // diagnosisTypesList.add(MasterKeyModel.fromJson(v)); + // icdCodes.add(v); // }); } }, @@ -212,7 +211,7 @@ class AdmissionRequestService extends LookupService { ); } - Future makeAdmissionRequest(AdmissionRequest admissionRequest) async{ + Future makeAdmissionRequest(AdmissionRequest admissionRequest) async { hasError = false; Map body = Map(); @@ -230,5 +229,4 @@ class AdmissionRequestService extends LookupService { body: body, ); } - } diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 2bb9dac7..1fcc4f78 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart'; import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart'; import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( @@ -17,9 +17,11 @@ class InsuranceCardService extends BaseService { InsuranceApprovalInPatientRequestModel(); List _insuranceApproval = List(); + List get insuranceApproval => _insuranceApproval; List _insuranceApprovalInPatient = List(); + List get insuranceApprovalInPatient => _insuranceApprovalInPatient; @@ -32,7 +34,7 @@ class InsuranceCardService extends BaseService { hasError = false; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, + await baseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 0a10eb31..a7772e4d 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -8,18 +8,21 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { List patientLabOrdersList = List(); List _allSpecialLab = List(); + List get allSpecialLab => _allSpecialLab; - AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(); + AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = + AllSpecialLabResultRequestModel(); - Future getPatientLabOrdersList(PatiantInformtion patient, bool isInpatient) async { + Future getPatientLabOrdersList( + PatiantInformtion patient, bool isInpatient) async { hasError = false; Map body = Map(); String url = ""; @@ -33,7 +36,8 @@ class LabsService extends BaseService { } patientLabOrdersList = []; patientLabOrdersList.clear(); - await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, + onSuccess: (dynamic response, int statusCode) { patientLabOrdersList = []; if (!isInpatient) { response['ListPLO'].forEach((hospital) { @@ -51,7 +55,8 @@ class LabsService extends BaseService { }, body: body); } - RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = + RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); List labResultList = List(); @@ -74,8 +79,8 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, + patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { @@ -87,7 +92,10 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { + Future getPatientLabResult( + {PatientLabOrders patientLabOrder, + PatiantInformtion patient, + bool isInpatient}) async { hasError = false; String url = ""; @@ -105,7 +113,8 @@ class LabsService extends BaseService { body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, + onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -114,7 +123,8 @@ class LabsService extends BaseService { labResultList.add(LabResult.fromJson(hospital)); }); response['List_GetLabSpecial'].forEach((hospital) { - patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); + patientLabSpecialResult + .add(PatientLabSpecialResult.fromJson(hospital)); }); } else { response['ListPLR'].forEach((lab) { @@ -128,7 +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 body = Map(); if (patientLabOrder != null) { @@ -140,8 +152,8 @@ 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) { + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, + patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); @@ -152,7 +164,8 @@ class LabsService extends BaseService { }, body: body); } - RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); + RequestSendLabReportEmail _requestSendLabReportEmail = + RequestSendLabReportEmail(); Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; @@ -179,7 +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 body = Map(); if (patientLabOrder != null) { @@ -189,8 +204,9 @@ class LabsService extends BaseService { } body['isDentalAllowedBackend'] = false; body['ProcedureDescription'] = procedureDescription; - await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient( + GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, + patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultHistoryList.clear(); response['ListGeneralResultHistory'].forEach((lab) { labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); @@ -209,10 +225,12 @@ class LabsService extends BaseService { ); hasError = false; _allSpecialLab.clear(); - await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { response['ListPLSRALL'].forEach((lab) { var labs = AllSpecialLabResultModel.fromJson(lab); - if (labs.invoiceNo != "0") _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); + if (labs.invoiceNo != "0") + _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index dfb9c3ae..f36959f1 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MedicalReportTemplate.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class PatientMedicalReportService extends BaseService { List medicalReportList = []; @@ -16,7 +16,8 @@ class PatientMedicalReportService extends BaseService { body['SetupID'] = doctorProfile.setupID; body['ProjectID'] = doctorProfile.projectID; medicalReportList = []; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, + onSuccess: (dynamic response, int statusCode) { if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { medicalReportList.add(MedicalReportModel.fromJson(v)); @@ -36,7 +37,8 @@ class PatientMedicalReportService extends BaseService { body['SetupID'] = "91877"; body['TemplateID'] = 43; - await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, + onSuccess: (dynamic response, int statusCode) { medicalReportTemplate.clear(); if (response['DAPP_GetTemplateByIDList'] != null) { response['DAPP_GetTemplateByIDList'].forEach((v) { @@ -57,14 +59,16 @@ class PatientMedicalReportService extends BaseService { body['AdmissionNo'] = patient.admissionNo; body['MedicalReportHTML'] = htmlText; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_INSERT, onSuccess: (dynamic response, int statusCode) {}, + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_INSERT, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error.toString(); }, body: body, patient: patient); } - Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport) async { + Future verifyMedicalReport( + PatiantInformtion patient, MedicalReportModel medicalReport) async { hasError = false; Map body = Map(); body['TokenID'] = "@dm!n"; @@ -77,7 +81,8 @@ class PatientMedicalReportService extends BaseService { } if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; - await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, onSuccess: (dynamic response, int statusCode) {}, + await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error.toString(); @@ -100,14 +105,16 @@ class PatientMedicalReportService extends BaseService { } if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; - await baseAppClient.postPatient(INSERT_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, + await baseAppClient.postPatient(INSERT_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error.toString(); }, body: body, patient: patient); } - Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + Future updateMedicalReport(PatiantInformtion patient, String htmlText, + int limitNumber, String invoiceNumber) async { hasError = false; Map body = Map(); // body['TokenID'] = "@dm!n"; @@ -127,7 +134,8 @@ class PatientMedicalReportService extends BaseService { } if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; - await baseAppClient.postPatient(UPDATE_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, + await baseAppClient.postPatient(UPDATE_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error.toString(); diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 42cdafc6..19eda72e 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -5,13 +5,11 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { List _medicalFileList = List(); + List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( - //patientMRN: 1231755, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", - ); + ); Future getMedicalFile({int mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); diff --git a/lib/core/service/patient_medical_file/prescription/medicine_service.dart b/lib/core/service/patient_medical_file/prescription/medicine_service.dart index a734354d..5d059f99 100644 --- a/lib/core/service/patient_medical_file/prescription/medicine_service.dart +++ b/lib/core/service/patient_medical_file/prescription/medicine_service.dart @@ -1,15 +1,17 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart'; -import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/pharmacies/pharmacies_List_request_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacies/pharmacies_items_request_model.dart'; class MedicineService extends BaseService { var _pharmacyItemsList = []; var _pharmaciesList = []; + get pharmacyItemsList => _pharmacyItemsList; + get pharmaciesList => _pharmaciesList; - String searchText=''; + String searchText = ''; List patientAssessmentList = []; PharmaciesItemsRequestModel _itemsRequestModel = @@ -18,7 +20,7 @@ class MedicineService extends BaseService { Future getMedicineItem(String itemName) async { _itemsRequestModel.pHRItemName = itemName; - searchText =itemName; + searchText = itemName; await baseAppClient.post( PHARMACY_ITEMS_URL, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index ffbcae9b..217a5c2f 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -1,29 +1,50 @@ import 'package:doctor_app_flutter/config/config.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/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/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.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/util/date-utils.dart'; +import 'package:flutter/cupertino.dart'; class PrescriptionService extends LookupService { List _prescriptionList = List(); + List get prescriptionList => _prescriptionList; + + List _prescriptionListNew = List(); + + List get prescriptionListNew => _prescriptionListNew; + List _drugsList = List(); + List get drugsList => _drugsList; List doctorsList = []; List allMedicationList = []; List specialityList = []; List drugToDrug = []; + List get drugToDrugList => drugToDrug; List itemMedicineList = []; List itemMedicineListRoute = []; @@ -34,7 +55,6 @@ class PrescriptionService extends LookupService { ItemByMedicineRequestModel _itemByMedicineRequestModel = ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( - //search: ["Acetaminophen"], search: ["Amoxicillin"], ); @@ -78,16 +98,23 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int mrn}) async { + Future getPrescriptionListNew({int mrn, int appNo }) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, + appNo:appNo ); hasError = false; _prescriptionList.clear(); + _prescriptionListNew.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { _prescriptionList .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + if(response['PrescriptionList']!=null){ + response['PrescriptionList']["entityList"].forEach((prescriptions) { + _prescriptionListNew.add(PrescriptionEntityModel.fromJson(prescriptions)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -164,56 +191,6 @@ class PrescriptionService extends LookupService { List allergy, PatiantInformtion patient, List prescription) async { - // Map request = { - // "Prescription": { - // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, - // "objVitalSign": {"Height": "180", "Weight": "37"}, - // "objPrescriptionItems": [ - // { - // "DrugId": "83-20-00-30-20-03-03", - // "DrugName": "WARFARIN 1 MG TAB 28'S (N)", - // "Dose": "1", - // "DoseType": "04", - // "Unit": "actuation(s)", - // "FrequencyType": "1/3/Day", - // "Duration": "3/Day", - // "IsScreen": "true" - // }, - // { - // "DrugId": "64-20-00-10-00-03-15", - // "DrugName": "PANADOL 500 MG TAB 24'S(DIS)", - // "Dose": "1", - // "DoseType": "04", - // "Unit": "MG", - // "FrequencyType": "3/1/Day", - // "Duration": "4/Day", - // "RouteID": "24", - // "IsScreen": "true" - // } - // ], - // "objAllergies": { - // "Allergy": { - // "objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"} - // } - // }, - // "objDiagnosis": { - // "Diagnosis": { - // "objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"} - // } - // }, - // "IsDoctor": "false", - // "IsPharmacist": "false" - // }, - // "IPAdress": "10.10.10.10", - // "Channel": 9, - // "LanguageID": 2, - // "VersionID": 5.3, - // "SessionID": "BlUSkYymTt", - // "IsLoginForDoctorApp": true, - // "PatientOutSA": 0, - // "TokenID": "@dm!n", - // "OutSA": true - // }; Map request = { "Prescription": { "objPatientInfo": { @@ -283,4 +260,186 @@ class PrescriptionService extends LookupService { }); return lstAssessmentsObj; } + + + + List prescriptionsList = List(); + List medicationForInPatient = List(); + List prescriptionsOrderList = List(); + List prescriptionInPatientList = List(); + + GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = + GetMedicationForInPatientRequestModel(); + + Future getPrescriptions(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.postPatient(GET_PRESCRIPTION, patient: patient, + onSuccess: (dynamic response, int statusCode) { + prescriptionsList.clear(); + response['PatientPrescriptionList'].forEach((prescriptions) { + prescriptionsList.add(Prescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPrescriptionReport _requestPrescriptionReport = + RequestPrescriptionReport( + appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = List(); + + Future getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { + hasError = false; + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.projectID = prescriptions.projectID; + _requestPrescriptionReport.clinicID = prescriptions.clinicID; + _requestPrescriptionReport.setupID = prescriptions.setupID; + _requestPrescriptionReport.episodeID = prescriptions.episodeID; + _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; + + await baseAppClient.postPatient( + prescriptions.isInOutPatient + ? GET_PRESCRIPTION_REPORT_ENH + : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptionReportList.clear(); + prescriptionReportEnhList.clear(); + if (prescriptions.isInOutPatient) { + response['ListPRM'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList + .add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReport.toJson()); + } + + RequestGetListPharmacyForPrescriptions + requestGetListPharmacyForPrescriptions = + RequestGetListPharmacyForPrescriptions( + latitude: 0, + longitude: 0, + isDentalAllowedBackend: false, + ); + List pharmacyPrescriptionsList = List(); + + + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = + RequestPrescriptionReportEnh( + isDentalAllowedBackend: false, + ); + + List prescriptionReportEnhList = List(); + + Future getPrescriptionReportEnh( + {PrescriptionsOrder prescriptionsOrder, + @required PatiantInformtion patient}) async { + ///This logic copy from the old app from class [order-history.component.ts] in line 45 + bool isInPatient = false; + prescriptionsList.forEach((element) { + if (prescriptionsOrder.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + } + } else { + if (int.parse(prescriptionsOrder.appointmentNo) == + element.appointmentNo) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + + ///call inpGetPrescriptionReport + } + } + }); + + hasError = false; + + await baseAppClient.postPatient( + isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptionReportEnhList.clear(); + + if (isInPatient) { + response['ListPRM'].forEach((prescriptions) { + prescriptionReportEnhList + .add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + PrescriptionReportEnh reportEnh = + PrescriptionReportEnh.fromJson(prescriptions); + reportEnh.itemDescription = prescriptions['ItemDescriptionN']; + prescriptionReportEnhList.add(reportEnh); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReportEnh.toJson()); + } + + Future getPrescriptionsOrders() async { + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, + onSuccess: (dynamic response, int statusCode) { + prescriptionsOrderList.clear(); + response['PatientER_GetPatientAllPresOrdersList'] + .forEach((prescriptionsOrder) { + prescriptionsOrderList + .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getMedicationForInPatient(PatiantInformtion patient) async { + hasError = false; + _getMedicationForInPatientRequestModel = + GetMedicationForInPatientRequestModel( + isDentalAllowedBackend: false, + admissionNo: int.parse(patient.admissionNo), + tokenID: "@dm!n", + projectID: patient.projectId, + ); + await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, + patient: patient, onSuccess: (dynamic response, int statusCode) { + medicationForInPatient.clear(); + response['List_GetMedicationForInpatient'].forEach((prescriptions) { + medicationForInPatient + .add(GetMedicationForInPatientModel.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _getMedicationForInPatientRequestModel.toJson()); + } } diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart deleted file mode 100644 index 06de5a74..00000000 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ /dev/null @@ -1,210 +0,0 @@ -import 'package:doctor_app_flutter/config/config.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/in_patient_prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.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/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/models/patient/patiant_info_model.dart'; -import 'package:flutter/cupertino.dart'; - -import '../../base/base_service.dart'; - -class PrescriptionsService extends BaseService { - List prescriptionsList = List(); - List medicationForInPatient = List(); - List prescriptionsOrderList = List(); - List prescriptionInPatientList = List(); - - InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); - GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = - GetMedicationForInPatientRequestModel(); - - Future getPrescriptionInPatient({int mrn, String adn}) async { - _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( - patientMRN: mrn, - admissionNo: adn, - ); - hasError = false; - prescriptionInPatientList.clear(); - - await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, onSuccess: (dynamic response, int statusCode) { - prescriptionsList.clear(); - response['List_PrescriptionReportForInPatient'].forEach((prescriptions) { - prescriptionInPatientList.add(PrescriotionInPatient.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _inPatientPrescriptionRequestModel.toJson()); - } - - Future getPrescriptions(PatiantInformtion patient) async { - hasError = false; - Map body = Map(); - body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, onSuccess: (dynamic response, int statusCode) { - prescriptionsList.clear(); - response['PatientPrescriptionList'].forEach((prescriptions) { - prescriptionsList.add(Prescriptions.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - - RequestPrescriptionReport _requestPrescriptionReport = - RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = List(); - - Future getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { - hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; - _requestPrescriptionReport.projectID = prescriptions.projectID; - _requestPrescriptionReport.clinicID = prescriptions.clinicID; - _requestPrescriptionReport.setupID = prescriptions.setupID; - _requestPrescriptionReport.episodeID = prescriptions.episodeID; - _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; - - await baseAppClient.postPatient( - prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { - prescriptionReportList.clear(); - prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient) { - response['ListPRM'].forEach((prescriptions) { - prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); - prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); - }); - } else { - response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestPrescriptionReport.toJson()); - } - - RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = - RequestGetListPharmacyForPrescriptions( - latitude: 0, - longitude: 0, - isDentalAllowedBackend: false, - ); - List pharmacyPrescriptionsList = List(); - - Future getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { - hasError = false; - requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, onSuccess: (dynamic response, int statusCode) { - pharmacyPrescriptionsList.clear(); - response['PharmList'].forEach((prescriptions) { - pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: requestGetListPharmacyForPrescriptions.toJson()); - } - - RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh( - isDentalAllowedBackend: false, - ); - - List prescriptionReportEnhList = List(); - - Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { - ///This logic copy from the old app from class [order-history.component.ts] in line 45 - bool isInPatient = false; - prescriptionsList.forEach((element) { - if (prescriptionsOrder.appointmentNo == "0") { - if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { - _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; - _requestPrescriptionReportEnh.clinicID = element.clinicID; - _requestPrescriptionReportEnh.projectID = element.projectID; - _requestPrescriptionReportEnh.episodeID = element.episodeID; - _requestPrescriptionReportEnh.setupID = element.setupID; - _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; - } - } else { - if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { - _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; - _requestPrescriptionReportEnh.clinicID = element.clinicID; - _requestPrescriptionReportEnh.projectID = element.projectID; - _requestPrescriptionReportEnh.episodeID = element.episodeID; - _requestPrescriptionReportEnh.setupID = element.setupID; - _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; - - ///call inpGetPrescriptionReport - } - } - }); - - hasError = false; - - await baseAppClient.postPatient(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { - prescriptionReportEnhList.clear(); - - if (isInPatient) { - response['ListPRM'].forEach((prescriptions) { - prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); - }); - } else { - response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions); - reportEnh.itemDescription = prescriptions['ItemDescriptionN']; - prescriptionReportEnhList.add(reportEnh); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestPrescriptionReportEnh.toJson()); - } - - Future getPrescriptionsOrders() async { - Map body = Map(); - body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { - prescriptionsOrderList.clear(); - response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { - prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - - Future getMedicationForInPatient(PatiantInformtion patient) async { - hasError = false; - _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel( - isDentalAllowedBackend: false, - admissionNo: int.parse(patient.admissionNo), - tokenID: "@dm!n", - projectID: patient.projectId, - ); - await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, - onSuccess: (dynamic response, int statusCode) { - medicationForInPatient.clear(); - response['List_GetMedicationForInpatient'].forEach((prescriptions) { - medicationForInPatient.add(GetMedicationForInPatientModel.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _getMedicationForInPatientRequestModel.toJson()); - } -} diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 56a92de5..8370e968 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_mo import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; @@ -15,10 +14,13 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ProcedureService extends BaseService { List _procedureList = List(); + List get procedureList => _procedureList; List _valadteProcedureList = List(); + List get valadteProcedureList => _valadteProcedureList; List _categoriesList = List(); + List get categoriesList => _categoriesList; List procedureslist = List(); List categoryList = []; @@ -28,23 +30,19 @@ class ProcedureService extends BaseService { List templateList = List(); List _templateDetailsList = List(); - List get templateDetailsList => _templateDetailsList; - GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(); + List get templateDetailsList => + _templateDetailsList; + + GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = + GetOrderedProcedureRequestModel(); - ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel(); - ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(); + ProcedureTempleteRequestModel _procedureTempleteRequestModel = + ProcedureTempleteRequestModel(); + ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = + ProcedureTempleteDetailsRequestModel(); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( - // clinicId: 17, - // pageSize: 10, - // pageIndex: 1, - // //patientMRN: 3120725, - // //categoryId: null, - // vidaAuthTokenID: - // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", - // - // search: ["lab"], ); GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( @@ -52,26 +50,24 @@ class ProcedureService extends BaseService { pageSize: 100, pageIndex: 1, patientMRN: 0, - //categoryId: null, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", - - //search: ["DENTAL"], ); - Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async { + Future getProcedureTemplate( + {int doctorId, int projectId, int clinicId, String categoryID, bool isLocalBusy}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( // tokenID: "@dm!n", patientID: 0, searchType: 1, ); + hasError = false; await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/, onSuccess: (dynamic response, int statusCode) { templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { - ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); + ProcedureTempleteDetailsModel templateElement = + ProcedureTempleteDetailsModel.fromJson(template); if (categoryID != null) { if (categoryID == templateElement.categoryID) { templateList.add(templateElement); @@ -89,17 +85,21 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteRequestModel.toJson()); } - Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async { + Future getProcedureTemplateDetails( + {int doctorId, int projectId, int clinicId, int templateId}) async { _procedureTempleteDetailsRequestModel = - ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0); + ProcedureTempleteDetailsRequestModel( + templateID: templateId, searchType: 1, patientID: 0); hasError = false; //insuranceApprovalInPatient.clear(); _templateDetailsList.clear(); - await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, + onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['HIS_ProcedureTemplateDetailsList'].forEach((template) { - _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template)); + _templateDetailsList + .add(ProcedureTempleteDetailsModel.fromJson(template)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -113,8 +113,10 @@ class ProcedureService extends BaseService { ); hasError = false; _procedureList.clear(); - await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { - _procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); + await baseAppClient.post(GET_PROCEDURE_LIST, + onSuccess: (dynamic response, int statusCode) { + _procedureList.add( + GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -124,7 +126,8 @@ class ProcedureService extends BaseService { Future getCategory() async { hasError = false; - await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_LIST_CATEGORISE, + onSuccess: (dynamic response, int statusCode) { categoryList = []; categoryList = response['listProcedureCategories']['entityList']; }, onFailure: (String error, int statusCode) { @@ -133,7 +136,8 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory( + {String categoryName, String categoryID, patientId}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], patientMRN: patientId, @@ -144,8 +148,10 @@ class ProcedureService extends BaseService { ); hasError = false; _categoriesList.clear(); - await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) { - _categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); + await baseAppClient.post(GET_CATEGORISE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + _categoriesList + .add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -155,7 +161,8 @@ class ProcedureService extends BaseService { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(POST_PROCEDURE_LIST, + onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -163,10 +170,12 @@ class ProcedureService extends BaseService { }, body: postProcedureReqModel.toJson()); } - Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async { + Future updateProcedure( + UpdateProcedureRequestModel updateProcedureRequestModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(UPDATE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { print("ACCEPTED"); }, onFailure: (String error, int statusCode) { hasError = true; @@ -174,11 +183,14 @@ class ProcedureService extends BaseService { }, body: updateProcedureRequestModel.toJson()); } - Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async { + Future valadteProcedure( + ProcedureValadteRequestModel procedureValadteRequestModel) async { hasError = false; _valadteProcedureList.clear(); - await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) { - _valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); + await baseAppClient.post(GET_PROCEDURE_VALIDATION, + onSuccess: (dynamic response, int statusCode) { + _valadteProcedureList.add( + ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index f10f2253..965fa03b 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; @@ -9,14 +9,19 @@ class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + Future getRadImageURL( + {int invoiceNo, + int lineItem, + int projectId, + @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, + onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -24,7 +29,8 @@ 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 body = new Map(); if (isInPatient) { @@ -33,7 +39,8 @@ 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) { diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 070fd862..333ffeea 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -4,36 +4,41 @@ import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_mode import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/models/sickleave/sick_leave_statisitics_model.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/extend_sick_leave_request.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/sick_leave_statisitics_model.dart'; class SickLeaveService extends BaseService { SickLeaveStatisticsModel get sickLeavestatisitics => _statistics; SickLeaveStatisticsModel _statistics = SickLeaveStatisticsModel(); + List get getOffTimeList => offTime; List offTime = []; + List get getReasons => reasonse; List reasonse = []; + List get getAllSickLeave => _getAllsickLeave; List _getAllsickLeave = List(); List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; - List get getAllRescheduleLeave => _getReScheduleLeave; + List get getAllRescheduleLeave => + _getReScheduleLeave; List _getReScheduleLeave = []; + dynamic get postReschedule => _postReschedule; dynamic _postReschedule; - List getAllSickLeavePatient = List(); List getAllSickLeaveDoctor = List(); - SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); - GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(); + SickLeavePatientRequestModel _sickLeavePatientRequestModel = + SickLeavePatientRequestModel(); + GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = + GetSickLeaveDoctorRequestModel(); Future getStatistics(appoNo, patientMRN) async { hasError = false; @@ -42,7 +47,8 @@ class SickLeaveService extends BaseService { onSuccess: (dynamic response, int statusCode) { print(response); - _statistics = SickLeaveStatisticsModel.fromJson(response['SickLeaveStatistics']); + _statistics = + SickLeaveStatisticsModel.fromJson(response['SickLeaveStatistics']); }, onFailure: (String error, int statusCode) { hasError = true; @@ -56,8 +62,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( ADD_SICK_LEAVE, - onSuccess: (dynamic response, int statusCode) { - }, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -68,7 +73,8 @@ class SickLeaveService extends BaseService { Future extendSickLeave(GetAllSickLeaveResponse request) async { var extendSickLeaveRequest = ExtendSickLeaveRequest(); - extendSickLeaveRequest.patientMRN = request.patientMRN.toString(); //'3120746'; + extendSickLeaveRequest.patientMRN = + request.patientMRN.toString(); //'3120746'; extendSickLeaveRequest.previousRequestNo = request.requestNo.toString(); extendSickLeaveRequest.noOfDays = request.noOfDays.toString(); extendSickLeaveRequest.remarks = request.remarks; @@ -107,8 +113,8 @@ class SickLeaveService extends BaseService { } Future getSickLeavePatient(patientMRN) async { - _sickLeavePatientRequestModel = - SickLeavePatientRequestModel(patientID: patientMRN, patientTypeID: 2, patientType: 1); + _sickLeavePatientRequestModel = SickLeavePatientRequestModel( + patientID: patientMRN, patientTypeID: 2, patientType: 1); hasError = false; getAllSickLeavePatient = []; getAllSickLeavePatient.clear(); @@ -130,7 +136,8 @@ class SickLeaveService extends BaseService { } Future getSickLeaveDoctor(patientMRN) async { - _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(patientMRN: patientMRN); + _sickLeaveDoctorRequestModel = + GetSickLeaveDoctorRequestModel(patientMRN: patientMRN); hasError = false; getAllSickLeaveDoctor = []; getAllSickLeaveDoctor.clear(); @@ -179,7 +186,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( - GET_OFFTIME, + GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { offTime = []; response['MasterLookUpList']['entityList'].forEach((item) => { @@ -201,7 +208,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( - GET_OFFTIME, + GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { reasonse = []; reasonse = response['MasterLookUpList']['entityList']; diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index ec127f8b..b8c187a3 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -1,28 +1,28 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamListResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_progress_note_request_model.dart'; import '../../base/lookup-service.dart'; @@ -35,6 +35,7 @@ class SOAPService extends LookupService { List patientAssessmentList = []; int episodeID; + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -65,7 +66,9 @@ class SOAPService extends LookupService { }, body: postEpisodeReqModel.toJson()); } - Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel postEpisodeForInpatientRequestModel) async { + Future postEpisodeForInPatient( + PostEpisodeForInpatientRequestModel + postEpisodeForInpatientRequestModel) async { hasError = false; await baseAppClient.post(POST_EPISODE_FOR_IN_PATIENT, @@ -85,7 +88,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error+ "\n"+error; + super.error = super.error + "\n" + error; }, body: postAllergyRequestModel.toJson()); } @@ -97,14 +100,14 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error =super.error + "\n"+error; + super.error = super.error + "\n" + error; }, body: postHistoriesRequestModel.toJson()); } Future postChiefComplaint( PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; - super.error =""; + super.error = ""; await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); @@ -158,7 +161,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = "\n"+error; + super.error = "\n" + error; }, body: patchAllergyRequestModel.toJson()); } @@ -170,14 +173,14 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error +"\n"+error; + super.error = super.error + "\n" + error; }, body: patchHistoriesRequestModel.toJson()); } Future patchChiefComplaint( PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { hasError = false; - super.error =""; + super.error = ""; await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); @@ -226,7 +229,7 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, + await baseAppClient.post(GET_ALLERGIES, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); @@ -327,7 +330,6 @@ class SOAPService extends LookupService { print("Success"); episodeID = response["GetEpisodeNo"]; - }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 53fa257e..4305dbec 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.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-history.dart'; class UcafService extends LookupService { List patientChiefComplaintList; @@ -159,7 +159,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, + await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index 1c07aa48..a74969d1 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.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/model/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { VitalSignData patientVitalSigns; @@ -54,14 +54,14 @@ class VitalSignsService extends BaseService { body['ProjectID'] = patient.projectId; } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -71,7 +71,8 @@ class VitalSignsService extends BaseService { ); } - Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async { + Future getOutPatientVitalSignHistory( + PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; @@ -84,22 +85,17 @@ class VitalSignsService extends BaseService { // body['InOutPatientType'] = 2; // } - - await baseAppClient.postPatient( - GET_PATIENT_VITAL_SIGN, - onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); - if (response['List_DoctorPatientVitalSign'] != null) { - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - });} - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error.toString(); - }, - body: body, - patient: patient - ); + await baseAppClient.postPatient(GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); } } diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index e6f35bb8..17f6ea12 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -1,15 +1,17 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart'; -import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_request_model.dart'; -import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_model.dart'; -import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_request_model.dart'; +import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_request_model.dart'; +import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { List _pendingOrderList = List(); + List get pendingOrderList => _pendingOrderList; List _admissionOrderList = List(); + List get admissionOrderList => _admissionOrderList; Future getPendingOrders( diff --git a/lib/core/service/special_clinics/special_clinic_service.dart b/lib/core/service/special_clinics/special_clinic_service.dart index 49237331..6ee126d5 100644 --- a/lib/core/service/special_clinics/special_clinic_service.dart +++ b/lib/core/service/special_clinics/special_clinic_service.dart @@ -1,57 +1,55 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; class SpecialClinicsService extends BaseService { + List _specialClinicalCareList = []; + List get specialClinicalCareList => + _specialClinicalCareList; - List _specialClinicalCareList = []; - List get specialClinicalCareList => _specialClinicalCareList; + List + _specialClinicalCareMappingList = []; + + List + get specialClinicalCareMappingList => _specialClinicalCareMappingList; - List _specialClinicalCareMappingList = []; - List get specialClinicalCareMappingList => _specialClinicalCareMappingList; Future getSpecialClinicalCareList() async { hasError = false; await baseAppClient.post( GET_SPECIAL_CLINICAL_CARE_LIST, onSuccess: (dynamic response, int statusCode) { - _specialClinicalCareList.clear(); response['List_SpecialClinicalCareList'].forEach((v) { - _specialClinicalCareList.add(GetSpecialClinicalCareListResponseModel.fromJson(v)); - });}, + _specialClinicalCareList + .add(GetSpecialClinicalCareListResponseModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, - body: { - }, + body: {}, ); } - Future getSpecialClinicalCareMappingList(int clinicId) async { hasError = false; await baseAppClient.post( GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST, onSuccess: (dynamic response, int statusCode) { - _specialClinicalCareMappingList.clear(); response['List_SpecialClinicalCareMappingList'].forEach((v) { - _specialClinicalCareMappingList.add(GetSpecialClinicalCareMappingListResponseModel.fromJson(v)); - });}, + _specialClinicalCareMappingList + .add(GetSpecialClinicalCareMappingListResponseModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, - body: { - "ClinicID": clinicId, - "DoctorID":0, - "EditedBy":0 - }, + body: {"ClinicID": clinicId, "DoctorID": 0, "EditedBy": 0}, ); } - } diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 9df347e2..a9903f20 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 46f48d35..7e9a4664 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart' import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; @@ -12,6 +12,7 @@ class InsuranceViewModel extends BaseViewModel { List get insuranceApproval => _insuranceCardService.insuranceApproval; + List get insuranceApprovalInPatient => _insuranceCardService.insuranceApprovalInPatient; diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 53feedd1..485fb795 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -6,21 +6,23 @@ import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_ import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; class LiveCarePatientViewModel extends BaseViewModel { List filterData = []; - LiveCarePatientServices _liveCarePatientServices = locator(); + LiveCarePatientServices _liveCarePatientServices = + locator(); StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; - List get alternativeServicesList => _liveCarePatientServices.alternativeServicesList; + List get alternativeServicesList => + _liveCarePatientServices.alternativeServicesList; DashboardService _dashboardService = locator(); @@ -31,9 +33,12 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.BusyLocal); } - PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false); - await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); + PendingPatientERForDoctorAppRequestModel + pendingPatientERForDoctorAppRequestModel = + PendingPatientERForDoctorAppRequestModel( + sErServiceID: _dashboardService.sServiceID, outSA: false); + await _liveCarePatientServices.getPendingPatientERForDoctorApp( + pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; @@ -165,11 +170,16 @@ class LiveCarePatientViewModel extends BaseViewModel { if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { - String fullName = _liveCarePatientServices.patientList[i].fullName.toUpperCase(); - String patientID = _liveCarePatientServices.patientList[i].patientId.toString(); - String mobile = _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); - - if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) { + String fullName = + _liveCarePatientServices.patientList[i].fullName.toUpperCase(); + String patientID = + _liveCarePatientServices.patientList[i].patientId.toString(); + String mobile = + _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); + + if (fullName.contains(str.toUpperCase()) || + patientID.contains(str) || + mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); } } @@ -183,13 +193,16 @@ class LiveCarePatientViewModel extends BaseViewModel { Future isLogin(int loginStatus) async { await getDoctorProfile(isGetProfile: true); - LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel(); - userLoginRequestModel.isOutKsa = (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; + LiveCareUserLoginRequestModel userLoginRequestModel = + new LiveCareUserLoginRequestModel(); + userLoginRequestModel.isOutKsa = + (doctorProfile.projectID == 2 || doctorProfile.projectID == 3) ? 1 : 0; userLoginRequestModel.isLogin = loginStatus; userLoginRequestModel.generalid = "Cs2020@2016\$2958"; setState(ViewState.BusyLocal); - await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); + await _liveCarePatientServices.isLogin( + loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -207,7 +220,8 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 2, serviceName: "LABORATORY"), ); alternativeServicesList.add( - AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), + AlternativeService( + serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), ); alternativeServicesList.add( AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), @@ -228,7 +242,8 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), ); alternativeServicesList.add( - AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), + AlternativeService( + serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), ); alternativeServicesList.add( AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index e7d343b4..f42524b5 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MedicalReportTemplate.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; @@ -12,7 +12,8 @@ class PatientMedicalReportViewModel extends BaseViewModel { List get medicalReportList => _service.medicalReportList; - List get medicalReportTemplate => _service.medicalReportTemplate; + List get medicalReportTemplate => + _service.medicalReportTemplate; Future getMedicalReportList(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -44,7 +45,8 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport) async { + Future verifyMedicalReport( + PatiantInformtion patient, MedicalReportModel medicalReport) async { setState(ViewState.Busy); await _service.verifyMedicalReport(patient, medicalReport); if (_service.hasError) { @@ -62,22 +64,24 @@ class PatientMedicalReportViewModel extends BaseViewModel { error = _service.error; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); - } else - { await getMedicalReportList(patient); - setState(ViewState.Idle); - } + } else { + await getMedicalReportList(patient); + setState(ViewState.Idle); + } } - Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + Future updateMedicalReport(PatiantInformtion patient, String htmlText, + int limitNumber, String invoiceNumber) async { setState(ViewState.Busy); - await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); + await _service.updateMedicalReport( + patient, htmlText, limitNumber, invoiceNumber); if (_service.hasError) { error = _service.error; await getMedicalReportList(patient); setState(ViewState.ErrorLocal); - } else - { - await getMedicalReportList(patient); - setState(ViewState.Idle);} + } else { + await getMedicalReportList(patient); + setState(ViewState.Idle); + } } } diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 866f99a8..2de57dfc 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -183,7 +183,7 @@ class PatientRegistrationViewModel extends BaseViewModel { channel: 3, // TODO Elham* loginType loginType: 4, - logInTokenID:_patientRegistrationService.logInTokenID , + logInTokenID: _patientRegistrationService.logInTokenID, nationalID: checkPatientForRegistrationModel.patientIdentificationID, patientID: 0, mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(), diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 5acc6f07..656a077f 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestM import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; @@ -126,7 +126,7 @@ class PatientSearchViewModel extends BaseViewModel { } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), + DateTime.now().day + 7), 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat( diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 83cd43e3..654906a2 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -3,35 +3,34 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; - -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamListResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; @@ -299,7 +298,6 @@ class SOAPViewModel extends BaseViewModel { return allergiesString; } - Future getPatientPhysicalExam( PatiantInformtion patientInfo, ) async { @@ -778,13 +776,14 @@ class SOAPViewModel extends BaseViewModel { } if (myAllergiesList.length != 0) { - PostAllergyRequestModel postAllergyRequestModel =createPostAllergyRequestModel (myAllergiesList:myAllergiesList, patientInfo: patientInfo); + PostAllergyRequestModel postAllergyRequestModel = + createPostAllergyRequestModel( + myAllergiesList: myAllergiesList, patientInfo: patientInfo); if (patientAllergiesList.isEmpty) { services.add(_SOAPService.postAllergy(postAllergyRequestModel)); } else { services.add(_SOAPService.patchAllergy(postAllergyRequestModel)); } - } final results = await Future.wait(services); @@ -838,10 +837,10 @@ class SOAPViewModel extends BaseViewModel { return postHistoriesRequestModel; } - - PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}){ + PostAllergyRequestModel createPostAllergyRequestModel( + {myAllergiesList, patientInfo}) { PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); + new PostAllergyRequestModel(); myAllergiesList.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) @@ -863,7 +862,6 @@ class SOAPViewModel extends BaseViewModel { isUpdatedByNurse: false)); }); - return postAllergyRequestModel; } } diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index cad5fa87..5671aa55 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -18,17 +17,14 @@ import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/doctor/user_model.dart'; -import 'package:doctor_app_flutter/root_page.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; @@ -45,19 +41,20 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => _authService.doctorProfilesList; + List get doctorProfilesList => + _authService.doctorProfilesList; SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + get activationCodeVerificationScreenRes => + _authService.activationCodeVerificationScreenRes; SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + get activationCodeForDoctorAppRes => + _authService.activationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + get checkActivationCodeForDoctorAppRes => + _authService.checkActivationCodeForDoctorAppRes; NewLoginInformationModel loggedUser; GetIMEIDetailsModel user; @@ -65,19 +62,19 @@ class AuthenticationViewModel extends BaseViewModel { UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); List _availableBiometrics; - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; bool unverified = false; bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; - String localToken =""; + String localToken = ""; + AuthenticationViewModel({bool checkDeviceInfo = false}) { getDeviceInfoFromFirebase(); getDoctorProfile(); } - /// Insert Device IMEI Future insertDeviceImei(token) async { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); @@ -92,20 +89,28 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = + InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = + profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; + 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.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID =await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + 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; await _authService.insertDeviceImei(insertIMEIDetailsModel); @@ -116,7 +121,6 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// first step login Future login(UserModel userInfo) async { setState(ViewState.BusyLocal); @@ -135,21 +139,23 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( AuthMethodTypes authMethodType) async { + 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, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); - await _authService.sendActivationCodeVerificationScreen(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, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); + await _authService + .sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); @@ -158,62 +164,72 @@ 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(), - ); + facilityId: projectID, + memberID: loggedUser.listMemberInformation[0].memberID, + loginDoctorID: loggedUser.listMemberInformation[0].employeeID, + otpSendType: authMethodType.getTypeIdService().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, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode ?? '0000', - memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID , - password: userInfo.password, - facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin:isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService.checkActivationCodeForDoctorApp(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, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode ?? '0000', + memberID: userInfo.userID != null + ? int.parse(userInfo.userID) + : user.doctorID, + password: userInfo.password, + facilityId: userInfo.projectID != null + ? userInfo.projectID.toString() + : user.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID: userInfo.userID != null + ? int.parse(userInfo.userID) + : user.editedBy, + // loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin: isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService + .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess( + checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { @@ -223,24 +239,17 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Idle); } - /// get type name based on id. getType(type, context) { switch (type) { case 1: - return TranslationBase - .of(context) - .verifySMS; + return TranslationBase.of(context).verifySMS; break; case 3: - return TranslationBase - .of(context) - .verifyFingerprint; + return TranslationBase.of(context).verifyFingerprint; break; case 4: - return TranslationBase - .of(context) - .verifyFaceID; + return TranslationBase.of(context).verifyFaceID; break; case 2: return TranslationBase.of(context).verifyWhatsApp; @@ -252,13 +261,15 @@ class AuthenticationViewModel extends BaseViewModel { } /// 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, + setDataAfterSendActivationSuccess( + CheckActivationCodeForDoctorAppResponseModel + sendActivationCodeForDoctorAppResponseModel) async { + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, + await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } @@ -297,7 +308,9 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - languageID: 2);///TODO change the lan + languageID: 2); + + ///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error; @@ -311,26 +324,22 @@ 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); + TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile - .isNotEmpty) { + checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { localSetDoctorProfile( checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); } else { sharedPref.setObj( - CLINIC_NAME, - checkActivationCodeForDoctorAppRes.listDoctorsClinic); + CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0] - .toJson()); + checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } /// check specific biometric if it available or not - Future checkIfBiometricAvailable(BiometricType biometricType) async { + Future checkIfBiometricAvailable(BiometricType biometricType) async { bool isAvailable = false; await _getAvailableBiometrics(); if (_availableBiometrics != null) { @@ -354,9 +363,9 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); + _firebaseMessaging.requestPermission(); } - setState(ViewState.Busy); + setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); if (localToken == "") { localToken = token; @@ -367,13 +376,12 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user =_authService.dashboardItemsList[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); @@ -388,9 +396,9 @@ class AuthenticationViewModel extends BaseViewModel { if (state == ViewState.Busy) { appStatus = APP_STATUS.LOADING; } else { - if(this.doctorProfile !=null) + if (this.doctorProfile != null) appStatus = APP_STATUS.AUTHENTICATED; - else if (this.unverified) { + else if (this.unverified) { appStatus = APP_STATUS.UNVERIFIED; } else if (this.isLogin) { appStatus = APP_STATUS.AUTHENTICATED; @@ -400,12 +408,13 @@ class AuthenticationViewModel extends BaseViewModel { } return appStatus; } - setAppStatus(APP_STATUS status){ + + setAppStatus(APP_STATUS status) { this.appStatus = status; notifyListeners(); } - setUnverified(bool unverified,{bool isFromLogin = false}){ + setUnverified(bool unverified, {bool isFromLogin = false}) { this.unverified = unverified; this.isFromLogin = isFromLogin; notifyListeners(); @@ -413,24 +422,21 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - - localToken = ""; - String lang = await sharedPref.getString(APP_Language); - await Helpers.clearSharedPref(); - doctorProfile = null; - sharedPref.setString(APP_Language, lang); - deleteUser(); - await getDeviceInfoFromFirebase(); - this.isFromLogin = isFromLogin; - appStatus = APP_STATUS.UNAUTHENTICATED; - setState(ViewState.Idle); + String lang = await sharedPref.getString(APP_Language); + await Helpers.clearSharedPref(); + doctorProfile = null; + sharedPref.setString(APP_Language, lang); + deleteUser(); + await getDeviceInfoFromFirebase(); + this.isFromLogin = isFromLogin; + appStatus = APP_STATUS.UNAUTHENTICATED; + setState(ViewState.Idle); } - deleteUser(){ + deleteUser() { user = null; unverified = false; isLogin = false; } - } diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index d50a8d5a..33467e06 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -1,8 +1,6 @@ -import 'dart:isolate'; - import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/material.dart'; @@ -22,10 +20,11 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; - notifyListeners(); + notifyListeners(); } - Future getDoctorProfile({bool isGetProfile = false}) async { + Future getDoctorProfile( + {bool isGetProfile = false}) async { if (isGetProfile) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 04e63dd9..efeb65b0 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -3,17 +3,17 @@ 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'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; + import '../../locator.dart'; import 'authentication_view_model.dart'; import 'base_view_model.dart'; - class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); SpecialClinicsService _specialClinicsService = locator(); @@ -37,10 +37,10 @@ class DashboardViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); final results = await Future.wait([ - projectsProvider.getDoctorClinicsList(), + projectsProvider.getDoctorClinicsList(), _dashboardService.getDashboard(), _dashboardService.checkDoctorHasLiveCare(), - _specialClinicsService.getSpecialClinicalCareList(), + _specialClinicsService.getSpecialClinicalCareList(), ]); if (_dashboardService.hasError) { @@ -53,13 +53,8 @@ class DashboardViewModel extends BaseViewModel { } Future setFirebaseNotification(AuthenticationViewModel authProvider) async { - _firebaseMessaging.requestNotificationPermissions( - const IosNotificationSettings( - sound: true, badge: true, alert: true, provisional: true)); - _firebaseMessaging.onIosSettingsRegistered - .listen((IosNotificationSettings settings) { - print("Settings registered: $settings"); - }); + _firebaseMessaging.requestPermission( + sound: true, badge: true, alert: true, provisional: true); _firebaseMessaging.getToken().then((String token) async { if (token != '') { diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 707fb805..e89f96f9 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -12,6 +12,7 @@ class DoctorReplayViewModel extends BaseViewModel { List get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable; + List get listDoctorNotRepliedQuestions => _doctorReplyService.listDoctorNotRepliedQuestions; diff --git a/lib/core/viewModel/hospitals_view_model.dart b/lib/core/viewModel/hospitals_view_model.dart index c0ce1bc4..1f6bf7c3 100644 --- a/lib/core/viewModel/hospitals_view_model.dart +++ b/lib/core/viewModel/hospitals_view_model.dart @@ -1,20 +1,18 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; -import 'package:flutter/cupertino.dart'; import '../../locator.dart'; import 'base_view_model.dart'; - class HospitalViewModel extends BaseViewModel { HospitalsService _hospitalsService = locator(); + // List get imeiDetails => _authService.dashboardItemsList; // get loginInfo => _authService.loginInfo; Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel =GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; setState(ViewState.Busy); await _hospitalsService.getHospitals(getHospitalsRequestModel); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index d83aee2a..aa2da342 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'base_view_model.dart'; @@ -17,16 +17,22 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); - List get labOrdersResultsList => _labsService.labOrdersResultsList; - List get allSpecialLabList => _labsService.allSpecialLab; + List get labOrdersResultsList => + _labsService.labOrdersResultsList; + + List get allSpecialLabList => + _labsService.allSpecialLab; List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); List get patientLabOrdersList => - filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; + filterType == FilterType.Clinic + ? _patientLabOrdersListClinic + : _patientLabOrdersListHospital; - List get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList; + List get labOrdersResultHistoryList => + _labsService.labOrdersResultHistoryList; void getLabs(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -36,33 +42,41 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = _patientLabOrdersListClinic - .where((elementClinic) => elementClinic.filterName == element.clinicDescription) - .toList(); + List patientLabOrdersClinic = + _patientLabOrdersListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic.indexOf(patientLabOrdersClinic[0])] + _patientLabOrdersListClinic[_patientLabOrdersListClinic + .indexOf(patientLabOrdersClinic[0])] .patientLabOrdersList .add(element); } else { - _patientLabOrdersListClinic - .add(PatientLabOrdersList(filterName: element.clinicDescription, patientDoctorAppointment: element)); + _patientLabOrdersListClinic.add(PatientLabOrdersList( + filterName: element.clinicDescription, + patientDoctorAppointment: element)); } // doctor list sort via project - List patientLabOrdersHospital = _patientLabOrdersListHospital - .where( - (elementClinic) => elementClinic.filterName == element.projectName, - ) - .toList(); + List patientLabOrdersHospital = + _patientLabOrdersListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital.indexOf(patientLabOrdersHospital[0])] + _patientLabOrdersListHospital[_patientLabOrdersListHospital + .indexOf(patientLabOrdersHospital[0])] .patientLabOrdersList .add(element); } else { - _patientLabOrdersListHospital - .add(PatientLabOrdersList(filterName: element.projectName, patientDoctorAppointment: element)); + _patientLabOrdersListHospital.add(PatientLabOrdersList( + filterName: element.projectName, + patientDoctorAppointment: element)); } }); @@ -75,7 +89,8 @@ class LabsViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => + _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; @@ -108,10 +123,15 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult({PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { + getPatientLabResult( + {PatientLabOrders patientLabOrder, + PatiantInformtion patient, + bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -122,21 +142,31 @@ class LabsViewModel extends BaseViewModel { void setLabResultDependOnFilterName() { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = - labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); + List patientLabOrdersClinic = labResultLists + .where( + (elementClinic) => elementClinic.filterName == element.testCode) + .toList(); if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); } else { - labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); } }); } - 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); + patientLabOrder: patientLabOrder, + procedure: procedure, + patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -144,8 +174,9 @@ class LabsViewModel 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(); @@ -154,10 +185,14 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, + String procedureDescription, + PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResultHistoryByDescription( - patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); + patientLabOrder: patientLabOrder, + procedureDescription: procedureDescription, + patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index 555e19cf..508d6731 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -11,6 +11,7 @@ class GetRescheduleLeavesResponse { int status; String createdOn; String statusDescription; + GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index de586e1e..b0b47086 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -1,13 +1,12 @@ - import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart'; -import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/get_panding_req_list.dart'; +import 'package:doctor_app_flutter/core/model/livecare/get_pending_res_list.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 8ccf1a70..25916661 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,15 +1,22 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart'; - -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; - +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; +import 'package:flutter/cupertino.dart'; import '../../locator.dart'; +import '../../util/dr_app_toast_msg.dart'; +import '../../util/helpers.dart'; +import '../../widgets/shared/loader/gif_loader_dialog_utils.dart'; +import '../model/Prescriptions/post_prescrition_req_model.dart'; +import '../model/Prescriptions/prescription_model.dart'; import 'base_view_model.dart'; class MedicineViewModel extends BaseViewModel { @@ -17,10 +24,16 @@ class MedicineViewModel extends BaseViewModel { MedicineService _medicineService = locator(); ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); - List get procedureTemplate => _procedureService.templateList; + + + List get procedureTemplate => + _procedureService.templateList; List templateList = List(); + get pharmacyItemsList => _medicineService.pharmacyItemsList; + get searchText => _medicineService.searchText; + get pharmaciesList => _medicineService.pharmaciesList; get medicationStrengthList => _prescriptionService.medicationStrengthList; @@ -30,71 +43,193 @@ class MedicineViewModel extends BaseViewModel { get medicationRouteList => _prescriptionService.medicationRouteList; get medicationFrequencyList => _prescriptionService.medicationFrequencyList; + get boxQuintity => _prescriptionService.boxQuantity; - get medicationIndicationsList => _prescriptionService.medicationIndicationsList; + get medicationIndicationsList => + _prescriptionService.medicationIndicationsList; get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; - List get patientAssessmentList => _prescriptionService.patientAssessmentList; - List get allMedicationList => _prescriptionService.allMedicationList; + List get patientAssessmentList => + _prescriptionService.patientAssessmentList; + + List get allMedicationList => + _prescriptionService.allMedicationList; + List get itemMedicineList => _prescriptionService.itemMedicineList; - List get itemMedicineListRoute => _prescriptionService.itemMedicineListRoute; - List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; - Future getItem({int itemID}) async { - //hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); + List get itemMedicineListRoute => + _prescriptionService.itemMedicineListRoute; + + List get itemMedicineListUnit => + _prescriptionService.itemMedicineListUnit; + + + Future getItem({int itemID, bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } + setTemplateListDependOnId() { procedureTemplate.forEach((element) { - List templateListData = - templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList(); + List templateListData = templateList + .where((elementTemplate) => + elementTemplate.templateId == element.templateID) + .toList(); if (templateListData.length != 0) { - templateList[templateList.indexOf(templateListData[0])].procedureTemplate.add(element); + templateList[templateList.indexOf(templateListData[0])] + .procedureTemplate + .add(element); } else { var template = ProcedureTempleteDetailsModelList( - templateName: element.templateName, templateId: element.templateID, template: element); + templateName: element.templateName, + templateId: element.templateID, + template: element); if (!templateList.contains(template)) templateList.add(template); } }); print(templateList.length.toString()); } - Future getProcedureTemplate({String categoryID}) async { - hasError = false; - setState(ViewState.Busy); - await _procedureService.getProcedureTemplate(categoryID: categoryID); - if (_procedureService.hasError) { - error = _procedureService.error; - setState(ViewState.ErrorLocal); + + + + getPrescriptionForDrug( + List prescriptionList, + MedicineViewModel model, + ) { + var prescriptionDetails = []; + if (prescriptionList.length > 0) { + prescriptionList[0].entityList.forEach((element) { + if (element.mediSpanGPICode != null) { + prescriptionDetails.add({ + 'DrugId': element.mediSpanGPICode, + 'DrugName': element.medicationName, + 'Dose': element.doseDailyQuantity, + 'DoseType': element.doseDailyUnitID, + 'Unit': element.uom, + 'FrequencyType': element.frequencyID, + 'Duration': element.doseDurationDays, + 'RouteID': element.routeID, + 'IsScreen': element.isSIG + }); + } + }); + } + return prescriptionDetails; + } + + + postPrescription( + {String duration, + String doseTimeIn, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model, + DateTime doseTime, + String doseUnit, + String icdCode, + PatiantInformtion patient, + String patientType, + bool isLocalBusy = false, + BuildContext context, PrescriptionRequestModel prescriptionRequestModel}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + PostPrescriptionReqModel postProcedureReqModel = + new PostPrescriptionReqModel(); + List prescriptionList = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.clinicID = patient.clinicId; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + prescriptionList.add(PrescriptionRequestModel( + covered: true, + dose: double.parse(dose), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), + remarks: instruction, + approvalRequired: true, + icdcode10Id: icdCode.toString(), + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime.toIso8601String())); + postProcedureReqModel.prescriptionRequestModel = prescriptionList; + await _prescriptionService.postPrescription(postProcedureReqModel); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } } else { - setTemplateListDependOnId(); setState(ViewState.Idle); + // TODO Elham* to investigate why we are calling that + setTemplateListDependOnId(); } } - Future getPrescription({int mrn}) async { - //hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.getPrescription(mrn: mrn); + + + Future getAssessmentList ({PatiantInformtion patientInfo, bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: patientInfo.appointmentNo); + if (medicationStrengthList.length == 0) { + await getMedicationStrength(isLocalBusy: true); + } + if (medicationDurationList.length == 0) { + await getMedicationDuration(isLocalBusy: true); + } + if (medicationDoseTimeList.length == 0) { + await getMedicationDoseTime(isLocalBusy: true); + } + await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } + } else { setState(ViewState.Idle); + } } + Future getMedicineItem(String itemName) async { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); @@ -105,39 +240,100 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationList({String drug}) async { - setState(ViewState.Busy); + + getMedicationList( + {String drug, bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await getDoctorProfile(isGetProfile: true); await _prescriptionService.getMedicationList(drug: drug); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); - } else + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } + } else { setState(ViewState.Idle); + } } - Future getPatientAssessment(GetAssessmentReqModel getAssessmentReqModel) async { - setState(ViewState.Busy); + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel ,{bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService.getPatientAssessment(getAssessmentReqModel); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getMedicationStrength() async { - setState(ViewState.Busy); - await _prescriptionService.getMasterLookup(MasterKeysService.MedicationStrength); + Future onInitiateAllPrescription({ + PrescriptionViewModel model, + PatiantInformtion patient, + ProcedureTempleteDetailsModel groupProcedures, + BuildContext context, + bool isLocalBusy = true + } + ) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + model.getItem( + itemID: int.parse( + groupProcedures.aliasN.replaceAll("item code ;", ""))); + + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: patient.patientMRN, + episodeID: patient.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: patient.appointmentNo); + if (medicationStrengthList.length == 0) { + await getMedicationStrength(); + } + if (medicationDurationList.length == 0) { + await getMedicationDuration(); + } + if (medicationDoseTimeList.length == 0) { + await getMedicationDoseTime(); + } + await getPatientAssessment(getAssessmentReqModel); + } + + Future getMedicationStrength({bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationStrength); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); - } else + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + }} else setState(ViewState.Idle); } Future getMedicationRoute() async { setState(ViewState.Busy); - await _prescriptionService.getMasterLookup(MasterKeysService.MedicationRoute); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationRoute); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.Error); @@ -147,7 +343,8 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationIndications() async { setState(ViewState.Busy); - await _prescriptionService.getMasterLookup(MasterKeysService.MedicationIndications); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationIndications); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.Error); @@ -155,9 +352,13 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationDoseTime() async { - setState(ViewState.Busy); - await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDoseTime); + Future getMedicationDoseTime({bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationDoseTime); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.Error); @@ -167,7 +368,8 @@ class MedicineViewModel extends BaseViewModel { Future getMedicationFrequency() async { setState(ViewState.Busy); - await _prescriptionService.getMasterLookup(MasterKeysService.MedicationFrequency); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationFrequency); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.Error); @@ -175,17 +377,23 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationDuration() async { - setState(ViewState.Busy); - await _prescriptionService.getMasterLookup(MasterKeysService.MedicationDuration); + Future getMedicationDuration({bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationDuration); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getBoxQuantity({int itemCode, int duration, double strength, int freq}) async { + Future getBoxQuantity( + {int itemCode, int duration, double strength, int freq}) async { setState(ViewState.Busy); await _prescriptionService.calculateBoxQuantity( strength: strength, itemCode: itemCode, duration: duration, freq: freq); diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 93635629..7e18df05 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -2,30 +2,32 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; -import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/clinic-doctor.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.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/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import '../../locator.dart'; class PatientReferralViewModel extends BaseViewModel { - PatientReferralService _referralPatientService = locator(); + PatientReferralService _referralPatientService = + locator(); ReferralService _referralService = locator(); - MyReferralInPatientService _myReferralService = locator(); + MyReferralInPatientService _myReferralService = + locator(); - DischargedPatientService _dischargedPatientService = locator(); + DischargedPatientService _dischargedPatientService = + locator(); List get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients; @@ -34,21 +36,28 @@ class PatientReferralViewModel extends BaseViewModel { List get clinicsList => _referralPatientService.clinicsList; - List get referralFrequencyList => _referralPatientService.frequencyList; + List get referralFrequencyList => + _referralPatientService.frequencyList; List doctorsList = []; - List get clinicDoctorsList => _referralPatientService.doctorsList; + List get clinicDoctorsList => + _referralPatientService.doctorsList; - List get myReferralPatients => _myReferralService.myReferralPatients; + List get myReferralPatients => + _myReferralService.myReferralPatients; - List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; + List get listMyReferredPatientModel => + _referralPatientService.listMyReferredPatientModel; - List get pendingReferral => _referralPatientService.pendingReferralList; + List get pendingReferral => + _referralPatientService.pendingReferralList; - List get patientReferral => _referralPatientService.patientReferralList; + List get patientReferral => + _referralPatientService.patientReferralList; - List get patientArrivalList => _referralPatientService.patientArrivalList; + List get patientArrivalList => + _referralPatientService.patientArrivalList; Future getPatientReferral(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -97,7 +106,8 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async { + Future getClinicDoctors( + PatiantInformtion patient, int clinicId, int branchId) async { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { @@ -115,7 +125,10 @@ class PatientReferralViewModel extends BaseViewModel { Future getDoctorBranch() async { DoctorProfileModel doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { - dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName}; + dynamic _selectedBranch = { + "facilityId": doctorProfile.projectID, + "facilityName": doctorProfile.projectName + }; return _selectedBranch; } return null; @@ -193,7 +206,8 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { + Future replay( + String referredDoctorRemarks, MyReferralPatientModel referral) async { setState(ViewState.Busy); await _myReferralService.replay(referredDoctorRemarks, referral); if (_myReferralService.hasError) { @@ -203,7 +217,8 @@ class PatientReferralViewModel extends BaseViewModel { getMyReferralPatientService(); } - Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async { + Future responseReferral( + MyReferralPatientModel referralPatient, bool isAccepted) async { setState(ViewState.Busy); await _referralPatientService.responseReferral(referralPatient, isAccepted); if (_referralPatientService.hasError) { @@ -213,13 +228,14 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, - String remarks) async { - setState(ViewState.Busy); - await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); + Future makeReferral(PatiantInformtion patient, String isoStringDate, + int projectID, int clinicID, int doctorID, String remarks) async { + setState(ViewState.BusyLocal); + await _referralPatientService.makeReferral( + patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } @@ -256,8 +272,6 @@ class PatientReferralViewModel extends BaseViewModel { } } - - Future getReferralFrequencyList() async { setState(ViewState.Busy); await _referralPatientService.getReferralFrequencyList(); @@ -268,7 +282,8 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { + Future verifyReferralDoctorRemarks( + MyReferredPatientModel referredPatient) async { setState(ViewState.Busy); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); if (_referralPatientService.hasError) { @@ -299,7 +314,7 @@ class PatientReferralViewModel extends BaseViewModel { case 4: return TranslationBase.of(context).referralStatusCancelled /*rejected*/; case 46: - return TranslationBase.of(context).referralStatusCompleted /*accepted*/; + return TranslationBase.of(context).referralStatusCompleted /*accepted*/; case 63: return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; default: @@ -307,7 +322,8 @@ class PatientReferralViewModel extends BaseViewModel { } } - PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) { + PatiantInformtion getPatientFromReferral( + MyReferredPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -335,7 +351,8 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) { + PatiantInformtion getPatientFromReferralO( + MyReferralPatientModel referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -360,7 +377,8 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) { + PatiantInformtion getPatientFromDischargeReferralPatient( + DischargeReferralPatient referredPatient) { PatiantInformtion patient = PatiantInformtion(); patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; @@ -379,15 +397,18 @@ class PatientReferralViewModel extends BaseViewModel { patient.roomId = referredPatient.roomID; patient.bedId = referredPatient.bedID; patient.nationalityName = referredPatient.nationalityName; - patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL; + patient.nationalityFlagURL = + ''; // TODO from backend referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription; return patient; } - Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async { + Future replayReferred(String referredDoctorRemarks, + MyReferralPatientModel referral, int referralStatus) async { setState(ViewState.Busy); - await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus); + await _myReferralService.replayReferred( + referredDoctorRemarks, referral, referralStatus); if (_myReferralService.hasError) { error = _myReferralService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 809c154f..de8bc2f5 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -4,12 +4,12 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.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-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:flutter/material.dart'; @@ -48,7 +48,7 @@ class UcafViewModel extends BaseViewModel { String bloodPressure = "0/0"; resetDataInFirst({bool firstPage = true}) { - if(firstPage){ + if (firstPage) { _ucafService.patientVitalSignsHistory = null; _ucafService.patientChiefComplaintList = null; } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bab2ff9f..fc4bfec3 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.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/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 1d5f087a..242ba6c3 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -8,18 +8,20 @@ import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequest import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/radiology/radiology_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; -import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import '../../locator.dart'; +import '../model/note/stp_master_list_req_model.dart'; +import '../model/note/stp_master_list_res_model.dart'; import 'base_view_model.dart'; class PatientViewModel extends BaseViewModel { @@ -71,6 +73,9 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; + List get stpMasterList => + _patientService.stpMasterList; + Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async { var localRes; @@ -101,16 +106,6 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getOutPatientPrescriptions(patient) async { - setState(ViewState.Busy); - await _patientService.getOutPatientPrescriptions(patient); - if (_patientService.hasError) { - error = _patientService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - Future getInPatientPrescriptions(patient) async { setState(ViewState.Busy); await _patientService.getInPatientPrescriptions(patient); @@ -361,6 +356,32 @@ class PatientViewModel extends BaseViewModel { resultType: resultType, setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); + if (_patientService.hasError) { + error = _patientService.error; + if (isLocalBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getStpMasterList({bool isLocalBusy = false}) async { + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); + + StpMasterListRequestModel requestModel = StpMasterListRequestModel( + isDentalAllowedBackend: false, + languageID: 1, + projectID: 15, + parameterGroup: 7, + parameterType: 362); + + await _patientService.getStpMasterList(requestModel); + if (_patientService.hasError) { error = _patientService.error; if (isLocalBusy) diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index 3f3e92be..d2bac7be 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -2,8 +2,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart'; -import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; class PendingOrdersViewModel extends BaseViewModel { bool hasError = false; diff --git a/lib/core/viewModel/prescription/prescription_view_model.dart b/lib/core/viewModel/prescription/prescription_view_model.dart new file mode 100644 index 00000000..3c2b38a6 --- /dev/null +++ b/lib/core/viewModel/prescription/prescription_view_model.dart @@ -0,0 +1,205 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.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/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.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/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 PrescriptionViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + bool hasError = false; + + PrescriptionService _prescriptionService = locator(); + + + List get medicationForInPatient => + _prescriptionService.medicationForInPatient; + + List get prescriptionList => + _prescriptionService.prescriptionList; + List get prescriptionListNew => + _prescriptionService.prescriptionListNew; + + List get prescriptionReportList => + _prescriptionService.prescriptionReportList; + + List get pharmacyPrescriptionsList => + _prescriptionService.pharmacyPrescriptionsList; + + List get prescriptionReportEnhList => + _prescriptionService.prescriptionReportEnhList; + + + + List get drugToDrug => _prescriptionService.drugToDrugList; + + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); + + + List get prescriptionsList => + _prescriptionService.prescriptionsList; + + Future getItem({int itemID}) async { + hasError = false; + setState(ViewState.BusyLocal); + await _prescriptionService.getItem(itemID: itemID); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getPrescriptionListNew({int mrn,int appNo, bool isLocalBusy = false}) async { + hasError = false; + if(isLocalBusy) + setState(ViewState.BusyLocal); else setState(ViewState.Busy); + await _prescriptionService.getPrescriptionListNew(mrn: mrn, appNo:appNo ); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future postPrescription( + PostPrescriptionReqModel postProcedureReqModel, int mrn) async { + hasError = false; + setState(ViewState.BusyLocal); + await _prescriptionService.postPrescription(postProcedureReqModel); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else { + await getPrescriptionListNew(mrn: mrn); + setState(ViewState.Idle); + } + } + + + Future getDrugToDrug( + VitalSignData vital, + List lstAssessments, + List allergy, + PatiantInformtion patient, + List prescription) async { + hasError = false; + setState(ViewState.BusyLocal); + await _prescriptionService.getDrugToDrug( + vital, lstAssessments, allergy, patient, prescription); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + + void _filterList() { + _prescriptionService.prescriptionsList.forEach((element) { + /// PrescriptionsList list sort clinic + List prescriptionsByClinic = + _prescriptionsOrderListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (prescriptionsByClinic.length != 0) { + _prescriptionsOrderListClinic[ + _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListClinic.add(PrescriptionsList( + filterName: element.clinicDescription, prescriptions: element)); + } + + /// PrescriptionsList list sort via hospital + List prescriptionsByHospital = + _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); + + if (prescriptionsByHospital.length != 0) { + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital + .indexOf(prescriptionsByHospital[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListHospital.add(PrescriptionsList( + filterName: element.name, prescriptions: element)); + } + }); + } + + + _getPrescriptionsOrders() async { + await _prescriptionService.getPrescriptionsOrders(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + getPrescriptions(PatiantInformtion patient, {String patientType, bool isLocalBusy = true}) async { + if(isLocalBusy) + setState(ViewState.BusyLocal); + else setState(ViewState.Busy); + await _prescriptionService.getPrescriptions(patient); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + if (isLocalBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + _filterList(); + await _getPrescriptionsOrders(); + + setState(ViewState.Idle); + } + } + + getMedicationForInPatient(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _prescriptionService.getMedicationForInPatient(patient); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionService.getPrescriptionReport( + prescriptions: prescriptions, patient: patient); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart deleted file mode 100644 index 96645618..00000000 --- a/lib/core/viewModel/prescription_view_model.dart +++ /dev/null @@ -1,265 +0,0 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.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_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/prescriptions_order.dart'; - -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; - -import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:flutter/cupertino.dart'; - -class PrescriptionViewModel extends BaseViewModel { - FilterType filterType = FilterType.Clinic; - bool hasError = false; - PrescriptionService _prescriptionService = locator(); - List get allMedicationList => _prescriptionService.allMedicationList; - List get medicationForInPatient => _prescriptionsService.medicationForInPatient; - - List get prescriptionList => _prescriptionService.prescriptionList; - List get drugsList => _prescriptionService.doctorsList; - //List get allMedicationList => _prescriptionService.allMedicationList; - List get drugToDrug => _prescriptionService.drugToDrugList; - - List get itemMedicineList => _prescriptionService.itemMedicineList; - PrescriptionsService _prescriptionsService = locator(); - - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); - - List get prescriptionReportList => _prescriptionsService.prescriptionReportList; - - List get prescriptionsList => _prescriptionsService.prescriptionsList; - - List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; - List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; - - List get prescriptionsOrderList => - filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; - - List get inPatientPrescription => _prescriptionsService.prescriptionInPatientList; - - getPrescriptionsInPatient(PatiantInformtion patient) async { - setState(ViewState.Busy); - error = ""; - await _prescriptionsService.getPrescriptionInPatient(mrn: patient.patientId, adn: patient.admissionNo); - if (_prescriptionsService.hasError) { - error = "No Prescription Found"; - setState(ViewState.Error); - } else { - _filterList(); - await _getPrescriptionsOrders(); - - setState(ViewState.Idle); - } - } - - Future getItem({int itemID}) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.BusyLocal); - await _prescriptionService.getItem(itemID: itemID); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future getPrescription({int mrn}) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.getPrescription(mrn: mrn); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future postPrescription(PostPrescriptionReqModel postProcedureReqModel, int mrn) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.postPrescription(postProcedureReqModel); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else { - await getPrescription(mrn: mrn); - setState(ViewState.Idle); - } - } - - Future getMedicationList({String drug}) async { - setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - - Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.updatePrescription(updatePrescriptionReqModel); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else { - await getPrescription(mrn: mrn); - setState(ViewState.Idle); - } - } - - Future getDrugs({String drugName}) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.BusyLocal); - await _prescriptionService.getDrugs(drugName: drugName); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future getDrugToDrug(VitalSignData vital, List lstAssessments, - List allergy, PatiantInformtion patient, List prescription) async { - hasError = false; - setState(ViewState.Busy); - await _prescriptionService.getDrugToDrug(vital, lstAssessments, allergy, patient, prescription); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - setFilterType(FilterType filterType) { - this.filterType = filterType; - notifyListeners(); - } - - getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - void _filterList() { - _prescriptionsService.prescriptionsList.forEach((element) { - /// PrescriptionsList list sort clinic - List prescriptionsByClinic = _prescriptionsOrderListClinic - .where((elementClinic) => elementClinic.filterName == element.clinicDescription) - .toList(); - - if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] - .prescriptionsList - .add(element); - } else { - _prescriptionsOrderListClinic - .add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element)); - } - - /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); - - if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])] - .prescriptionsList - .add(element); - } else { - _prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element)); - } - }); - } - - getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - _getPrescriptionsOrders() async { - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - getPrescriptions(PatiantInformtion patient, {String patientType}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptions(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - if (patientType == "7") - setState(ViewState.ErrorLocal); - else - setState(ViewState.ErrorLocal); - } else { - _filterList(); - await _getPrescriptionsOrders(); - - setState(ViewState.Idle); - } - } - - getMedicationForInPatient(PatiantInformtion patient) async { - setState(ViewState.Busy); - await _prescriptionsService.getMedicationForInPatient(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } -} diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart deleted file mode 100644 index 2548a59c..00000000 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ /dev/null @@ -1,141 +0,0 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.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/prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; - -import '../../locator.dart'; -import 'base_view_model.dart'; - -class PrescriptionsViewModel extends BaseViewModel { - FilterType filterType = FilterType.Clinic; - PrescriptionsService _prescriptionsService = locator(); - - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); - - List get prescriptionReportList => _prescriptionsService.prescriptionReportList; - - List get prescriptionsList => _prescriptionsService.prescriptionsList; - - List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; - List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; - - List get prescriptionsOrderList => - filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; - - List get medicationForInPatient => _prescriptionsService.medicationForInPatient; - - List _medicationForInPatient = List(); - - getPrescriptions(PatiantInformtion patient) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptions(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - _filterList(); - await _getPrescriptionsOrders(); - - setState(ViewState.Idle); - } - } - - _getPrescriptionsOrders() async { - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - void _filterList() { - _prescriptionsService.prescriptionsList.forEach((element) { - /// PrescriptionsList list sort clinic - List prescriptionsByClinic = _prescriptionsOrderListClinic - .where((elementClinic) => elementClinic.filterName == element.clinicDescription) - .toList(); - - if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] - .prescriptionsList - .add(element); - } else { - _prescriptionsOrderListClinic - .add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element)); - } - - /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); - - if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])] - .prescriptionsList - .add(element); - } else { - _prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element)); - } - }); - } - - setFilterType(FilterType filterType) { - this.filterType = filterType; - notifyListeners(); - } - - getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - getMedicationForInPatient(PatiantInformtion patient) async { - await _prescriptionsService.getMedicationForInPatient(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } -} diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index b576b7a4..2bcfad33 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; @@ -18,12 +19,12 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/p import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:flutter/cupertino.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; +import '../../widgets/shared/loader/gif_loader_dialog_utils.dart'; class ProcedureViewModel extends BaseViewModel { //TODO Hussam clean it @@ -31,11 +32,14 @@ class ProcedureViewModel extends BaseViewModel { bool hasError = false; ProcedureService _procedureService = locator(); - List get procedureList => _procedureService.procedureList; + List get procedureList => + _procedureService.procedureList; - List get valadteProcedureList => _procedureService.valadteProcedureList; + List get valadteProcedureList => + _procedureService.valadteProcedureList; - List get categoriesList => _procedureService.categoriesList; + List get categoriesList => + _procedureService.categoriesList; List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); @@ -44,18 +48,25 @@ class ProcedureViewModel extends BaseViewModel { List _finalRadiologyListHospital = List(); List get finalRadiologyList => - filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; - List get radiologyList => _radiologyService.finalRadiologyList; + List get radiologyList => + _radiologyService.finalRadiologyList; - List get patientLabOrdersList => _labsService.patientLabOrdersList; + List get patientLabOrdersList => + _labsService.patientLabOrdersList; - List get labOrdersResultsList => _labsService.labOrdersResultsList; + List get labOrdersResultsList => + _labsService.labOrdersResultsList; - List get procedureTemplate => _procedureService.templateList; + List get procedureTemplate => + _procedureService.templateList; List templateList = List(); - List get procedureTemplateDetails => _procedureService.templateDetailsList; + List get procedureTemplateDetails => + _procedureService.templateDetailsList; List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -66,7 +77,8 @@ class ProcedureViewModel extends BaseViewModel { //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); + await _procedureService.getProcedure( + mrn: mrn, appointmentNo: appointmentNo); if (_procedureService.hasError) { error = _procedureService.error; if (patientType == "7") @@ -77,12 +89,15 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { + Future getProcedureCategory( + {String categoryName, String categoryID, patientId}) async { if (categoryName == null) return; hasError = false; setState(ViewState.Busy); await _procedureService.getProcedureCategory( - categoryName: categoryName, categoryID: categoryID, patientId: patientId); + categoryName: categoryName, + categoryID: categoryID, + patientId: patientId); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -102,29 +117,37 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate({String categoryID}) async { - hasError = false; - setState(ViewState.Busy); - await _procedureService.getProcedureTemplate(categoryID: categoryID); + Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); - } else { + } else setTemplateListDependOnId(); setState(ViewState.Idle); - } } setTemplateListDependOnId() { procedureTemplate.forEach((element) { - List templateListData = - templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList(); + List templateListData = templateList + .where((elementTemplate) => + elementTemplate.templateId == element.templateID) + .toList(); if (templateListData.length != 0) { - templateList[templateList.indexOf(templateListData[0])].procedureTemplate.add(element); + templateList[templateList.indexOf(templateListData[0])] + .procedureTemplate + .add(element); } else { var template = ProcedureTempleteDetailsModelList( - templateName: element.templateName, templateId: element.templateID, template: element); + templateName: element.templateName, + templateId: element.templateID, + template: element); if (!templateList.contains(template)) templateList.add(template); } }); @@ -146,7 +169,8 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn) async { + Future postProcedure( + PostProcedureReqModel postProcedureReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -160,7 +184,8 @@ class ProcedureViewModel extends BaseViewModel { } } - Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async { + Future valadteProcedure( + ProcedureValadteRequestModel procedureValadteRequestModel) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -173,7 +198,9 @@ class ProcedureViewModel extends BaseViewModel { } } - Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn}) async { + Future updateProcedure( + {UpdateProcedureRequestModel updateProcedureRequestModel, + int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -186,9 +213,11 @@ 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); + await _radiologyService.getPatientRadOrders(patient, + isInPatient: isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; if (patientType == "7") @@ -197,32 +226,39 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = _finalRadiologyListClinic - .where((elementClinic) => elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + _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 finalRadiologyListHospital = _finalRadiologyListHospital - .where( - (elementClinic) => elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])] + _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)); } }); @@ -232,10 +268,17 @@ class ProcedureViewModel 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, + @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); + invoiceNo: invoiceNo, + lineItem: lineItem, + projectId: projectId, + patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); @@ -248,7 +291,8 @@ class ProcedureViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => + _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; @@ -270,10 +314,18 @@ class ProcedureViewModel extends BaseViewModel { } getLaboratoryResult( - {String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { + {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); + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID, + patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -282,10 +334,15 @@ 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); + patientLabOrder: patientLabOrder, + procedure: procedure, + patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -293,8 +350,9 @@ 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(); @@ -317,7 +375,8 @@ class ProcedureViewModel extends BaseViewModel { List entityList, ProcedureType procedureType}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; @@ -332,13 +391,21 @@ class ProcedureViewModel extends BaseViewModel { procedureValadteRequestModel.procedure = [element.procedureId]; List controls = List(); controls.add( - Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( - Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"), + Controls( + code: "ordertype", + controlValue: procedureType == ProcedureType.PROCEDURE + ? element.type ?? "1" + : "0"), ); - controlsProcedure - .add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls)); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); }); postProcedureReqModel.procedures = controlsProcedure; @@ -358,7 +425,8 @@ class ProcedureViewModel extends BaseViewModel { Helpers.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); + Helpers.showErrorToast( + valadteProcedureList[0].entityList[0].warringMessages); } } } else { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 9db5a6dd..d6b8aa77 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -1,10 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; -import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; class DischargeSummaryViewModel extends BaseViewModel { bool hasError = false; @@ -14,16 +13,20 @@ class DischargeSummaryViewModel extends BaseViewModel { List get pendingDischargeSummaryList => _dischargeSummaryService.pendingDischargeSummaryList; - List get allDisChargeSummaryList => _dischargeSummaryService.allDischargeSummaryList; - - Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + Future getPendingDischargeSummary({ + int patientId, + int admissionNo, + }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = + GetDischargeSummaryReqModel( + admissionNo: admissionNo, patientID: patientId); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getPendingDischargeSummary( + getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { error = _dischargeSummaryService.error; setState(ViewState.ErrorLocal); @@ -32,13 +35,17 @@ class DischargeSummaryViewModel extends BaseViewModel { } } - - - Future getAllDischargeSummary({int patientId, int admissionNo, }) async { - GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + Future getAllDischargeSummary({ + int patientId, + int admissionNo, + }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = + GetDischargeSummaryReqModel( + admissionNo: admissionNo, patientID: patientId); hasError = false; setState(ViewState.Busy); - await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + await _dischargeSummaryService.getAllDischargeSummary( + getDischargeSummaryReqModel: getDischargeSummaryReqModel); if (_dischargeSummaryService.hasError) { error = _dischargeSummaryService.error; setState(ViewState.ErrorLocal); @@ -46,5 +53,4 @@ class DischargeSummaryViewModel extends BaseViewModel { setState(ViewState.Idle); } } - } diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart new file mode 100644 index 00000000..57e3be78 --- /dev/null +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -0,0 +1,147 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_res_model.dart'; + +import '../../../util/date-utils.dart'; +import '../../service/patient/profile/intervention_medication_service.dart'; +import '../../service/special_clinics/special_clinic_service.dart'; + +class InterventionMedicationViewModel extends BaseViewModel { + SpecialClinicsService _specialClinicsService = + locator(); + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; + + List filterData = []; + + DateTime selectedFromDate = DateTime.now(); + DateTime selectedToDate = DateTime.now().add(Duration(days: 1)); + + PatiantInformtion patient; + bool hasError = false; + InterventionMedicationService _interventionMedicationService = + locator(); + + List get allInterventionList => + _interventionMedicationService.allInterventionList; + + List get allInterventionHistoryList => + _interventionMedicationService.allInterventionHistoryList; + + Future getInterventionMedication({ + + int projectId, + int patientId, + DateTime fromDate, + DateTime toDate, + + }) async { + InterventionMedicationReqModel interventionMedicationReqModel = + InterventionMedicationReqModel( + + projectID: projectId, + patientID: patientId, + fromDate: AppDateUtils.convertDateToServerFormat(fromDate), + toDate: AppDateUtils.convertDateToServerFormat(toDate), + + ); + hasError = false; + setState(ViewState.Busy); + await _interventionMedicationService.getInterventionMedication( + interventionMedicationReqModel: interventionMedicationReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getInterventionMedicationHistory( + { + int projectId, + int patientId, + int admissionNo, + int prescriptionNo, + int orderNo, + + bool isBusyLocal = false}) async { + InterventionMedicationHistoryReqModel + interventionMedicationHistoryReqModel = + InterventionMedicationHistoryReqModel( + + projectID: projectId, + patientID: patientId, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + + ); + hasError = false; + if (isBusyLocal) + setState(ViewState.Busy); + else + setState(ViewState.Busy); + await _interventionMedicationService.getInterventionMedicationHistory( + interventionMedicationHistoryReqModel: + interventionMedicationHistoryReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + if (isBusyLocal) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future setAcceptedOrRejected({ + + String remarks, + int memberId, + int projectId, + int patientID, + int admissionNo, + int prescriptionNo, + int orderNo, + int interventionStatus, + int status, + + }) async { + AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( + + projectID: projectId, + patientID: patientID, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + accessLevel: 4, + lineItemNo: 1, + remarks: remarks, + memberID: memberId, + interventionStatus: interventionStatus, + status: status + + ); + hasError = false; + setState(ViewState.BusyLocal); + await _interventionMedicationService.setAcceptedOrRejected( + acceptOrRejectReqModel: acceptOrRejectReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index e3f4f430..d57af118 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_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_request_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; class OperationReportViewModel extends BaseViewModel { bool hasError = false; @@ -30,11 +30,17 @@ class OperationReportViewModel extends BaseViewModel { } } - Future getOperationReportDetails(GetReservationsResponseModel reservation) async { + Future getOperationReportDetails( + GetReservationsResponseModel reservation) async { hasError = false; setState(ViewState.Busy); - GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" ); - await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel); + GetOperationDetailsRequestModel getOperationReportRequestModel = + GetOperationDetailsRequestModel( + reservationNo: reservation.oTReservationID, + patientID: reservation.patientID, + setupID: "010266"); + await _operationReportService.getOperationReportDetails( + getOperationReportRequestModel: getOperationReportRequestModel); if (_operationReportService.hasError) { error = _operationReportService.error; setState(ViewState.ErrorLocal); @@ -43,13 +49,12 @@ class OperationReportViewModel extends BaseViewModel { } } - - Future updateOperationReport( CreateUpdateOperationReportRequestModel - createUpdateOperationReport) async { + createUpdateOperationReport) async { setState(ViewState.BusyLocal); - await _operationReportService.updateOperationReport(createUpdateOperationReport); + await _operationReportService + .updateOperationReport(createUpdateOperationReport); if (_operationReportService.hasError) { error = _operationReportService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart b/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart new file mode 100644 index 00000000..bb0bd453 --- /dev/null +++ b/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; +import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + + + +class PharmacyInterventionViewModel extends BaseViewModel { + OutPatientService _outPatientService = locator(); + SpecialClinicsService _specialClinicsService = + locator(); + + List get patientList => _outPatientService.patientList; + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; + + List filterData = []; + + DateTime selectedFromDate; + DateTime selectedToDate; + + int firstSubsetIndex = 0; + int inPatientPageSize = 20; + int lastSubsetIndex = 20; + + List InpatientClinicList = []; + + + PatientInPatientService _inPatientService = + locator(); + + List get inPatientList => _inPatientService.inPatientList; + + List get myIinPatientList => + _inPatientService.myInPatientList; + + List filteredInPatientItems = List(); + List filteredMyInPatientItems = List(); + +} diff --git a/lib/core/viewModel/profile/vte_assessment_view_model.dart b/lib/core/viewModel/profile/vte_assessment_view_model.dart new file mode 100644 index 00000000..0ab3fa07 --- /dev/null +++ b/lib/core/viewModel/profile/vte_assessment_view_model.dart @@ -0,0 +1,37 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/vte_assessment_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; + +class VteAssessmentViewModel extends BaseViewModel { + bool hasError = false; + VteAssessmentService _VteAssessmentService = + locator(); + + List get allVteHistoryList => + _VteAssessmentService.allVteHistoryList; + + Future getVteAssessment({ + int patientId, + int admissionNo, + }) async { + VteAssessmentRequestModel vteAssessmentRequestModel = + VteAssessmentRequestModel( + transactionNo: admissionNo); + hasError = false; + setState(ViewState.Busy); + await _VteAssessmentService.getVteAssessment( + vteAssessmentRequestModel: vteAssessmentRequestModel); + if (_VteAssessmentService.hasError) { + error = _VteAssessmentService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index e7b7a80f..ddf7c4ab 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -4,8 +4,8 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:flutter/cupertino.dart'; @@ -31,6 +31,7 @@ class ProjectViewModel with ChangeNotifier { bool get isArabic => _isArabic; StreamSubscription subscription; + ProjectViewModel() { loadSharedPrefLanguage(); @@ -115,7 +116,11 @@ class ProjectViewModel with ChangeNotifier { void getProfile() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,); + ClinicModel clinicModel = ClinicModel( + doctorID: doctorProfile.doctorID, + clinicID: doctorProfile.clinicID, + projectID: doctorProfile.projectID, + ); await Provider.of(AppGlobal.CONTEX, listen: false) .getDoctorProfileBasedOnClinic(clinicModel); diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index d656de6c..98fbc59a 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:flutter/foundation.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 892284e2..61c6d930 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/referral_patient_service.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index b49078c7..680d871e 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -3,13 +3,15 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestM import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class ScanQrViewModel extends BaseViewModel { ScanQrService _scanQrService = locator(); + List get inPatientList => _scanQrService.inPatientList; - Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false}) async { await getDoctorProfile(); setState(ViewState.Busy); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 3ee64c9b..04d49f36 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/schedule_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 7a7f4575..7fe2ef9b 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.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/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/models/sickleave/sick_leave_statisitics_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/sick_leave_statisitics_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -84,24 +84,27 @@ class SickLeaveViewModel extends BaseViewModel { if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.ErrorLocal); - } else 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) { + if (_sickLeaveService.hasError) { error = _sickLeaveService.error; // if (isLocalBusy) - setState(ViewState.ErrorLocal); + setState(ViewState.ErrorLocal); // else // setState(ViewState.Error); diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index a73be2e3..c962adcd 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,209 +11,397 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// * MFG Labs, Copyright (C) 2012 by Daniel Bruce /// Author: MFG Labs /// License: SIL (http://scripts.sil.org/OFL) /// Homepage: http://www.mfglabs.com/ /// import 'package:flutter/widgets.dart'; -import 'package:flutter/widgets.dart'; class DoctorApp { DoctorApp._(); - static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const _kFontFam = 'DoctorApp'; + static const String _kFontPkg = null; + + static const IconData female_icon = + IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reject_icon = + IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = + IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = + IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = + IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = + IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = + IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = + IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = + IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = + IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData approved_icon = + IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pending_icon = + IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = + IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = + IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = + IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_1 = + IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData progress_notes = + IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_1 = + IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData operations = + IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = + IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient = + IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code = + IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = + IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = + IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male_2 = + IconData(0xe819, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = + IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_1 = + IconData(0xe81b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active_1 = + IconData(0xe81c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_1 = + IconData(0xe81d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mail = + IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medicine_search = + IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code_1 = + IconData(0xe820, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_1 = + IconData(0xe821, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referred = + IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData send = + IconData(0xe823, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData sync_icon = + IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData drawer_icon = + IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData view = + IconData(0xe826, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData warning = + IconData(0xe827, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData add = + IconData(0xe828, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData close = + IconData(0xe829, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData back = + IconData(0xe82a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData health_summary = + IconData(0xe82b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData powered_by_cs = + IconData(0xe82c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code_2 = + IconData(0xe82d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ecg = + IconData(0xe82e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData create_episode = + IconData(0xe82f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData booked = + IconData(0xe830, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData admission_req = + IconData(0xe831, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData walkin = + IconData(0xe832, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reschedule_ = + IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData edit = + IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData leaves = + IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData logout = + IconData(0xe837, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData obese_bmi = + IconData(0xe838, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData livecare = + IconData(0xe839, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData health_bmi = + IconData(0xe83a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData health_bmi_r = + IconData(0xe83b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData modify_episode = + IconData(0xe83c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData height = + IconData(0xe83d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData obese_bmi_r = + IconData(0xe83e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ovrweight_bmi = + IconData(0xe83f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_prescription = + IconData(0xe840, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_procedures = + IconData(0xe841, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ovrweight_bmi_r = + IconData(0xe842, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData respiration_rate = + IconData(0xe843, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient_sick_leave = + IconData(0xe844, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData progress_notes_1 = + IconData(0xe845, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData temperature = + IconData(0xe846, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData underweight_bmi = + IconData(0xe847, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology_1 = + IconData(0xe848, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient_1 = + IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_bg = + IconData(0xe84a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search = + IconData(0xe84b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_bg = + IconData(0xe84c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arrival_patients = + IconData(0xe84d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arrival_patients_bg = + IconData(0xe84e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData refer_patient = + IconData(0xe84f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData underweight_bmi_r = + IconData(0xe850, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData weight = + IconData(0xe851, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData blood_pressure = + IconData(0xe852, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData vital_signs = + IconData(0xe853, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ucaf = + IconData(0xe854, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData filter = + IconData(0xe855, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male_1 = + IconData(0xe856, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female = + IconData(0xe857, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData external_link = + IconData(0xe858, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_face_2 = + IconData(0xe859, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_sms_2 = + IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home = + IconData(0xe85b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_finger_2 = + IconData(0xe85c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData dr_reply_active = + IconData(0xe85d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData dr_reply = + IconData(0xe85e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_active = + IconData(0xe85f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule = + IconData(0xe860, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_reader_active = + IconData(0xe861, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_reader = + IconData(0xe862, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_active = + IconData(0xe863, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arrow_forward = + IconData(0xe864, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData heart_rate = + IconData(0xe865, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active_1 = + IconData(0xe866, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_1 = + IconData(0xe867, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active_1 = + IconData(0xe868, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active_1 = + IconData(0xe869, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ovrweight_bmi_r_1 = + IconData(0xe86a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData underweight_bmi_1 = + IconData(0xe86b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData temperature_1 = + IconData(0xe86c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData underweight_bmi_r_1 = + IconData(0xe86d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData weight_1 = + IconData(0xe86e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData blood_pressure_1 = + IconData(0xe86f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData health_bmi_r_1 = + IconData(0xe870, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData health_bmi_1 = + IconData(0xe871, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData heart_rate_1 = + IconData(0xe872, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData height_1 = + IconData(0xe873, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData obese_bmi_1 = + IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ovrweight_bmi_1 = + IconData(0xe875, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData respiration_rate_1 = + IconData(0xe876, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code_3 = + IconData(0xe877, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reschedule__1 = + IconData(0xe878, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData logout_1 = + IconData(0xe879, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData livecare_1 = + IconData(0xe87a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData modify_episode_1 = + IconData(0xe87b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_prescription_1 = + IconData(0xe87c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_procedures_1 = + IconData(0xe87d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient_sick_leave_1 = + IconData(0xe87e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData progress_notes_2 = + IconData(0xe87f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology_2 = + IconData(0xe880, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData refer_patient_1 = + IconData(0xe881, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ucaf_1 = + IconData(0xe882, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData vital_signs_1 = + IconData(0xe883, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData walkin_1 = + IconData(0xe884, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData admission_req_1 = + IconData(0xe885, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData booked_1 = + IconData(0xe886, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData create_episode_1 = + IconData(0xe887, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData ecg_1 = + IconData(0xe888, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData health_summary_1 = + IconData(0xe889, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results_1 = + IconData(0xe88a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_2 = + IconData(0xe88b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData filter_1 = + IconData(0xe88c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male_3 = + IconData(0xe88d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_2 = + IconData(0xe88e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData send_1 = + IconData(0xe88f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData view_1 = + IconData(0xe890, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData warning_1 = + IconData(0xe891, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData add_1 = + IconData(0xe892, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arrow_forward_1 = + IconData(0xe893, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData back_1 = + IconData(0xe894, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData close_1 = + IconData(0xe895, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData edit_1 = + IconData(0xe896, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData external_link_1 = + IconData(0xe897, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_finger_1 = + IconData(0xe898, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_sms_1 = + IconData(0xe899, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_face_1 = + IconData(0xe89a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_reader_1 = + IconData(0xe89b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_reader_active_1 = + IconData(0xe89c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_1 = + IconData(0xe89d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_active_1 = + IconData(0xe89e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData dr_reply_1 = + IconData(0xe89f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData dr_reply_active_1 = + IconData(0xe8a0, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_1 = + IconData(0xe8a1, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_active_1 = + IconData(0xe8a2, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_face = + IconData(0xe8a3, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_finger = + IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_whtsapp = + IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData verify_sms = + IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral_1 = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData progress_notes = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_1 = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code = IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male_2 = IconData(0xe819, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData female_1 = IconData(0xe81b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active_1 = IconData(0xe81c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_1 = IconData(0xe81d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code_1 = IconData(0xe820, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_1 = IconData(0xe821, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData send = IconData(0xe823, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData view = IconData(0xe826, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData warning = IconData(0xe827, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData add = IconData(0xe828, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData close = IconData(0xe829, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData back = IconData(0xe82a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData health_summary = IconData(0xe82b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData powered_by_cs = IconData(0xe82c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code_2 = IconData(0xe82d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ecg = IconData(0xe82e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData create_episode = IconData(0xe82f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData booked = IconData(0xe830, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData admission_req = IconData(0xe831, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData walkin = IconData(0xe832, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reschedule_ = IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData edit = IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData logout = IconData(0xe837, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData obese_bmi = IconData(0xe838, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData livecare = IconData(0xe839, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData health_bmi = IconData(0xe83a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData health_bmi_r = IconData(0xe83b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData modify_episode = IconData(0xe83c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData height = IconData(0xe83d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData obese_bmi_r = IconData(0xe83e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ovrweight_bmi = IconData(0xe83f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData order_prescription = IconData(0xe840, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData order_procedures = IconData(0xe841, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ovrweight_bmi_r = IconData(0xe842, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData respiration_rate = IconData(0xe843, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient_sick_leave = IconData(0xe844, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData progress_notes_1 = IconData(0xe845, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData temperature = IconData(0xe846, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData underweight_bmi = IconData(0xe847, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology_1 = IconData(0xe848, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient_1 = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral_bg = IconData(0xe84a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search = IconData(0xe84b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_bg = IconData(0xe84c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData arrival_patients = IconData(0xe84d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData arrival_patients_bg = IconData(0xe84e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData refer_patient = IconData(0xe84f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData underweight_bmi_r = IconData(0xe850, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData weight = IconData(0xe851, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData blood_pressure = IconData(0xe852, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData vital_signs = IconData(0xe853, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ucaf = IconData(0xe854, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData filter = IconData(0xe855, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male_1 = IconData(0xe856, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData female = IconData(0xe857, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData external_link = IconData(0xe858, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_face_2 = IconData(0xe859, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_sms_2 = IconData(0xe85a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home = IconData(0xe85b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_finger_2 = IconData(0xe85c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData dr_reply_active = IconData(0xe85d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData dr_reply = IconData(0xe85e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_active = IconData(0xe85f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule = IconData(0xe860, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_reader_active = IconData(0xe861, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_reader = IconData(0xe862, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_active = IconData(0xe863, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData arrow_forward = IconData(0xe864, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData heart_rate = IconData(0xe865, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active_1 = IconData(0xe866, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_1 = IconData(0xe867, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active_1 = IconData(0xe868, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active_1 = IconData(0xe869, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ovrweight_bmi_r_1 = IconData(0xe86a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData underweight_bmi_1 = IconData(0xe86b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData temperature_1 = IconData(0xe86c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData underweight_bmi_r_1 = IconData(0xe86d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData weight_1 = IconData(0xe86e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData blood_pressure_1 = IconData(0xe86f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData health_bmi_r_1 = IconData(0xe870, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData health_bmi_1 = IconData(0xe871, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData heart_rate_1 = IconData(0xe872, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData height_1 = IconData(0xe873, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData obese_bmi_1 = IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ovrweight_bmi_1 = IconData(0xe875, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData respiration_rate_1 = IconData(0xe876, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code_3 = IconData(0xe877, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reschedule__1 = IconData(0xe878, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData logout_1 = IconData(0xe879, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData livecare_1 = IconData(0xe87a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData modify_episode_1 = IconData(0xe87b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData order_prescription_1 = IconData(0xe87c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData order_procedures_1 = IconData(0xe87d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient_sick_leave_1 = IconData(0xe87e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData progress_notes_2 = IconData(0xe87f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology_2 = IconData(0xe880, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData refer_patient_1 = IconData(0xe881, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ucaf_1 = IconData(0xe882, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData vital_signs_1 = IconData(0xe883, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData walkin_1 = IconData(0xe884, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData admission_req_1 = IconData(0xe885, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData booked_1 = IconData(0xe886, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData create_episode_1 = IconData(0xe887, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData ecg_1 = IconData(0xe888, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData health_summary_1 = IconData(0xe889, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results_1 = IconData(0xe88a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData female_2 = IconData(0xe88b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData filter_1 = IconData(0xe88c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male_3 = IconData(0xe88d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_2 = IconData(0xe88e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData send_1 = IconData(0xe88f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData view_1 = IconData(0xe890, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData warning_1 = IconData(0xe891, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData add_1 = IconData(0xe892, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData arrow_forward_1 = IconData(0xe893, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData back_1 = IconData(0xe894, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData close_1 = IconData(0xe895, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData edit_1 = IconData(0xe896, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData external_link_1 = IconData(0xe897, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_finger_1 = IconData(0xe898, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_sms_1 = IconData(0xe899, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_face_1 = IconData(0xe89a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_reader_1 = IconData(0xe89b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_reader_active_1 = IconData(0xe89c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_1 = IconData(0xe89d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_active_1 = IconData(0xe89e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData dr_reply_1 = IconData(0xe89f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData dr_reply_active_1 = IconData(0xe8a0, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_1 = IconData(0xe8a1, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_active_1 = IconData(0xe8a2, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_face = IconData(0xe8a3, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_finger = IconData(0xe8a4, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_whtsapp = IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); /// static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); ///static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData obese_bmi_r_1 = IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData end_call = IconData(0xe8d4, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData end_consultaion = IconData(0xe8d5, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData folder_open = IconData(0xe8d6, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData folder = IconData(0xe8d7, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData link_in = IconData(0xe8d8, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData link_out = IconData(0xe8d9, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mute_microphone = IconData(0xe8da, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData no_video = IconData(0xe8db, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData send_instruction = IconData(0xe8dc, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData transfer_to_admin = IconData(0xe8dd, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData inpatient = IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge = IconData(0xe95a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData order_sheets = IconData(0xe95b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData call = IconData(0xe95c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medical_report = IconData(0xe95d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData painscale = IconData(0xe95e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData oxygenation = IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData speechtotext = IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_medicines = IconData(0xe964, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patients = IconData(0xe965, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral_discharge = IconData(0xe966, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData obese_bmi_r_1 = + IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData end_call = + IconData(0xe8d4, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData end_consultaion = + IconData(0xe8d5, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData folder_open = + IconData(0xe8d6, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData folder = + IconData(0xe8d7, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData link_in = + IconData(0xe8d8, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData link_out = + IconData(0xe8d9, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mute_microphone = + IconData(0xe8da, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData no_video = + IconData(0xe8db, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData send_instruction = + IconData(0xe8dc, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData transfer_to_admin = + IconData(0xe8dd, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData inpatient = + IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge = + IconData(0xe95a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_sheets = + IconData(0xe95b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData call = + IconData(0xe95c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medical_report = + IconData(0xe95d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData painscale = + IconData(0xe95e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData oxygenation = + IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData speechtotext = + IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_medicines = + IconData(0xe964, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patients = + IconData(0xe965, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_discharge = + IconData(0xe966, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/landing_page.dart b/lib/landing_page.dart index fcdb1eff..c069e7e7 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,3 +1,5 @@ +//@dart=2.9 + import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; @@ -8,10 +10,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class LandingPage extends StatefulWidget { @@ -42,8 +44,9 @@ class _LandingPageState extends State { return AppScaffold( appBar: currentTab != 0 ? AppBar( + toolbarHeight: 95, elevation: 0, - backgroundColor: Colors.grey[100], + backgroundColor: HexColor('#FFFFFF'), //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: currentTab != 0 ? AppText( @@ -58,7 +61,9 @@ class _LandingPageState extends State { builder: (BuildContext context) { return Container( width: 40, - margin: EdgeInsets.only(left: projectViewModel.isArabic? 0:20, right: projectViewModel.isArabic? 20:0), + margin: EdgeInsets.only( + left: projectViewModel.isArabic ? 0 : 20, + right: projectViewModel.isArabic ? 20 : 0), child: IconButton( icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 25, width: 10), @@ -116,6 +121,7 @@ class MyAppbar extends StatelessWidget with PreferredSizeWidget { MyAppbar({Key key}) : preferredSize = Size.fromHeight(0.0), super(key: key); + @override Widget build(BuildContext context) { return Container(); diff --git a/lib/locator.dart b/lib/locator.dart index 18c04ffc..0bdfe8e9 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -5,16 +5,15 @@ import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; - import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; import 'core/service/PatientRegistrationService.dart'; @@ -32,7 +31,9 @@ import 'core/service/patient/out_patient_service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart'; import 'core/service/patient/patientInPatientService.dart'; import 'core/service/patient/patient_service.dart'; +import 'core/service/patient/profile/intervention_medication_service.dart'; import 'core/service/patient/profile/operation_report_servive.dart'; +import 'core/service/patient/profile/vte_assessment_service.dart'; import 'core/service/patient/referral_patient_service.dart'; import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; @@ -41,7 +42,6 @@ import 'core/service/patient_medical_file/medical_report/PatientMedicalReportSer import 'core/service/patient_medical_file/medical_report/medical_file_service.dart'; import 'core/service/patient_medical_file/prescription/medicine_service.dart'; import 'core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'core/service/patient_medical_file/procedure/procedure_service.dart'; import 'core/service/patient_medical_file/radiology/radiology_service.dart'; import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart'; @@ -64,7 +64,8 @@ import 'core/viewModel/patient-admission-request-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'core/viewModel/prescriptions_view_model.dart'; +import 'core/viewModel/profile/intervention_medication_view_model.dart'; +import 'core/viewModel/profile/vte_assessment_view_model.dart'; import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -94,7 +95,6 @@ void setupLocator() { locator.registerLazySingleton(() => LabsService()); locator.registerLazySingleton(() => InsuranceCardService()); locator.registerLazySingleton(() => RadiologyService()); - locator.registerLazySingleton(() => PrescriptionsService()); locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => DischargedPatientService()); @@ -112,6 +112,8 @@ void setupLocator() { locator.registerLazySingleton(() => PendingOrderService()); locator.registerLazySingleton(() => PatientRegistrationService()); locator.registerLazySingleton(() => DischargeSummaryService()); + locator.registerLazySingleton(() => VteAssessmentService()); + locator.registerLazySingleton(() => InterventionMedicationService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -133,7 +135,6 @@ void setupLocator() { locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => InsuranceViewModel()); locator.registerFactory(() => RadiologyViewModel()); - locator.registerFactory(() => PrescriptionsViewModel()); locator.registerFactory(() => DischargedPatientViewModel()); locator.registerFactory(() => PatientSearchViewModel()); locator.registerFactory(() => HospitalViewModel()); @@ -144,5 +145,6 @@ void setupLocator() { locator.registerFactory(() => PatientRegistrationViewModel()); locator.registerFactory(() => PendingOrdersViewModel()); locator.registerFactory(() => DischargeSummaryViewModel()); - + locator.registerFactory(() => VteAssessmentViewModel()); + locator.registerFactory(() => InterventionMedicationViewModel()); } diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/models/patient/get_pending_patient_er_model.dart deleted file mode 100644 index e1b50a81..00000000 --- a/lib/models/patient/get_pending_patient_er_model.dart +++ /dev/null @@ -1,183 +0,0 @@ -/* - *@author: Amjad Amireh - *@Date:15/6/2020 - *@param: - *@return: - *@desc: Find list of pending patients Model - */ -import 'dart:convert'; - -ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str)); - -String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson()); - -class ListPendingPatientListModel { - ListPendingPatientListModel({ - this.acceptedBy, - this.acceptedOn, - this.age, - this.appointmentNo, - this.arrivalTime, - this.arrivalTimeD, - this.callStatus, - this.clientRequestId, - this.clinicName, - this.consoltationEnd, - this.consultationNotes, - this.createdOn, - this.dateOfBirth, - this.deviceToken, - this.deviceType, - this.doctorName, - this.editOn, - this.gender, - this.isFollowUp, - this.isFromVida, - this.isLoginB, - this.isOutKsa, - this.isRejected, - this.language, - this.latitude, - this.longitude, - this.mobileNumber, - this.openSession, - this.openTokenId, - this.patientId, - this.patientName, - this.patientStatus, - this.preferredLanguage, - this.projectId, - this.scoring, - this.serviceId, - this.tokenId, - this.vcId, - this.voipToken, - }); - - dynamic acceptedBy; - dynamic acceptedOn; - int age; - dynamic appointmentNo; - String arrivalTime; - String arrivalTimeD; - int callStatus; - String clientRequestId; - String clinicName; - dynamic consoltationEnd; - dynamic consultationNotes; - dynamic createdOn; - DateTime dateOfBirth; - String deviceToken; - String deviceType; - dynamic doctorName; - String editOn; - String gender; - bool isFollowUp; - dynamic isFromVida; - int isLoginB; - bool isOutKsa; - int isRejected; - String language; - double latitude; - double longitude; - String mobileNumber; - dynamic openSession; - dynamic openTokenId; - String patientId; - String patientName; - int patientStatus; - String preferredLanguage; - int projectId; - int scoring; - int serviceId; - dynamic tokenId; - int vcId; - String voipToken; - - factory ListPendingPatientListModel.fromJson(Map json) => ListPendingPatientListModel( - acceptedBy: json["AcceptedBy"], - acceptedOn: json["AcceptedOn"], - age: json["Age"], - appointmentNo: json["AppointmentNo"], - arrivalTime: json["ArrivalTime"], - arrivalTimeD: json["ArrivalTimeD"], - callStatus: json["CallStatus"], - clientRequestId: json["ClientRequestID"], - clinicName: json["ClinicName"], - consoltationEnd: json["ConsoltationEnd"], - consultationNotes: json["ConsultationNotes"], - createdOn: json["CreatedOn"], - dateOfBirth: DateTime.parse(json["DateOfBirth"]), - deviceToken: json["DeviceToken"], - deviceType: json["DeviceType"], - doctorName: json["DoctorName"], - editOn: json["EditOn"], - gender: json["Gender"], - isFollowUp: json["IsFollowUP"], - isFromVida: json["IsFromVida"], - isLoginB: json["IsLoginB"], - isOutKsa: json["IsOutKSA"], - isRejected: json["IsRejected"], - language: json["Language"], - latitude: json["Latitude"].toDouble(), - longitude: json["Longitude"].toDouble(), - mobileNumber: json["MobileNumber"], - openSession: json["OpenSession"], - openTokenId: json["OpenTokenID"], - patientId: json["PatientID"], - patientName: json["PatientName"], - patientStatus: json["PatientStatus"], - preferredLanguage: json["PreferredLanguage"], - projectId: json["ProjectID"], - scoring: json["Scoring"], - serviceId: json["ServiceID"], - tokenId: json["TokenID"], - vcId: json["VC_ID"], - voipToken: json["VoipToken"], - ); - - Map toJson() => { - "AcceptedBy": acceptedBy, - "AcceptedOn": acceptedOn, - "Age": age, - "AppointmentNo": appointmentNo, - "ArrivalTime": arrivalTime, - "ArrivalTimeD": arrivalTimeD, - "CallStatus": callStatus, - "ClientRequestID": clientRequestId, - "ClinicName": clinicName, - "ConsoltationEnd": consoltationEnd, - "ConsultationNotes": consultationNotes, - "CreatedOn": createdOn, - "DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}", - "DeviceToken": deviceToken, - "DeviceType": deviceType, - "DoctorName": doctorName, - "EditOn": editOn, - "Gender": gender, - "IsFollowUP": isFollowUp, - "IsFromVida": isFromVida, - "IsLoginB": isLoginB, - "IsOutKSA": isOutKsa, - "IsRejected": isRejected, - "Language": language, - "Latitude": latitude, - "Longitude": longitude, - "MobileNumber": mobileNumber, - "OpenSession": openSession, - "OpenTokenID": openTokenId, - "PatientID": patientId, - "PatientName": patientName, - "PatientStatus": patientStatus, - "PreferredLanguage": preferredLanguage, - "ProjectID": projectId, - "Scoring": scoring, - "ServiceID": serviceId, - "TokenID": tokenId, - "VC_ID": vcId, - "VoipToken": voipToken, - }; -} -// To parse this JSON data, do -// -// final listPendingPatientListModel = listPendingPatientListModelFromJson(jsonString); diff --git a/lib/root_page.dart b/lib/root_page.dart index 35a3fa44..005fbb1b 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -22,7 +22,9 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNVERIFIED: - return VerificationMethodsScreen(password: null,); + return VerificationMethodsScreen( + password: null, + ); break; case APP_STATUS.UNAUTHENTICATED: return LoginScreen(); diff --git a/lib/routes.dart b/lib/routes.dart index 4ce73a4e..917b1c6c 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,12 +1,13 @@ import 'package:doctor_app_flutter/root_page.dart'; +import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; import 'package:doctor_app_flutter/screens/patient-sick-leave/patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/admission-orders/admission_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/diabetic_chart.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diagnosis/diagnosis_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/admission-orders/admission_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/discharge_summary/discharge_summary.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; @@ -17,23 +18,24 @@ import 'package:doctor_app_flutter/screens/patients/profile/notes/note/progress_ import 'package:doctor_app_flutter/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; import 'package:doctor_app_flutter/screens/patients/profile/pending_orders/pending_orders_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart'; +import 'package:doctor_app_flutter/screens/prescription/new_prescriptions_page.dart'; +import 'package:doctor_app_flutter/screens/prescription/old_prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; -import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import './screens/auth/login_screen.dart'; -import 'screens/patients/profile/UCAF/ucaf_pager_screen.dart'; -import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; +import 'screens/patients/profile/UCAF/ucaf_pager_screen.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; - +import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; @@ -69,6 +71,7 @@ const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail'; const String PATIENT_ECG = 'patients/ecg'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; +const String ORDER_PRESCRIPTION_OLD = 'prescription/prescription_old'; const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PROCEDURE = 'procedure/procedure'; const String ADD_SICKLEAVE = 'add-sickleave'; @@ -81,7 +84,11 @@ const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; +const String VTE_ASSESSMENT = 'vte_assessment '; const String DISCHARGE_SUMMARY = 'discharge_summary'; +const String PHARMACY_INTERVENTION = 'new_medication'; +const String INTERVENTION_MEDICATION = 'intervention_medication'; + //todo: change the routing way. var routes = { @@ -118,7 +125,8 @@ var routes = { ), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(), - ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), + ORDER_PRESCRIPTION_OLD: (_) => OldPrescriptionsPage(), + ORDER_PRESCRIPTION_NEW: (_) => NewPrescriptionsPage(), ORDER_PROCEDURE: (_) => ProcedureScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(), @@ -128,8 +136,10 @@ var routes = { GET_OPERATION_REPORT: (_) => OperationReportScreen(), PENDING_ORDERS: (_) => PendingOrdersScreen(), NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), - DISCHARGE_SUMMARY : (_) => DischargeSummaryPage(), + DISCHARGE_SUMMARY: (_) => DischargeSummaryPage(), DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), DIABETIC_CHART_VALUES: (_) => DiabeticChart(), + PHARMACY_INTERVENTION: (_) => PharmacyInterventionScreen(), + VTE_ASSESSMENT: (_) => VteAssessmentScreen(), }; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 78c68256..1b0a5972 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -3,14 +3,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -258,6 +255,7 @@ class _LoginScreenState extends State { } String memberID = ""; + getProjects(memberID) async { if (memberID != null && memberID != '') { if (this.memberID != memberID) { diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index e1f2f49b..c4f9a6ce 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -13,7 +13,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -468,12 +467,12 @@ class _VerificationMethodsScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ - SecondaryButton( - label: + AppButton( + title: TranslationBase.of(context).useAnotherAccount ?? '', color: Color(0xFFD02127), //fontWeight: FontWeight.w700, - onTap: () { + onPressed: () { authenticationViewModel.deleteUser(); authenticationViewModel .setAppStatus(APP_STATUS.UNAUTHENTICATED); diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 5166d2b1..dff9136b 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -1,11 +1,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; @@ -21,8 +20,8 @@ class AllDoctorQuestions extends StatefulWidget { } class _AllDoctorQuestionsState extends State { - int pageIndex = 1; + @override Widget build(BuildContext context) { return BaseView( @@ -34,61 +33,69 @@ class _AllDoctorQuestionsState extends State { appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ? ErrorMessage( + error: TranslationBase.of(context) + .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( - children: [ - Expanded( - child: Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: NotificationListener( - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: model.listDoctorWorkingHoursTable.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.listDoctorWorkingHoursTable.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: model + .listDoctorWorkingHoursTable[ + index], + previousModel: model, + ), + settings: RouteSettings( + name: 'DoctorReplayChat'), + )); + }, + child: DoctorReplyWidget( + reply: model.listDoctorWorkingHoursTable[ - index], - previousModel: model, - ), - settings: RouteSettings( - name: 'DoctorReplayChat'), - )); - }, - child: DoctorReplyWidget( - reply: model - .listDoctorWorkingHoursTable[index]), - ), - if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) - DrAppCircularProgressIndeicator() - - ], - ); - }), - onNotification: (t) { - if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 && - model.state != ViewState.BusyLocal) { - setState(() { - pageIndex++; - }); - model.getDoctorReply(pageIndex: pageIndex); - } - return; - }, - ), + index]), + ), + if (model.state == ViewState.BusyLocal && + index == + model.listDoctorWorkingHoursTable + .length - + 1) + DrAppCircularProgressIndeicator() + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && + t.metrics.pixels >= + t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex); + } + return; + }, + ), + ), + ), + ], ), - ), - ], - ), ), ); } diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index cda899f1..8ee81b95 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -20,13 +20,15 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatefulWidget { - final ListGtMyPatientsQuestions reply; - final DoctorReplayViewModel previousModel; + final DoctorReplayViewModel previousModel; bool showMsgBox = false; - DoctorReplayChat( - {Key key, this.reply, this.previousModel, - }); + + DoctorReplayChat({ + Key key, + this.reply, + this.previousModel, + }); @override _DoctorReplayChatState createState() => _DoctorReplayChatState(); @@ -35,19 +37,15 @@ class DoctorReplayChat extends StatefulWidget { class _DoctorReplayChatState extends State { TextEditingController msgController = TextEditingController(); - @override Widget build(BuildContext context) { - if(widget.reply.doctorResponse.isNotEmpty){ + if (widget.reply.doctorResponse.isNotEmpty) { msgController.text = widget.reply.doctorResponse; - } else { widget.showMsgBox = true; - } return BaseView( - onModelReady: (model) async { - }, + onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -68,8 +66,7 @@ class _DoctorReplayChatState extends State { ), height: 115, child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(top: 40), child: Column( children: [ @@ -90,7 +87,8 @@ class _DoctorReplayChatState extends State { .toString(), style: TextStyle( color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, + fontWeight: + FontWeight.bold, fontFamily: 'Poppins', fontSize: 20)), ], @@ -117,11 +115,13 @@ class _DoctorReplayChatState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - - SizedBox(height: 30,), + SizedBox( + height: 30, + ), Container( // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * + 0.8, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color(0xFF2B353E), @@ -129,23 +129,31 @@ class _DoctorReplayChatState extends State { Radius.circular(10.0), ), border: Border.all( - color: HexColor('#707070') , + color: HexColor('#707070'), width: 0.30), ), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, children: [ Container( - margin: EdgeInsets.only(top: 5), + margin: + EdgeInsets.only(top: 5), width: 50, height: 50, child: Image.asset( @@ -156,24 +164,37 @@ class _DoctorReplayChatState extends State { ), ), Divider(), - SizedBox(width: 10,), + SizedBox( + width: 10, + ), Container( - width: MediaQuery.of(context).size.width * 0.31, + width: + MediaQuery.of(context) + .size + .width * + 0.31, child: AppText( widget.reply.patientName .toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, fontFamily: 'Poppins', color: Colors.white, - fontWeight: FontWeight.bold, + fontWeight: + FontWeight.bold, // fontSize: 18 ), ), Container( - margin: EdgeInsets.symmetric(horizontal: 0), + margin: + EdgeInsets.symmetric( + horizontal: 0), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" + + widget.reply + .mobileNumber); }, child: Icon( Icons.phone, @@ -184,19 +205,37 @@ class _DoctorReplayChatState extends State { ], ), Column( - crossAxisAlignment: CrossAxisAlignment.end, - + crossAxisAlignment: + CrossAxisAlignment.end, children: [ AppText( - widget.reply.createdOn !=null?getFormattedDate(widget.reply.createdOn):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w500, + widget.reply.createdOn != + null + ? getFormattedDate( + widget.reply + .createdOn) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w500, color: Colors.white, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, ), AppText( - widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, + widget.reply.createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat( + widget.reply + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, fontFamily: 'Poppins', color: Colors.white, // fontSize: 18 @@ -209,15 +248,23 @@ class _DoctorReplayChatState extends State { height: 10, ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Column( children: [ Padding( - padding: const EdgeInsets.all(8.0), + padding: + const EdgeInsets.all( + 8.0), child: Container( - width: MediaQuery.of(context).size.width * 0.7, + width: + MediaQuery.of(context) + .size + .width * + 0.7, child: AppText( widget.reply.remarks, fontSize: 15, @@ -234,115 +281,185 @@ class _DoctorReplayChatState extends State { ], ), ), - SizedBox(height: 30,), - - SizedBox(height: 30,), - if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) - Align( - alignment: Alignment.centerRight, - child: Container( - // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.8, - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + SizedBox( + height: 30, + ), + SizedBox( + height: 30, + ), + if (widget.reply.doctorResponse != null && + widget.reply.doctorResponse.isNotEmpty) + Align( + alignment: Alignment.centerRight, + child: Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context) + .size + .width * + 0.8, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), ), - border: Border.all( - color: HexColor('#707070') , - width: 0.30), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - width: 50, - height: 50, - child: Image.asset( - widget.previousModel.doctorProfile.gender == 0 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.end, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + margin: EdgeInsets.only( + top: 5), + width: 50, + height: 50, + child: Image.asset( + widget + .previousModel + .doctorProfile + .gender == + 0 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), ), - ), - Divider(), - SizedBox(width: 10,), - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: AppText( - widget.previousModel.doctorProfile.doctorName, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - fontFamily: 'Poppins', - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - // fontSize: 18 + Divider(), + SizedBox( + width: 10, ), - ), - - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - widget.reply.responseDate !=null?getFormattedDate(widget.reply.responseDate):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight - .w500, - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, - ), - AppText( - widget.reply.responseDate !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.responseDate)):AppDateUtils.getHour(DateTime.now()), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, - fontFamily: 'Poppins', - color: Color(0xFF2B353E), - // fontSize: 18 - ), - ], - ), - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.7, + Container( + width: MediaQuery.of( + context) + .size + .width * + 0.35, child: AppText( - widget.reply.doctorResponse, - fontSize: 15, + widget + .previousModel + .doctorProfile + .doctorName, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, fontFamily: 'Poppins', - color: Color(0xFF2B353E), + color: + Color(0xFF2B353E), + fontWeight: + FontWeight.bold, // fontSize: 18 ), ), - ), - ], - ), - ], - ), - ], + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + widget.reply.responseDate != + null + ? getFormattedDate( + widget.reply + .responseDate) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime + .now()), + fontWeight: + FontWeight.w500, + color: + Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + ), + AppText( + widget.reply.responseDate != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(widget + .reply + .responseDate)) + : AppDateUtils + .getHour( + DateTime + .now()), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + fontFamily: 'Poppins', + color: + Color(0xFF2B353E), + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: + const EdgeInsets + .all(8.0), + child: Container( + width: MediaQuery.of( + context) + .size + .width * + 0.7, + child: AppText( + widget.reply + .doctorResponse, + fontSize: 15, + fontFamily: + 'Poppins', + color: Color( + 0xFF2B353E), + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), ), ), - ), ], ), ), @@ -351,119 +468,122 @@ class _DoctorReplayChatState extends State { ], ), ), - - - Positioned( - bottom: !widget.showMsgBox?80:0, - left: !widget.showMsgBox?20:0, - child: !widget.showMsgBox? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText("You already replied to this question."), - SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SizedBox(width: 20,), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: AppGlobal.appGreenColor, - title: "Update Your Answer", //TranslationBase.of(context).close, - onPressed: () { - setState(() { - widget.showMsgBox = true; - }); - }, - ), + bottom: !widget.showMsgBox ? 80 : 0, + left: !widget.showMsgBox ? 20 : 0, + child: !widget.showMsgBox + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "You already replied to this question."), + SizedBox( + height: 10, ), - ), - ], - ) - ], - ):Container( - width:MediaQuery.of(context).size.width * 1, - height: MediaQuery.of(context).size.height * 0.12, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - FractionallySizedBox( - child: Container( - - child: TextFields( - borderRadius: 0, - hintText: TranslationBase - .of(context) - .typeHereToReply, - fontSize: 13.5, - - suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: AppGlobal.appGreenColor, - onSuffixTap: ()async { - - if(msgController.text.isEmpty){ - Helpers.showErrorToast("Please Add Doctor Reply"); - return; - } else { - GifLoaderDialogUtils.showMyDialog(context); - await widget.previousModel.createDoctorResponse(msgController.text, widget.reply); - if(widget.previousModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.previousModel.error); - } else { - DrAppToastMsg.showSuccesToast("Thank you for your replay "); - await widget.previousModel.getDoctorReply(isLocalBusy: false); - Navigator.pop(context); - } - GifLoaderDialogUtils.hideDialog(context); - } - }, - // hintColor: Colors.black, - fontWeight: FontWeight.w500, - maxLines: 50, - minLines: 3, - controller: msgController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox( + width: 20, + ), + Container( + width: MediaQuery.of(context).size.width * + 0.8, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: AppGlobal.appGreenColor, + title: "Update Your Answer", + //TranslationBase.of(context).close, + onPressed: () { + setState(() { + widget.showMsgBox = true; + }); + }, + ), + ), + ), + ], + ) + ], + ) + : Container( + width: MediaQuery.of(context).size.width * 1, + height: MediaQuery.of(context).size.height * 0.12, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + child: Container( + child: TextFields( + borderRadius: 0, + hintText: TranslationBase.of(context) + .typeHereToReply, + fontSize: 13.5, + suffixIcon: + FontAwesomeIcons.arrowRight, + suffixIconColor: + AppGlobal.appGreenColor, + onSuffixTap: () async { + if (msgController.text.isEmpty) { + Helpers.showErrorToast( + "Please Add Doctor Reply"); + return; + } else { + GifLoaderDialogUtils.showMyDialog( + context); + await widget.previousModel + .createDoctorResponse( + msgController.text, + widget.reply); + if (widget.previousModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.previousModel.error); + } else { + DrAppToastMsg.showSuccesToast( + "Thank you for your replay "); + await widget.previousModel + .getDoctorReply( + isLocalBusy: false); + Navigator.pop(context); + } + GifLoaderDialogUtils.hideDialog( + context); + } + }, + // hintColor: Colors.black, + fontWeight: FontWeight.w500, + maxLines: 50, + minLines: 3, + controller: msgController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + ), + ], ), ), - ], - ), - ), ) ], - - ), ), )); } - - getFormattedDate(date){ - return (AppDateUtils.getDateTimeFromServerFormat( - date) - .day - .toString() + + getFormattedDate(date) { + return (AppDateUtils.getDateTimeFromServerFormat(date).day.toString() + " " + AppDateUtils.getMonth( - AppDateUtils.getDateTimeFromServerFormat( - date) - .month) + AppDateUtils.getDateTimeFromServerFormat(date).month) .toString() .substring(0, 3) + ' ' + - AppDateUtils.getDateTimeFromServerFormat( - date) - .year - .toString()); + AppDateUtils.getDateTimeFromServerFormat(date).year.toString()); } } diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 7957d4bd..685c4903 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -1,22 +1,11 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_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/doctor/doctor_replay/doctor_repaly_chat.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - +import 'package:doctor_app_flutter/util/tab_helper.dart'; import 'all_doctor_questions.dart'; import 'not_replaied_Doctor_Questions.dart'; @@ -83,8 +72,7 @@ class _DoctorReplyScreenState extends State preferredSize: Size.fromHeight( MediaQuery.of(context).size.height * 0.070), child: Container( - color: Helpers.getBgTabColor(), - + color: TabHelper.getBgTabColor(), child: TabBar( isScrollable: false, controller: _tabController, @@ -92,25 +80,21 @@ class _DoctorReplyScreenState extends State indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), + labelPadding: + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget( - screenSize, - _activeTab == 0, - /// TODO Elham* Add Tran - "Not Replied", - isFirst: true, context: context - ), - tabWidget( - screenSize, - _activeTab == 1, + screenSize, + _activeTab == 0, - TranslationBase.of(context).all, - isLast: true, - context: context - ), + /// TODO Elham* Add Tran + "Not Replied", + isFirst: true, + context: context), + tabWidget(screenSize, _activeTab == 1, + TranslationBase.of(context).all, + isLast: true, context: context), ], ), ), @@ -138,25 +122,33 @@ class _DoctorReplyScreenState extends State } } -Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1, bool isFirst = false, - bool isMiddle = false, - bool isLast = false,context, }) { - ProjectViewModel projectViewModel= Provider.of(context); +Widget tabWidget( + Size screenSize, + bool isActive, + String title, { + int counter = -1, + bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + context, +}) { + ProjectViewModel projectViewModel = Provider.of(context); return Center( child: Container( - height: Helpers.getTabHeight(context), - decoration: Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast, projectViewModel: projectViewModel), + height: TabHelper.getTabHeight(context), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: isActive, + isFirst: isFirst, + isMiddle: isMiddle, + isLast: isLast, + projectViewModel: projectViewModel), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText(title: title, isActive: isActive), + TabHelper.getTabText(title: title, isActive: isActive), if (counter != -1) - Helpers.getTabCounter( - isActive: isActive, - counter:counter - ) + TabHelper.getTabCounter(isActive: isActive, counter: counter) ], ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index ecd0f93d..8c8324d8 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.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/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -34,7 +34,7 @@ class _DoctorReplyWidgetState extends State { bgColor: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR + ? AppGlobal.inProgressColor : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : AppGlobal.appGreenColor, @@ -44,86 +44,90 @@ class _DoctorReplyWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(widget.reply.infoStatus != 0) - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: widget.reply.infoStatus == 99 - ? TranslationBase.of(context).notReplied:widget.reply.infoStatus == 1 - ? TranslationBase.of(context).replayCallStatus - : widget.reply.infoStatus == 2 - ? TranslationBase.of(context).patientArrived - : widget.reply.infoStatus == 3 - ? TranslationBase.of(context) - .calledAndNoResponse - : widget.reply.infoStatus == 4 - ? TranslationBase.of(context) - .underProcess - : widget.reply.infoStatus == 6 - ? TranslationBase.of(context) - .textResponse - : '', - style: TextStyle( - color: widget.reply.infoStatus == 99 - ? Color(0xFF2B353E) - : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR - : widget.reply.infoStatus == 3 - ? Color(0xFFD02127) - : AppGlobal.appGreenColor, - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 1.8 * SizeConfig.textMultiplier)), + if (widget.reply.infoStatus != 0) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.infoStatus == 99 + ? TranslationBase.of(context).notReplied + : widget.reply.infoStatus == 1 + ? TranslationBase.of(context) + .replayCallStatus + : widget.reply.infoStatus == 2 + ? TranslationBase.of(context) + .patientArrived + : widget.reply.infoStatus == 3 + ? TranslationBase.of(context) + .calledAndNoResponse + : widget.reply.infoStatus == 4 + ? TranslationBase.of(context) + .underProcess + : widget.reply.infoStatus == 6 + ? TranslationBase.of( + context) + .textResponse + : '', + style: TextStyle( + color: widget.reply.infoStatus == 99 + ? Color(0xFF2B353E) + : widget.reply.infoStatus == 4 + ? AppGlobal.inProgressColor + : widget.reply.infoStatus == 3 + ? Color(0xFFD02127) + : AppGlobal.appGreenColor, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 1.8 * SizeConfig.textMultiplier)), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + AppDateUtils.getMonth( + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + AppText( + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .hour + .toString() + + ":" + + AppDateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .minute + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) ], ), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .day - .toString() + - " " + - AppDateUtils.getMonth( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .month) - .toString() - .substring(0, 3) + - ' ' + - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .year - .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .hour - .toString() + - ":" + - AppDateUtils.getDateTimeFromServerFormat( - widget.reply.createdOn) - .minute - .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) - ], - ), - ], - ), + ], + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -202,11 +206,12 @@ class _DoctorReplyWidgetState extends State { CustomRow( label: TranslationBase.of(context).fileNumber, value: widget.reply.patientID.toString(), - isCopyable:false, + isCopyable: false, + isExpanded: false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", - isCopyable:false, + label: TranslationBase.of(context).age + " : ", isCopyable: false, + isExpanded: false, value: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", ), diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 5b21809f..f3874dea 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -89,7 +89,8 @@ class _NotRepliedDoctorQuestionsState extends State { setState(() { pageIndex++; }); - model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); + model.getDoctorReply( + pageIndex: pageIndex, isGettingNotReply: true); } return; }, diff --git a/lib/screens/doctor/my_schedule_screen.dart b/lib/screens/doctor/my_schedule_screen.dart index b94b3823..de61ec98 100644 --- a/lib/screens/doctor/my_schedule_screen.dart +++ b/lib/screens/doctor/my_schedule_screen.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; - +import 'package:hexcolor/hexcolor.dart'; class MyScheduleScreen extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( @@ -18,38 +18,27 @@ class MyScheduleScreen extends StatelessWidget { isShowAppBar: false, body: model.listDoctorWorkingHoursTable.length == 0 ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), + child:ErrorMessage(error: TranslationBase.of(context).errorNoSchedule,), ) : Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + color: HexColor("#EFEFEF"), + padding: EdgeInsetsDirectional.fromSTEB(0, 0, 21, 0), child: ListView( children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - - scheduleListByDate(model), - // scheduleListByDate('Wednesday, 8 April '), - ], - ), - ], + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + scheduleListByDate(model), + // scheduleListByDate('Wednesday, 8 April '), + ], + ), + ], + ), ), - ], - ), - ), )); } - Column scheduleListByDate(ScheduleViewModel model ) { + Column scheduleListByDate(ScheduleViewModel model) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -59,12 +48,13 @@ class MyScheduleScreen extends StatelessWidget { Container( child: Column( children: model.listDoctorWorkingHoursTable.map((item) { - return MyScheduleWidget(workingHoursTable: item,); + return MyScheduleWidget( + workingHoursTable: item, + ); }).toList(), ), ), ], ); } - } diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 5ef8b617..11ee6f29 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -37,6 +37,7 @@ class _PatientArrivalScreen extends State SessionID: "5G0yXn0Jnq", IsLoginForDoctorApp: true, PatientOutSA: false); + @override void initState() { super.initState(); @@ -63,7 +64,8 @@ class _PatientArrivalScreen extends State child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, + width: MediaQuery.of(context).size.width * 0.92, + // 0.9, decoration: BoxDecoration( border: Border( bottom: BorderSide( diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 0bae430a..33bacd50 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -2,12 +2,11 @@ import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'label.dart'; @@ -17,20 +16,21 @@ class DashboardReferralPatient extends StatelessWidget { final double height; final DashboardViewModel model; - const DashboardReferralPatient({Key key, this.dashboardItemList, this.height, this.model}) : super(key: key); + const DashboardReferralPatient( + {Key key, this.dashboardItemList, this.height, this.model}) + : super(key: key); + @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20), bottomLeft: Radius.circular(20), - bottomRight: Radius.circular(20) - ), + bottomRight: Radius.circular(20)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.5), @@ -40,120 +40,159 @@ class DashboardReferralPatient extends StatelessWidget { ), ], ), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(8), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort? - 3 - : SizeConfig.isHeightShort? - 2 - : 2)), - Label( - firstLine: TranslationBase.of(context).patients, - secondLine: TranslationBase.of(context).referral, - color: Color(0xFF2B353E), - secondLineFontSize: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort? - 5 - : SizeConfig.isHeightShort? - 7 - : 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(8), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 3 + : SizeConfig.isHeightShort + ? 2 + : 2)), + Label( + firstLine: + TranslationBase.of(context).patients, + secondLine: + TranslationBase.of(context).referral, + color: Color(0xFF2B353E), + secondLineFontSize: + SizeConfig.getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 7 + : 12), + ), + SizedBox( + height: SizeConfig.getHeightMultiplier( + height: height) * + (SizeConfig.isHeightVeryShort + ? 5 + : SizeConfig.isHeightShort + ? 10 + : 5)) + ], ), - SizedBox( - height: SizeConfig.getHeightMultiplier(height: height) * - (SizeConfig.isHeightVeryShort? - 5 - : SizeConfig.isHeightShort? - 10 - : 5)) - ], - ), - ), - Expanded( - flex: 1, + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RowCounts( + dashboardItemList[2] + .summaryoptions[0] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[0] + .value, + AppGlobal.appTextColor, + height: height, + ), + RowCounts( + dashboardItemList[2] + .summaryoptions[1] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[1] + .value, + Color(0xFFC8D0DC), + height: height, + ), + RowCounts( + dashboardItemList[2] + .summaryoptions[2] + .kPIParameter, + dashboardItemList[2] + .summaryoptions[2] + .value, + Color(0xFFEC6666), + height: height, + ), + ], + ), + ) + ], + )), + ), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + padding: EdgeInsets.all(0), + child: GaugeChart( + _createReferralData(dashboardItemList))), + Positioned( child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - RowCounts( - dashboardItemList[2].summaryoptions[0].kPIParameter, - dashboardItemList[2].summaryoptions[0].value, - AppGlobal.appTextColor, - height: height, - ), - RowCounts( - dashboardItemList[2].summaryoptions[1].kPIParameter, - dashboardItemList[2].summaryoptions[1].value, - Color(0xFFC8D0DC), - height: height, - ), - RowCounts( - dashboardItemList[2].summaryoptions[2].kPIParameter, - dashboardItemList[2].summaryoptions[2].value, - Color(0xFFEC6666), - - height: height, - ), + AppText( + model + .getPatientCount(dashboardItemList[2]) + .toString(), + fontSize: SizeConfig.textMultiplier * 3.2, + color: AppGlobal.appTextColor, + fontWeight: FontWeight.bold, + ) ], ), - ) - ], - )), - ), - Expanded( - flex: 3, - child: Stack(children: [ - Container(padding: EdgeInsets.all(0), child: GaugeChart(_createReferralData(dashboardItemList))), - Positioned( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - model.getPatientCount(dashboardItemList[2]).toString(), - fontSize: SizeConfig.textMultiplier * 3.2, - color: AppGlobal.appTextColor, - fontWeight: FontWeight.bold, - ) - ], - ), - top: height * (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), - left: 0, - right: 0) - ]), - ), - ], - )), - ]), + top: height * + (SizeConfig.isHeightVeryShort ? 0.35 : 0.35), + left: 0, + right: 0) + ]), + ), + ], + )), + ]), ); } - static List> _createReferralData(List dashboardItemList) { + static List> _createReferralData( + List dashboardItemList) { final data = [ - new GaugeSegment(dashboardItemList[2].summaryoptions[0].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[0].value), charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), - new GaugeSegment(dashboardItemList[2].summaryoptions[1].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[1].value), charts.ColorUtil.fromDartColor(Color(0xFFC6CEDA),),), - new GaugeSegment(dashboardItemList[2].summaryoptions[2].kPIParameter, - getValue(dashboardItemList[1].summaryoptions[2].value), charts.ColorUtil.fromDartColor(Color(0xFFEC6666),),), + new GaugeSegment( + dashboardItemList[2].summaryoptions[0].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[0].value), + charts.ColorUtil.fromDartColor(AppGlobal.appTextColor)), + new GaugeSegment( + dashboardItemList[2].summaryoptions[1].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[1].value), + charts.ColorUtil.fromDartColor( + Color(0xFFC6CEDA), + ), + ), + new GaugeSegment( + dashboardItemList[2].summaryoptions[2].kPIParameter, + getValue(dashboardItemList[1].summaryoptions[2].value), + charts.ColorUtil.fromDartColor( + Color(0xFFEC6666), + ), + ), ]; return [ @@ -161,8 +200,7 @@ class DashboardReferralPatient extends StatelessWidget { id: 'Segments', domainFn: (GaugeSegment segment, _) => segment.segment, measureFn: (GaugeSegment segment, _) => segment.size, - strokeWidthPxFn: (GaugeSegment segment, _)=>200, - + strokeWidthPxFn: (GaugeSegment segment, _) => 200, data: data, colorFn: (GaugeSegment segment, _) => segment.color, ) diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index 9005b816..9ee8d9d3 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -14,14 +14,14 @@ class DashboardSliderItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( + return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1), - + margin: EdgeInsets.symmetric( + horizontal: SizeConfig.widthMultiplier * 1), child: Label( firstLine: Helpers.getLabelFromKPI(item.kPIName), secondLine: Helpers.getNameFromKPI(item.kPIName), @@ -34,17 +34,17 @@ class DashboardSliderItemWidget extends StatelessWidget { (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightShort - ? 14 - : SizeConfig.isHeightLarge - ? 15 - : 13), + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, - children: List.generate(item.summaryoptions.length, (int index) { + children: + List.generate(item.summaryoptions.length, (int index) { return GetActivityCard(item.summaryoptions[index]); }))) ], ); - } } diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index bcd7864c..9f4d45c9 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; @@ -30,8 +30,12 @@ class _DashboardSwipeWidgetState extends State { @override Widget build(BuildContext context) { - double height = SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 40 : SizeConfig.isHeightLarge?33:31); + double height = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 40 + : SizeConfig.isHeightLarge + ? 33 + : 31); return Container( height: height, @@ -89,13 +93,16 @@ class _DashboardSwipeWidgetState extends State { ); } - Widget getSwipeWidget(List dashboardItemList, int index,double height ) { - if (index == 1) - return GetOutPatientStack(dashboardItemList[1]); - if (index == 0) - return GetOutPatientStack(dashboardItemList[0]); + Widget getSwipeWidget( + List dashboardItemList, int index, double height) { + if (index == 1) return GetOutPatientStack(dashboardItemList[1]); + if (index == 0) return GetOutPatientStack(dashboardItemList[0]); if (index == 2) - return DashboardReferralPatient(dashboardItemList: widget.dashboardItemList,height: height,model: widget.model,); + return DashboardReferralPatient( + dashboardItemList: widget.dashboardItemList, + height: height, + model: widget.model, + ); return Container(); } diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 39a99e65..2fa182c2 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -1,17 +1,17 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class HomePageCard extends StatelessWidget { const HomePageCard( {this.hasBorder = false, - this.imageName, - this.child, - this.onTap, - Key key, - this.color, - this.opacity = 0.4, - this.margin, this.width, this.gradient}) + this.imageName, + this.child, + this.onTap, + Key key, + this.color, + this.opacity = 0.4, + this.margin, + this.width, + this.gradient}) : super(key: key); final bool hasBorder; final String imageName; @@ -38,10 +38,11 @@ class HomePageCard extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/$imageName'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn), - ) + image: AssetImage('assets/images/dashboard/$imageName'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) : null, ), child: child, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 0180fc14..f44ace60 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -15,25 +15,30 @@ class HomePatientCard extends StatelessWidget { final LinearGradient gradient; HomePatientCard({ - this.backgroundColor, - this.backgroundIconColor, - this.cardIcon, + this.backgroundColor, + this.backgroundIconColor, + this.cardIcon, this.cardIconImage, - this.text, - this.textColor, - this.onTap, - this.iconSize = 30, this.gradient, + this.text, + this.textColor, + this.onTap, + this.iconSize = 30, + this.gradient, }); @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* - (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); + double width = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightLarge + ? 15 + : 13); return HomePageCard( color: backgroundColor, width: width, gradient: gradient, - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 1.121), child: Container( padding: EdgeInsets.all(8), child: Column( @@ -48,21 +53,21 @@ class HomePatientCard extends StatelessWidget { color: Colors.transparent, child: cardIcon != null ? Icon( - cardIcon, - size: iconSize * 2, - color: backgroundIconColor, - ) + cardIcon, + size: iconSize * 2, + color: backgroundIconColor, + ) : IconButton( - icon: Image.asset( - 'assets/images/patient_register.png', - width: iconSize * 2, - height: iconSize * 2, - fit: BoxFit.fill, - ), - iconSize: iconSize * 2, - color: backgroundIconColor, - onPressed: () => null, - ), + icon: Image.asset( + 'assets/images/patient_register.png', + width: iconSize * 2, + height: iconSize * 2, + fit: BoxFit.fill, + ), + iconSize: iconSize * 2, + color: backgroundIconColor, + onPressed: () => null, + ), ), Container( child: Column( @@ -71,16 +76,17 @@ class HomePatientCard extends StatelessWidget { children: [ cardIcon != null ? Icon( - cardIcon, - size: - SizeConfig.getWidthMultiplier(width: width) * 30, - color: textColor, - ) + cardIcon, + size: SizeConfig.getWidthMultiplier( + width: width) * + 30, + color: textColor, + ) : Image.asset( - cardIconImage, - height: iconSize, - width: iconSize, - ), + cardIconImage, + height: iconSize, + width: iconSize, + ), SizedBox( height: 4, ), @@ -99,8 +105,8 @@ class HomePatientCard extends StatelessWidget { letterSpacing: -0.33, fontWeight: FontWeight.w600, fontSize: - SizeConfig.getTextMultiplierBasedOnWidth(width: width) * - (SizeConfig.isHeightVeryShort ? 11 : 10), + SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + (SizeConfig.isHeightVeryShort ? 11 : 10), ), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index a0b03656..0d8d4150 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -6,8 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart import 'package:doctor_app_flutter/core/viewModel/dashboard_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/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; @@ -35,7 +34,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; -import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; import 'label.dart'; @@ -88,7 +86,9 @@ class _HomeScreenState extends State { //TODO Elham* make it componet Container( width: 40, - margin: EdgeInsets.only(left: projectsProvider.isArabic? 0:32, right: projectsProvider.isArabic? 23:0), + margin: EdgeInsets.only( + left: projectsProvider.isArabic ? 0 : 32, + right: projectsProvider.isArabic ? 23 : 0), child: IconButton( icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 25, width: 10), @@ -111,7 +111,8 @@ class _HomeScreenState extends State { DropdownButtonHideUnderline( child: DropdownButton( dropdownColor: Colors.white, - iconEnabledColor: AppGlobal.appTextColor, + iconEnabledColor: + AppGlobal.appTextColor, icon: Icon(Icons.keyboard_arrow_down), isExpanded: true, value: clinicId == null @@ -142,8 +143,8 @@ class _HomeScreenState extends State { EdgeInsets.all(2), decoration: new BoxDecoration( - color: - AppGlobal.appRedColor, + color: AppGlobal + .appRedColor, borderRadius: BorderRadius .circular( @@ -162,8 +163,11 @@ class _HomeScreenState extends State { .toString(), color: Colors.white, - letterSpacing: -0.72, - fontWeight: FontWeight.w600, + letterSpacing: + -0.72, + fontWeight: + FontWeight + .w600, fontSize: projectsProvider .isArabic @@ -176,10 +180,14 @@ class _HomeScreenState extends State { )), ], ), - AppText(Helpers.convertToTitleCase(item.clinicName), + AppText( + Helpers + .convertToTitleCase( + item.clinicName), fontSize: 14, letterSpacing: -0.96, - color: AppGlobal.appTextColor, + color: AppGlobal + .appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end), @@ -206,12 +214,12 @@ class _HomeScreenState extends State { .map((item) { return DropdownMenuItem( child: AppText( - Helpers.convertToTitleCase(item.clinicName), + Helpers.convertToTitleCase( + item.clinicName), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, - fontWeight: - FontWeight.bold, + fontWeight: FontWeight.bold, textAlign: TextAlign.left, ), value: item.clinicID, @@ -292,21 +300,19 @@ class _HomeScreenState extends State { SizedBox( height: 10, ), - Label( firstLine: TranslationBase.of(context).patients, secondLine: TranslationBase.of(context).services, ), - Container( height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightShort - ? 14 - : SizeConfig.isHeightLarge - ? 15 - : 13), + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13), child: ListView( scrollDirection: Axis.horizontal, children: [ @@ -338,20 +344,18 @@ class _HomeScreenState extends State { begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [ - AppGlobal.appRedColor,Color(0xFFAD3B3B), - ]);//AppGlobal.appRedColor; - backgroundColors[1] = LinearGradient( - begin: Alignment.center, - end: Alignment.center, - colors: [ - Color(0xFFC9C9C9),Color(0xFFC9C9C9), - ]); + AppGlobal.appRedColor, + Color(0xFFAD3B3B), + ]); //AppGlobal.appRedColor; + backgroundColors[1] = + LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [ + Color(0xFFC9C9C9), + Color(0xFFC9C9C9), + ]); backgroundColors[2] = LinearGradient( begin: Alignment.center, end: Alignment.center, - colors: [ - Color(0xFF71787E),AppGlobal.appTextColor - ]); + colors: [Color(0xFF71787E), AppGlobal.appTextColor]); List backgroundIconColors = List(3); backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; @@ -420,24 +424,24 @@ class _HomeScreenState extends State { }, )); changeColorIndex(); - - patientCards.add(HomePatientCard( - gradient: backgroundColors[colorIndex], - backgroundIconColor: backgroundIconColors[colorIndex], - //TODO Elham* match the of the icon - cardIcon: DoctorApp.arrival_patients, - textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, - onTap: () { - Navigator.push( - context, - FadePage( - page: RegisterPatientPage(), - ), - ); - }, - )); - changeColorIndex(); + //TODO Keep commented + // patientCards.add(HomePatientCard( + // gradient: backgroundColors[colorIndex], + // backgroundIconColor: backgroundIconColors[colorIndex], + // //TODO Elham* match the of the icon + // cardIcon: DoctorApp.arrival_patients, + // textColor: textColors[colorIndex], + // text: TranslationBase.of(context).registerNewPatient, + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: RegisterPatientPage(), + // ), + // ); + // }, + // )); + // changeColorIndex(); patientCards.add(HomePatientCard( gradient: backgroundColors[colorIndex], diff --git a/lib/screens/home/label.dart b/lib/screens/home/label.dart index 0d316652..89975660 100644 --- a/lib/screens/home/label.dart +++ b/lib/screens/home/label.dart @@ -5,24 +5,30 @@ import 'package:flutter/material.dart'; class Label extends StatelessWidget { Label({ - Key key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, + Key key, + this.firstLine, + this.secondLine, + this.color = const Color(0xFF2E303A), + this.secondLineFontSize, + this.firstLineFontSize, }) : super(key: key); final String firstLine; final String secondLine; Color color; - final double secondLineFontSize; - final double firstLineFontSize; + final double secondLineFontSize; + final double firstLineFontSize; @override Widget build(BuildContext context) { - return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( firstLine, - fontSize: firstLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) , + fontSize: firstLineFontSize ?? + SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 2 : 3), // fontWeight: FontWeight.bold, color: color, fontHeight: .5, @@ -32,12 +38,13 @@ class Label extends StatelessWidget { AppText( secondLine, color: color, - fontSize: secondLineFontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?4:6.40), + fontSize: secondLineFontSize ?? + SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 4 : 6.40), fontWeight: FontWeight.bold, letterSpacing: -1.44, - ), ], ); } -} \ No newline at end of file +} diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 35c00beb..a68eff56 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -3,17 +3,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_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/live_care/live-care_transfer_to_admin.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -25,7 +25,10 @@ import 'package:hexcolor/hexcolor.dart'; class EndCallScreen extends StatefulWidget { final PatiantInformtion patient; - const EndCallScreen({Key key, this.patient,}) : super(key: key); + const EndCallScreen({ + Key key, + this.patient, + }) : super(key: key); @override _EndCallScreenState createState() => _EndCallScreenState(); @@ -42,29 +45,30 @@ class _EndCallScreenState extends State { String to; LiveCarePatientViewModel liveCareModel; + @override void initState() { super.initState(); - if(widget.patient!=null) - patient = widget.patient; + if (widget.patient != null) patient = widget.patient; } @override void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - if(routeArgs.containsKey('patient')) - patient = routeArgs['patient']; + if (routeArgs.containsKey('patient')) patient = routeArgs['patient']; } @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).resume, - TranslationBase.of(context).theCall, '', 'assets/images/svgs/profile_screen/vital signs.svg', + PatientProfileCardModel( + TranslationBase.of(context).resume, + TranslationBase.of(context).theCall, + '', + 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient, - color: AppGlobal.appGreenColor, - onTap: () async { + color: AppGlobal.appGreenColor, onTap: () async { GifLoaderDialogUtils.showMyDialog(context); await liveCareModel .startCall(isReCall: false, vCID: patient.vcId) @@ -79,8 +83,13 @@ class _EndCallScreenState extends State { kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', vcId: patient.vcId, - isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false, - patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), + isRecording: liveCareModel.startCallRes != null + ? liveCareModel.startCallRes.isRecording + : false, + patientName: patient.fullName ?? + (patient.firstName != null + ? "${patient.firstName} ${patient.lastName}" + : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, doctorId: liveCareModel.doctorProfile.doctorID, @@ -124,8 +133,7 @@ class _EndCallScreenState extends State { '', 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient, - color: Colors.red[800], - onTap: () { + color: Colors.red[800], onTap: () { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", () async { @@ -136,14 +144,16 @@ class _EndCallScreenState extends State { if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { - showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { + showAlternativesDialog(context, liveCareModel, + (bool isConfirmed) async { GifLoaderDialogUtils.showMyDialog(context); await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); } else { - DrAppToastMsg.showSuccesToast("You successfully completed call with charge"); + DrAppToastMsg.showSuccesToast( + "You successfully completed call with charge"); Navigator.of(context).pop(); Navigator.of(context).pop(); } @@ -155,22 +165,22 @@ class _EndCallScreenState extends State { TranslationBase.of(context).sendLC, TranslationBase.of(context).instruction, "", - 'assets/images/svgs/profile_screen/health summary.svg', - onTap: () { - Helpers.showConfirmationDialog(context, - "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - await liveCareModel.sendSMSInstruction(patient.vcId); - GifLoaderDialogUtils.hideDialog(context); - if (liveCareModel.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(liveCareModel.error); - } else { - DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions"); - } - }); - }, + 'assets/images/svgs/profile_screen/health summary.svg', onTap: () { + Helpers.showConfirmationDialog(context, + "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC} ${TranslationBase.of(context).instruction} ?", + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.sendSMSInstruction(patient.vcId); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } else { + DrAppToastMsg.showSuccesToast( + "You successfully sent SMS instructions"); + } + }); + }, isInPatient: isInpatient, isDartIcon: true, // isDisable: true, @@ -181,11 +191,13 @@ class _EndCallScreenState extends State { '', 'assets/images/svgs/profile_screen/health summary.svg', onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - LivaCareTransferToAdmin(patient: patient), - settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),); + context, + MaterialPageRoute( + builder: (BuildContext context) => + LivaCareTransferToAdmin(patient: patient), + settings: RouteSettings(name: 'LivaCareTransferToAdmin'), + ), + ); }, isInPatient: isInpatient, isDartIcon: true, @@ -201,12 +213,9 @@ class _EndCallScreenState extends State { appBarTitle: TranslationBase.of(context).patientProfile, backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar( - patient, - onPressed: (){ - Navigator.pop(context); - - }, + appBar: PatientProfileAppBar(patient, onPressed: () { + Navigator.pop(context); + }, isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43) @@ -269,7 +278,7 @@ class _EndCallScreenState extends State { isLoading: cardsList[index].isLoading, isDartIcon: cardsList[index].isDartIcon, dartIcon: cardsList[index].dartIcon, - color: cardsList[index].color, + color: cardsList[index].color, ), ), ], @@ -341,7 +350,7 @@ class _EndCallScreenState extends State { ), actions: [ AppButton( - onPressed: (){ + onPressed: () { Navigator.of(context).pop(); okFunction(true); }, diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index 233f59d8..4cd9a3a0 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -32,7 +32,7 @@ class LivaCareTransferToAdmin extends StatefulWidget { class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -83,7 +83,8 @@ class _LivaCareTransferToAdminState extends State { validationError: noteError, ), Positioned( - top: -2, //MediaQuery.of(context).size.height * 0, + top: -2, + //MediaQuery.of(context).size.height * 0, right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, @@ -117,20 +118,22 @@ class _LivaCareTransferToAdminState extends State { if (noteController.text.isNotEmpty) { Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", - () async { - Navigator.of(context).pop(); - GifLoaderDialogUtils.showMyDialog(context); - await model.transferToAdmin(widget.patient.vcId, noteController.text); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast("You successfully transfer to admin"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + await model.transferToAdmin( + widget.patient.vcId, noteController.text); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast( + "You successfully transfer to admin"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); } }); }, @@ -165,7 +168,7 @@ class _LivaCareTransferToAdminState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -175,14 +178,14 @@ class _LivaCareTransferToAdminState extends State { } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - noteController.text += reconizedWord + '\n'; + noteController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index a434a212..ff14cab2 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -1,26 +1,19 @@ import 'dart:async'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; -import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; -import '../../locator.dart'; import '../../routes.dart'; class LiveCarePatientScreen extends StatefulWidget { @@ -33,6 +26,7 @@ class _LiveCarePatientScreenState extends State { Timer timer; LiveCarePatientViewModel _liveCareViewModel; + @override void initState() { super.initState(); diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index f081479c..bfb55579 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -1,8 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; -import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; +import 'package:doctor_app_flutter/core/model/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -32,6 +31,7 @@ class _LiveCarePandingListState extends State { Helpers helpers = new Helpers(); bool _isInit = true; LiveCareViewModel _liveCareProvider; + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -256,8 +256,10 @@ MyGlobals myGlobals = new MyGlobals(); class MyGlobals { GlobalKey _scaffoldKey; + MyGlobals() { _scaffoldKey = GlobalKey(); } + GlobalKey get scaffoldKey => _scaffoldKey; } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 2d3f1d15..93acd87a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -4,10 +4,9 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; -import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -19,6 +18,7 @@ class VideoCallPage extends StatefulWidget { final PatiantInformtion patientData; final listContext; final LiveCarePatientViewModel model; + VideoCallPage({this.patientData, this.listContext, this.model}); @override @@ -36,10 +36,12 @@ class _VideoCallPageState extends State { var _tokenData; bool isTransfer = false; String image_url = 'https://hmgwebservices.com/Images/MobileImages/DUBAI/'; + //bool _isOutOfStuck = false; Helpers helpers = new Helpers(); var doctorprofile = {}; var notes; + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -67,9 +69,13 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', 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", + 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", doctorId: doctorprofile['DoctorID'], onFailure: (String error) { diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index b1ee901b..2424b09b 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -1,18 +1,20 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import '../../widgets/shared/errors/error_message.dart'; + class HealthSummaryPage extends StatefulWidget { @override _HealthSummaryPageState createState() => _HealthSummaryPageState(); @@ -20,6 +22,7 @@ class HealthSummaryPage extends StatefulWidget { class _HealthSummaryPageState extends State { PatiantInformtion patient; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -29,7 +32,9 @@ class _HealthSummaryPageState extends State { bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), - builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( + builder: + (BuildContext context, MedicalFileViewModel model, Widget child) => + AppScaffold( appBar: PatientProfileAppBar( patient, isInpatient: isInpatient, @@ -43,7 +48,8 @@ class _HealthSummaryPageState extends State { child: Column( children: [ Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), child: Container( child: Padding( padding: const EdgeInsets.all(8.0), @@ -73,18 +79,25 @@ class _HealthSummaryPageState extends State { ), ), ), - (model.medicalFileList != null && model.medicalFileList.length != 0) + (model.medicalFileList != null && + model.medicalFileList.length != 0) ? ListView.builder( //physics: , physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0].timelines.length, + itemCount: model.medicalFileList[0].entityList[0] + .timelines.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( onTap: () async { - if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] - .consulations.length != + if (model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .length != 0) await locator().logEvent( eventCategory: "Health Summary Page", @@ -94,67 +107,99 @@ class _HealthSummaryPageState extends State { context, MaterialPageRoute( builder: (context) => MedicalFileDetails( - age: patient.age is String ? patient.age ?? "" : "${patient.age}", + age: patient.age is String + ? patient.age ?? "" + : "${patient.age}", firstName: patient.firstName, lastName: patient.lastName, gender: patient.genderDescription, encounterNumber: index, pp: patient.patientId, patient: patient, - doctorName: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].doctorName - : "", - clinicName: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].clinicName + doctorName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName : "", - doctorImage: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].doctorImage + clinicName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName : "", - episode: model.medicalFileList[0].entityList[0].timelines[index] - .timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] - .consulations[0].episodeID - .toString() + doctorImage: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorImage : "", + episode: + model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() : "", vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()), - settings: RouteSettings(name: 'MedicalFileDetails'), + settings: RouteSettings( + name: 'MedicalFileDetails'), ), ); }, child: DoctorCard( - doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName, - clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0].timelines[index].projectName, - profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0].timelines[index].date, + doctorName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + clinic: model.medicalFileList[0].entityList[0] + .timelines[index].clinicName, + branch: model.medicalFileList[0].entityList[0] + .timelines[index].projectName, + profileUrl: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorImage, + appointmentDate: + AppDateUtils.getDateTimeFromServerFormat( + model.medicalFileList[0].entityList[0] + .timelines[index].date, ), isPrescriptions: true, - isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] - .consulations.length != + isShowEye: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .length != 0 ? true : false), ); }) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noMedicalFileFound), - ) - ], - ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noMedicalFileFound, + )) ], ), ), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index b53284a9..ee6df167 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,10 +1,10 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; @@ -13,6 +13,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../widgets/shared/errors/error_message.dart'; + class MedicalFileDetails extends StatefulWidget { String age; String firstName; @@ -85,6 +87,7 @@ class _MedicalFileDetailsState extends State { this.clinicName, this.episode, this.doctorImage}); + bool isPhysicalExam = true; bool isProcedureExpand = true; bool isHistoryExpand = true; @@ -103,7 +106,7 @@ class _MedicalFileDetailsState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileAppBar( - patient, + patient, doctorName: doctorName, profileUrl: doctorImage, clinic: clinicName, @@ -628,9 +631,10 @@ class _MedicalFileDetailsState extends State { ": ", ), AppText( - AppDateUtils.getDateFormatted( - DateTime - .parse( + AppDateUtils + .getDateFormatted( + DateTime + .parse( model .medicalFileList[ 0] @@ -928,23 +932,9 @@ class _MedicalFileDetailsState extends State { ), ) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Data For This Visit '), - ), - SizedBox( - height: 100, - ), - ], - ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) ], ), ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 4998e99c..3656c585 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,13 +1,11 @@ import 'dart:math'; - import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; 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/patient_search/patient_search_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -18,10 +16,8 @@ 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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; @@ -45,44 +41,29 @@ class _MedicineSearchState extends State { Helpers helpers = new Helpers(); bool _hasSpeech = false; String _currentLocaleId = ""; - bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); - // String lastWords; - List _localeNames = []; String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + String recognizedWord; @override void didChangeDependencies() { super.didChangeDependencies(); } - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } Future initSpeechState() async { bool hasSpeech = await speech.initialize( onError: errorListener, onStatus: statusListener); - // if (hasSpeech) { - // _localeNames = await speech.locales(); - - // var systemLocale = await speech.systemLocale(); _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; - // } - if (!mounted) return; setState(() { @@ -90,152 +71,136 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - @override Widget build(BuildContext context) { return BaseView(onModelReady: (model) async { - // if (model.allMedicationList.length == 0) - // await model.getMedicationList(); }, builder: (_, model, w) { myController.text = model.searchText; return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBar: PatientSearchHeader( + appBar: BottomSheetTitle( title: TranslationBase.of(context).searchMedicine, ), - //appBarTitle: TranslationBase.of(context).searchMedicine + "6", body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Container( - // height: SizeConfig.screenHeight, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - FractionallySizedBox( - widthFactor: 0.9, - child: AppTextFieldCustomSearch( - hintText: - TranslationBase.of(context).searchMedicineNameHere, - searchController: myController, - onFieldSubmitted: (value) { - searchMedicine(context, model); - }, - marginTop: 5, - ), - ), - SizedBox( - height: 20, - ), - FractionallySizedBox( - widthFactor: 0.9, - child: Container( - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, - ), - ], - ), - ), - ), - Container( - margin: - EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + AppTextFieldCustomSearch( + hintText: + TranslationBase.of(context).searchMedicineNameHere, + searchController: myController, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + marginTop: 5, + ), + Container( + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), + + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( TranslationBase.of(context).youCanFind + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, - fontWeight: FontWeight.bold, + TranslationBase.of(context).medicineSearchResult +" '${myController.text}'", + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.9, ), - ], - ), - ), - SizedBox( - height: 10, + ), + ], ), - if (myController.text != '') - Container( - height: MediaQuery.of(context).size.height * 0.6, - child: ListView.builder( - padding: const EdgeInsets.only(top: 20), + ), + SizedBox( + height: 5, + ), + if (myController.text != '') + Container( + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), - scrollDirection: Axis.vertical, - // shrinkWrap: true, - 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"], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index] - ["ItemID"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"]), - settings: RouteSettings( - name: 'PharmaciesListScreen'), - ), - ); - }, - ); - }, - ), + 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, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + 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'), + ), + ); + }, + ); + }, ), - ], - ), + ), + ], )), + 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, + ), + 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, + ), + ], ), ), + ); }); } @@ -244,7 +209,6 @@ class _MedicineSearchState extends State { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); - //"Type Medicine Name") return; } if (myController.text.length < 3) { @@ -259,7 +223,6 @@ class _MedicineSearchState extends State { } startVoiceSearch() { - // lastWords = ""; lastError = ""; speech.listen( onResult: resultListener, @@ -275,18 +238,15 @@ class _MedicineSearchState extends State { void resultListener(SpeechRecognitionResult result) { setState(() { - // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - reconizedWord = result.recognizedWords; + recognizedWord = result.recognizedWords; lastStatus = ''; - myController.text = reconizedWord; + myController.text = recognizedWord; Future.delayed(const Duration(seconds: 2), () { - // searchMedicine(context); }); }); } void errorListener(SpeechRecognitionError error) { - // print("Received error status: $error, listening: ${speech.isListening}"); setState(() { lastError = "${error.errorMsg} - ${error.permanent}"; }); @@ -294,23 +254,15 @@ class _MedicineSearchState extends State { void statusListener(String status) { // print( - // "Received listener status: $status, listening: ${speech.isListening}"); setState(() { lastStatus = status; }); } - // _switchLang(selectedVal) { - // setState(() { - // _currentLocaleId = selectedVal; - // }); - // print(selectedVal); - // } void soundLevelListener(double level) { minSoundLevel = min(minSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level); - // print("sound level $level: $minSoundLevel - $maxSoundLevel "); setState(() { this.level = level; }); diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 49c39c53..4c0c27ea 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -1,21 +1,28 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../../locator.dart'; + DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class PharmaciesListScreen extends StatefulWidget { @@ -34,7 +41,6 @@ class _PharmaciesListState extends State { Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); @@ -43,196 +49,237 @@ class _PharmaciesListState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).pharmaciesList, - body: Container( - height: SizeConfig.screenHeight, - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const AlwaysScrollableScrollPhysics(), - children: [ - model.pharmaciesList.length > 0 - ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: widget.url != null - ? Image.network( - widget.url, - height: - SizeConfig.imageSizeMultiplier * - 21, - width: - SizeConfig.imageSizeMultiplier * - 20, - fit: BoxFit.cover, - ): Container(), - ), + body: Center( + child: FractionallySizedBox( + widthFactor: 0.95, + child: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ + model.pharmaciesList.length > 0 + ? MedicineItemWidget( + label: model.pharmaciesList[0]["ItemDescription"], + url: widget.url, + showArrow: false, + showPrice: true, + price: model.pharmaciesList[0]["SellingPrice"] + .toString(), + ) + : Container(), + Container( + margin: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 2, + bottom: SizeConfig.widthMultiplier * 2, + right: SizeConfig.widthMultiplier * 4, + left: SizeConfig.widthMultiplier * 4, + ), + child: Align( + alignment: Alignment.centerLeft, + child: AppText( + TranslationBase.of(context).youCanFindItIn, + fontWeight: FontWeight.bold, ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - AppText( - TranslationBase.of(context) - .description, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - TranslationBase.of(context).price, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["SellingPrice"] - .toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), - ) - ], - )): Container(), - Container( - margin: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 2, - bottom: SizeConfig.widthMultiplier * 2, - right: SizeConfig.widthMultiplier * 4, - left: SizeConfig.widthMultiplier * 4, - ), - child: Align( - alignment: Alignment.centerLeft, - child: AppText( - TranslationBase.of(context).youCanFindItIn, - fontWeight: FontWeight.bold, + ), + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, ), - ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, - ), - Container( - width: SizeConfig.screenWidth * 0.99, - margin: EdgeInsets.only(left: 10,right: 10), - child: ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model - .pharmaciesList.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - margin: EdgeInsets.only(top: 5), - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.network( - model - .pharmaciesList[index]["ProjectImageURL"], - height: - SizeConfig.imageSizeMultiplier * 15, - width: - SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, - ), - ), - ), - Expanded( - flex: 4, - child: AppText( - model - .pharmaciesList[index]["LocationDescription"], - margin: 10, - ), - ), - Expanded( - flex: 2, - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.end, - crossAxisAlignment: WrapCrossAlignment.end, - children: [ - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.call, - color: Colors.red, - ), - onTap: () => - launch("tel://" + - model - .pharmaciesList[index]["PhoneNumber"]), + Container( + width: SizeConfig.screenWidth * 0.99, + margin: EdgeInsets.only(left: 10, right: 10), + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: model.pharmaciesList == null + ? 0 + : model.pharmaciesList.length, + itemBuilder: (BuildContext context, int index) { + return CardWithBgWidget( + bgColor: Colors.transparent, + hasBorder: false, + widget: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.network( + model.pharmaciesList[index] + ["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), ), - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.pin_drop, - color: Colors.red, - ), - onTap: () { + ), + Expanded( + flex: 4, + child: AppText( + Helpers.convertToTitleCase( + model.pharmaciesList[index] + ["LocationDescription"] ?? + ''), + margin: 10, + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + ), + + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { MapsLauncher.launchCoordinates( double.parse( - model - .pharmaciesList[index]["Latitude"]), + model.pharmaciesList[index] + ["Latitude"]), double.parse( - model - .pharmaciesList[index]["Longitude"]), + model.pharmaciesList[index] + ["Longitude"]), model.pharmaciesList[index] - ["LocationDescription"]); + ["LocationDescription"]); }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + Icons.pin_drop, + size: 15, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "location", + fontSize: 8, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), ), - ), - ], - ), + SizedBox( + height: 10, + ), + InkWell( + onTap: () { + launch("tel://" + + model.pharmaciesList[index] + ["PhoneNumber"]); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.call, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "Call Now", + fontSize: 8, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + ], + ), + // Expanded( + // flex: 2, + // child: Wrap( + // direction: Axis.horizontal, + // alignment: WrapAlignment.end, + // crossAxisAlignment: WrapCrossAlignment.end, + // children: [ + // Padding( + // padding: EdgeInsets.all(5), + // child: InkWell( + // child: Icon( + // Icons.call, + // color: Colors.red, + // ), + // onTap: () => launch("tel://" + + // model.pharmaciesList[index] + // ["PhoneNumber"]), + // ), + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: InkWell( + // child: Icon( + // Icons.pin_drop, + // color: Colors.red, + // ), + // onTap: () { + // MapsLauncher.launchCoordinates( + // double.parse( + // model.pharmaciesList[index] + // ["Latitude"]), + // double.parse( + // model.pharmaciesList[index] + // ["Longitude"]), + // model.pharmaciesList[index] + // ["LocationDescription"]); + // }, + // ), + // ), + // ], + // ), + // ), + ], ), - ], - ), - ); - }), - ) - ]), - ),),); + ); + }), + ) + ]), + ), + ), + ), + ), + ); } - Image imageFromBase64String(String base64String) { return Image.memory(base64Decode(base64String)); } //TODO CHECK THE URL IS NULL OR NOT Uint8List dataFromBase64String(String base64String) { - if(base64String !=null) - return base64Decode(base64String); + if (base64String != null) return base64Decode(base64String); } String base64String(Uint8List data) { diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 68e29870..5958c5fe 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -1,14 +1,10 @@ import 'package:doctor_app_flutter/config/config.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/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.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/util/date-utils.dart'; @@ -54,6 +50,7 @@ class _AddPatientSickLeaveScreenState extends State { AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); bool isFormSubmitted = false; + void _presentDatePicker() { showDatePicker( context: context, @@ -203,7 +200,7 @@ class _AddPatientSickLeaveScreenState extends State { Icon( DoctorApp.warning, size: 20, - color: IN_PROGRESS_COLOR, + color: AppGlobal.inProgressColor, ), SizedBox( width: 10, @@ -214,7 +211,7 @@ class _AddPatientSickLeaveScreenState extends State { .recommendedSickLeaveDays, textAlign: TextAlign.start, fontSize: 12, - color: IN_PROGRESS_COLOR, + color: AppGlobal.inProgressColor, ), ), ], diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 51c5b35b..9fd5c7af 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -5,14 +5,14 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; @@ -121,27 +121,27 @@ class PatientSickLeaveScreen extends StatelessWidget { child: InkWell( 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( - Helpers.capitalize( - item.doctorName ?? ""), - fontSize: 18, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: - TextOverflow.ellipsis, + if (item.doctorName != null) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + Helpers.capitalize( + item.doctorName ?? ""), + fontSize: 18, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: + TextOverflow.ellipsis, + ), ), - ), - ]), + ]), SizedBox( height: 10, ), @@ -151,8 +151,7 @@ class PatientSickLeaveScreen extends StatelessWidget { borderRadius: BorderRadius.circular(50.0), child: CachedNetworkImage( - imageUrl: item - .doctorImageURL ?? + imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", height: 30, width: 30, @@ -167,93 +166,95 @@ class PatientSickLeaveScreen extends StatelessWidget { SizedBox( width: 10, ), - 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(), - ), - 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), + Expanded( + 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(), ), - ), - 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), - ) - : DateTime.parse( - item.startDate ?? - "") - .add( - Duration( - days: - item.noOfDays ?? - ""), - ), + 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), + ), ), - ), - ], - crossAxisAlignment: - CrossAxisAlignment.start, + 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), + ) + : DateTime.parse( + item.startDate ?? + "") + .add( + Duration( + days: + item.noOfDays ?? + ""), + ), + ), + ), + ], + crossAxisAlignment: + CrossAxisAlignment.start, + ), ), ], ), diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 6791785a..fe61d80a 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -8,11 +8,11 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.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/text_fields/app_text_field_custom_serach.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../routes.dart'; +import '../../widgets/shared/errors/error_message.dart'; class DischargedPatient extends StatefulWidget { @override @@ -34,32 +34,16 @@ class _DischargedPatientState extends State { baseViewModel: model, body: model.myDischargedPatient.isEmpty ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Discharged Patient', - color: Theme.of(context).errorColor, - ), - ) - ], + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).referralEmptyMsg, ), - ) + )) : Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( height: 12, ), diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba4c108c..53c145c9 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -39,84 +39,116 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox(height: 12,), - AppText('Service',style: "caption2",color: Colors.black,), - AppText('ECG',bold: true,fontSize: 22,), - SizedBox(height: 12,), - ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( - onTap: () async { - await launch( - model.patientMuseResultsModelList[index].imageURL); - }, - 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) - ), - child: Column( - children: [ - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), - SizedBox(height:3), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), - children: [ - 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)), - ], + SizedBox( + height: 12, + ), + AppText( + 'Service', + style: "caption2", + color: Colors.black, + ), + AppText( + 'ECG', + bold: true, + fontSize: 22, + ), + SizedBox( + height: 12, + ), + ...List.generate( + model.patientMuseResultsModelList.length, + (index) => InkWell( + onTap: () async { + await launch(model + .patientMuseResultsModelList[index].imageURL); + }, + 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)), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + 'ECG Report', + fontWeight: FontWeight.w700, + fontSize: 17, + ), + SizedBox(height: 3), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + 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)), + ], + ), + ) + ], + ), ), - ) - ], - ), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText('${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - AppText('${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), - ], - ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + SizedBox( + height: 15, + ), + Align( + alignment: Alignment.topRight, + child: Icon(DoctorApp.external_link), + ) + ], ), - ], - ), - SizedBox(height: 15,), - Align( - alignment: Alignment.topRight, - child: Icon(DoctorApp.external_link), - ) - ], - ), - ), - )), - + ), + )), ], ), ), diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index 16083b84..06041e00 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -1,11 +1,9 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 0c48cd2a..47cd999d 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -17,4 +17,4 @@ class NoData extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index cadab9be..b743b8f7 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -1,22 +1,20 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../util/tab_helper.dart'; import '../DischargedPatientPage.dart'; import 'in_patient_list_page.dart'; @@ -26,6 +24,7 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; String selectedClinicName; + InPatientScreen({Key key, this.specialClinic}); @override @@ -111,7 +110,6 @@ class _InPatientScreenState extends State Expanded( child: Scaffold( extendBodyBehindAppBar: false, - appBar: PreferredSize( preferredSize: Size.fromHeight( MediaQuery.of(context).size.height * 0.070), @@ -126,14 +124,13 @@ class _InPatientScreenState extends State color: Colors.white), child: Container( margin: EdgeInsets.only(top: 9), - color: Helpers.getBgTabColor(), - + color: TabHelper.getBgTabColor(), child: TabBar( isScrollable: false, controller: _tabController, indicatorColor: AppGlobal.appRedColor, indicatorWeight: 0.001, - indicator:BoxDecoration(), + indicator: BoxDecoration(), // indicatorSize: TabBarIndicatorSize.tab, // labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only( @@ -141,13 +138,25 @@ class _InPatientScreenState extends State // unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll,context: context, - counter: model.inPatientList.length, isFirst: true), - tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle, - counter: model.myIinPatientList.length, isMiddle: true, context: context,), - tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged, isLast:true, context: context,), + TranslationBase.of(context).inPatientAll, + context: context, + counter: model.inPatientList.length, + isFirst: true), + tabWidget( + screenSize, + _activeTab == 1, + TranslationBase.of(context).myInPatientTitle, + counter: model.myIinPatientList.length, + isMiddle: true, + context: context, + ), + tabWidget( + screenSize, + _activeTab == 2, + TranslationBase.of(context).discharged, + isLast: true, + context: context, + ), ], ), ), @@ -198,23 +207,27 @@ class _InPatientScreenState extends State Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1, - bool isFirst = false, - bool isMiddle = false, - bool isLast = false,BuildContext context}) { - + bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + BuildContext context}) { ProjectViewModel projectsProvider = Provider.of(context); - return Center( child: Container( - height: Helpers.getTabHeight(context), - decoration:Helpers.getBoxTabsBoxDecoration(isActive: isActive,isFirst: isFirst, isMiddle: isMiddle, isLast: isLast,projectViewModel: projectsProvider), + height: TabHelper.getTabHeight(context), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: isActive, + isFirst: isFirst, + isMiddle: isMiddle, + isLast: isLast, + projectViewModel: projectsProvider), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText(title:title, isActive:isActive), + TabHelper.getTabText(title: title, isActive: isActive), if (counter != -1) - Helpers.getTabCounter(isActive:isActive,counter:counter) + TabHelper.getTabCounter(isActive: isActive, counter: counter) ], ), ), diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart index 06634819..5c84e819 100644 --- a/lib/screens/patients/In_patient/list_of_all_in_patient.dart +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -16,7 +16,6 @@ class ListOfAllInPatient extends StatelessWidget { final bool isAllClinic; final bool hasQuery; - final PatientSearchViewModel patientSearchViewModel; @override @@ -32,7 +31,7 @@ class ListOfAllInPatient extends StatelessWidget { patientSearchViewModel.filteredInPatientItems.length, scrollDirection: Axis.vertical, shrinkWrap: true, - physics: const AlwaysScrollableScrollPhysics (), + physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (context, index) { return PatientCard( patientInfo: patientSearchViewModel @@ -69,11 +68,13 @@ class ListOfAllInPatient extends StatelessWidget { onNotification: (notification) { if (isAllClinic && !hasQuery) if (notification is ScrollUpdateNotification) { - if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) { + if (notification.metrics.pixels >= + notification.metrics.maxScrollExtent - 50) { patientSearchViewModel.addOnFilteredList(); } - if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) { + if (notification.metrics.pixels <= + notification.metrics.minScrollExtent - 50) { patientSearchViewModel.removeOnFilteredList(); } } diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart index f5f7c070..5f33bc77 100644 --- a/lib/screens/patients/In_patient/list_of_my_inpatient.dart +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import '../../../routes.dart'; import 'NoData.dart'; + class ListOfMyInpatient extends StatelessWidget { const ListOfMyInpatient({ Key key, @@ -19,47 +20,50 @@ class ListOfMyInpatient extends StatelessWidget { @override Widget build(BuildContext context) { return Expanded( - child:Container( + child: Container( margin: EdgeInsets.symmetric(horizontal: 16.0), - child: patientSearchViewModel.filteredMyInPatientItems.length == 0 - ? NoData():NotificationListener( - child: ListView.builder( - itemCount: patientSearchViewModel.filteredMyInPatientItems.length, - scrollDirection: Axis.vertical, - // physics: ScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return PatientCard( - patientInfo: patientSearchViewModel.filteredMyInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: true, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + child: patientSearchViewModel.filteredMyInPatientItems.length == 0 + ? NoData() + : NotificationListener( + child: ListView.builder( + itemCount: + patientSearchViewModel.filteredMyInPatientItems.length, + scrollDirection: Axis.vertical, + // physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return PatientCard( + patientInfo: patientSearchViewModel + .filteredMyInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: true, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": - patientSearchViewModel.filteredMyInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - "isMyPatient": true, - }); - }, - ); - }), - onNotification: (t) { - return; - }, - ), + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientSearchViewModel + .filteredMyInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + "isMyPatient": true, + }); + }, + ); + }), + onNotification: (t) { + return; + }, + ), ), ); } diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index a52df188..86b05a4e 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -121,7 +121,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor : Colors.red[700], @@ -150,9 +150,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.admissionDate, - "dd MMM,yyyy"), + AppDateUtils + .convertDateFromServerFormat( + referredPatient.admissionDate, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -175,9 +176,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate, - "dd MMM,yyyy"), + AppDateUtils + .convertDateFromServerFormat( + referredPatient.dischargeDate, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: @@ -436,9 +438,10 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"), + AppDateUtils + .convertDateFromServerFormat( + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 92f92f87..fd5ce080 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -3,95 +3,119 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-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'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../util/translations_delegate_base.dart'; +import '../../widgets/shared/errors/error_message.dart'; import 'ReferralDischargedPatientDetails.dart'; class ReferralDischargedPatientPage extends StatefulWidget { @override - _ReferralDischargedPatientPageState createState() => _ReferralDischargedPatientPageState(); + _ReferralDischargedPatientPageState createState() => + _ReferralDischargedPatientPageState(); } -class _ReferralDischargedPatientPageState extends State { - +class _ReferralDischargedPatientPageState + extends State { @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.gtMyDischargeReferralPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Referral Discharged ', - backgroundColor: Colors.grey[200], + backgroundColor: Colors.grey[200], isShowAppBar: false, baseViewModel: model, - body: model.myDischargeReferralPatient.isEmpty?Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( + body: model.myDischargeReferralPatient.isEmpty + ? Center( + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).referralEmptyMsg, + ), + )) + : Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Discharged Patient', - color: Theme.of(context).errorColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 5, + ), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails( + model.myDischargeReferralPatient[ + index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: + model.getReferralStatusNameByCode( + model + .myDischargeReferralPatient[index] + .referralStatus, + context), + referralStatusCode: model + .myDischargeReferralPatient[index] + .referralStatus, + patientName: model + .myDischargeReferralPatient[index] + .firstName + + " " + + model.myDischargeReferralPatient[index] + .lastName, + patientGender: model + .myDischargeReferralPatient[index].gender, + referredDate: + AppDateUtils.getDayMonthYearDateFormatted( + model + .myDischargeReferralPatient[index] + .referralDate), + referredTime: AppDateUtils.getTimeHHMMA(model + .myDischargeReferralPatient[index] + .referralDate), + patientID: + "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic: + "${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model + .myDischargeReferralPatient[index] + .referringDoctorRemarks, + nationality: model + .myDischargeReferralPatient[index] + .nationalityName, + nationalityFlag: '', + //model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: '', + //model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model + .myDischargeReferralPatient[index] + .referringDoctorName, + clinicDescription: model + .myDischargeReferralPatient[index] + .referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + )), + ), + ], ), - ) - ], - ), - ):Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.myDischargeReferralPatient.length, - itemBuilder: (context,index)=>InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), - ), - ); - }, - child: PatientReferralItemWidget( - referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), - referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, - patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, - patientGender: model.myDischargeReferralPatient[index].gender, - referredDate: AppDateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), - referredTime: AppDateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), - patientID: "${model.myDischargeReferralPatient[index].patientID}", - isSameBranch: false, - isReferral: true, - isReferralClinic: true, - referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", - remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, - nationality: model.myDischargeReferralPatient[index].nationalityName, - nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend - doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend - referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, - clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, - infoIcon: Icon(FontAwesomeIcons.arrowRight, - size: 25, color: Colors.black), - ), - )), ), - - ], - ), - ), ), ); } - - } diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 0ad4abd0..7ee9a950 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -3,18 +3,18 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card_insurance.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../widgets/shared/errors/error_message.dart'; import '../base/base_view.dart'; class InsuranceApprovalScreenNew extends StatefulWidget { @@ -119,24 +119,9 @@ class _InsuranceApprovalScreenNewState ], ) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noInsuranceApprovalFound), - ), - SizedBox( - height: 150.0, - ) - ], - ), - ), + child: ErrorMessage( + error: TranslationBase.of(context).errorNoInsuranceApprovals, + )), ), ) : SingleChildScrollView( @@ -207,21 +192,10 @@ class _InsuranceApprovalScreenNewState ], ) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noInsuranceApprovalFound), - ) - ], - ), - )), + child: ErrorMessage( + error: TranslationBase.of(context) + .noInsuranceApprovalFound, + ))), ), ), ); diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index e81a843a..254efa22 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; @@ -14,6 +14,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/config.dart'; + class InsuranceApprovalsDetails extends StatefulWidget { PatiantInformtion patient; int indexInsurance; @@ -21,6 +23,7 @@ class InsuranceApprovalsDetails extends StatefulWidget { InsuranceApprovalsDetails( {this.patient, this.indexInsurance, this.patientType}); + @override _InsuranceApprovalsDetailsState createState() => _InsuranceApprovalsDetailsState( @@ -105,7 +108,7 @@ class _InsuranceApprovalsDetailsState extends State { "Approved" || "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == "تمت الموافقة" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127) : Color(0xffD02127), letterSpacing: -0.4, @@ -483,7 +486,7 @@ class _InsuranceApprovalsDetailsState extends State { null ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == "Approved" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127) : Color(0xffD02127), ), diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 14ae707b..d03f19ee 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -12,6 +12,8 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../config/config.dart'; + class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; @@ -144,7 +146,7 @@ class _FilterDatePageState extends State { child: AppButton( title: TranslationBase.of(context).search, padding: 10, - color: Color(0xFF359846), + color: AppGlobal.appGreenColor, onPressed: () async { if (widget.patientSearchViewModel.selectedFromDate == null || diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index a43a4582..04131ae2 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -7,7 +6,7 @@ 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/models/patient/patient_model.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'; @@ -15,17 +14,14 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.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/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import '../../../util/tab_helper.dart'; import 'filter_date_page.dart'; // ignore: must_be_immutable @@ -84,6 +80,7 @@ class _OutPatientsScreenState extends State { @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + projectsProvider = Provider.of(context); _times = [ TranslationBase.of(context).previous, TranslationBase.of(context).today, @@ -99,15 +96,15 @@ class _OutPatientsScreenState extends State { appBarTitle: "Search Patient", isShowAppBar: true, appBar: PatientSearchHeader( - title: "My Out patient", + title: TranslationBase.of(context).myOutPatient, ), baseViewModel: model, body: Column( children: [ Container( // color: Colors.red, - height: Helpers.getTabHeight(context), - color: Helpers.getBgTabColor(), + height: TabHelper.getTabHeight(context), + color: TabHelper.getBgTabColor(), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -142,7 +139,7 @@ class _OutPatientsScreenState extends State { child: Center( child: Container( height: screenSize.height * 0.070, - decoration: Helpers.getBoxTabsBoxDecoration( + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: _isActive, isFirst: _times.indexOf(item) == 0, isLast: @@ -154,12 +151,12 @@ class _OutPatientsScreenState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText( + TabHelper.getTabText( title: item, isActive: _isActive), _isActive && _activeLocation != 0 && model.state == ViewState.Idle - ? Helpers.getTabCounter( + ? TabHelper.getTabCounter( isActive: _isActive, counter: model.filterData.length) : Container(), diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index c7056ce3..fe40408e 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/request_prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/request_prescription_report.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -21,33 +21,31 @@ class OutPatientPrescriptionDetailsScreen extends StatefulWidget { class _OutPatientPrescriptionDetailsScreenState extends State { - - - getPrescriptionReport(BuildContext context,PatientViewModel model ){ - RequestPrescriptionReport prescriptionReqModel = - RequestPrescriptionReport( + getPrescriptionReport(BuildContext context, PatientViewModel model) { + RequestPrescriptionReport prescriptionReqModel = RequestPrescriptionReport( appointmentNo: widget.prescriptionResModel.appointmentNo, episodeID: widget.prescriptionResModel.episodeID, setupID: widget.prescriptionResModel.setupID, patientTypeID: widget.prescriptionResModel.patientID); model.getPrescriptionReport(prescriptionReqModel.toJson()); } + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => getPrescriptionReport(context, model), builder: (_, model, w) => AppScaffold( appBarTitle: TranslationBase.of(context).prescriptionDetails, - body: CardWithBgWidgetNew( - widget: ListView.builder( - itemCount: model.prescriptionReport.length, - itemBuilder: (BuildContext context, int index) { - return OutPatientPrescriptionDetailsItem( - prescriptionReport: - model.prescriptionReport[index], - ); - }), - ), - ),); + body: CardWithBgWidgetNew( + widget: ListView.builder( + itemCount: model.prescriptionReport.length, + itemBuilder: (BuildContext context, int index) { + return OutPatientPrescriptionDetailsItem( + prescriptionReport: model.prescriptionReport[index], + ); + }), + ), + ), + ); } } diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index 2dd01e1a..085a8822 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index b0ec2943..6f2f3e73 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -1,23 +1,19 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.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/models/patient/patient_model.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'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.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/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index e1fdd033..94f18d81 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -117,7 +117,7 @@ class _PatientSearchScreenState extends State { onPressed: () { onSubmitSearch(); }, - color: Colors.red[800], + color: AppGlobal.appRedColor, ), ), ), diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart index a1ee2cab..c7807f6f 100644 --- a/lib/screens/patients/patient_search/time_bar.dart +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -20,6 +20,7 @@ class TimeBar extends StatefulWidget { this.patientSearchRequestModel, this.isSearchWithKeyInfo}) : super(key: key); + @override _TimeBarState createState() => _TimeBarState(); } diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 901dcfe1..c7b51da3 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -2,12 +2,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/viewModel/patient-ucaf-viewmodel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -27,11 +28,11 @@ class UcafDetailScreen extends StatefulWidget { UcafDetailScreen(this.patient, this.model, {this.changeLoadingState}); @override - _UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model); + _UcafDetailScreenState createState() => + _UcafDetailScreenState(this.patient, this.model); } class _UcafDetailScreenState extends State { - final PatiantInformtion patient; final UcafViewModel model; @@ -43,17 +44,15 @@ class _UcafDetailScreenState extends State { @override void initState() { - model.saveUCAFOnTap = () async{ + model.saveUCAFOnTap = () async { widget.changeLoadingState(true); await ucafModel.postUCAF(patient); widget.changeLoadingState(false); if (ucafModel.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context) - .postUcafSuccessMsg); + TranslationBase.of(context).postUcafSuccessMsg); Navigator.of(context).popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; + return route.settings.name == PATIENTS_PROFILE; }); } else { DrAppToastMsg.showErrorToast(ucafModel.error); @@ -105,7 +104,6 @@ class _UcafDetailScreenState extends State { ), ), ), - ], ), )); @@ -236,7 +234,6 @@ class _UcafDetailScreenState extends State { ]; } } - } class DiagnosisWidget extends StatelessWidget { @@ -343,7 +340,7 @@ class DiagnosisWidget extends StatelessWidget { class MedicationWidget extends StatelessWidget { final UcafViewModel model; - final EntityList prescription; + final PrescriptionEntityModel prescription; MedicationWidget(this.model, this.prescription); diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 93bae074..ca907068 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,22 +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/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/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: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 '../../../../routes.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; class UCAFInputScreen extends StatefulWidget { final PatiantInformtion patient; @@ -43,6 +38,8 @@ class _UCAFInputScreenState extends State { final _whereController = TextEditingController(); final _managementsLineController = TextEditingController(); final _signsController = TextEditingController(); + + ///TODO Elham* fix this List conditionsData = [ {"name": "CHRONIC", "isChecked": false}, {"name": "RTA", "isChecked": false}, @@ -384,29 +381,11 @@ class _UCAFInputScreenState extends State { : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context) - .chiefComplaintEmptyMsg, - fontWeight: FontWeight.normal, - textAlign: TextAlign.center, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), - ) + child: ErrorMessage( + error: model.patientVitalSignsHistory == null || + model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context).chiefComplaintEmptyMsg)) : Container(), ), ); diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 6d9838f4..4ab7f0f6 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -3,14 +3,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -/// * -/// By Mousa Zaid Mousa Abuzaid -/// At 13/4/2021 +import '../../../../config/config.dart'; -/* - All hex value from 100% to 0% alpha: used in line 122 - https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 - */ class PageStepperWidget extends StatelessWidget { final int stepsCount; @@ -18,7 +12,11 @@ class PageStepperWidget extends StatelessWidget { final Size screenSize; final List stepsTitles; - PageStepperWidget({this.stepsCount, this.currentStepIndex, this.screenSize, this.stepsTitles}); + PageStepperWidget( + {this.stepsCount, + this.currentStepIndex, + this.screenSize, + this.stepsTitles}); @override Widget build(BuildContext context) { @@ -33,11 +31,23 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, - dividerWidth, stepsTitles: stepsTitles,) + StepWidget( + i, + true, + i == stepsCount, + i < currentStepIndex, + dividerWidth, + stepsTitles: stepsTitles, + ) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, - dividerWidth, stepsTitles: stepsTitles,) + StepWidget( + i, + false, + i == stepsCount, + i < currentStepIndex, + dividerWidth, + stepsTitles: stepsTitles, + ) ], ) ], @@ -47,7 +57,6 @@ class PageStepperWidget extends StatelessWidget { } class StepWidget extends StatelessWidget { - final int index; final bool isInProgress; final bool isFinalStep; @@ -56,7 +65,8 @@ class StepWidget extends StatelessWidget { final List stepsTitles; StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, - this.dividerWidth, {this.stepsTitles}); + this.dividerWidth, + {this.stepsTitles}); @override Widget build(BuildContext context) { @@ -64,9 +74,9 @@ class StepWidget extends StatelessWidget { if (isInProgress) { status = StepStatus.InProgress; } else { - if(isStepFinish){ + if (isStepFinish) { status = StepStatus.Completed; - }else { + } else { status = StepStatus.Locked; } } @@ -82,17 +92,27 @@ class StepWidget extends StatelessWidget { width: 30, height: 30, decoration: BoxDecoration( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : AppGlobal.appGreenColor, shape: BoxShape.circle, border: Border.all( - color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) : Color(0xFF359846), + color: status == StepStatus.InProgress + ? Color(0xFFCC9B14) + : status == StepStatus.Locked + ? Color(0xFFE3E3E3) + : AppGlobal.appGreenColor, width: 1), ), child: Center( child: Icon( Icons.check, size: 20, - color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white, + color: status == StepStatus.Locked + ? Color(0xFF969696) + : Colors.white, )), ), if (!isFinalStep) @@ -100,7 +120,9 @@ class StepWidget extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), width: dividerWidth, height: 2, - color: status == StepStatus.Completed ? Color(0xFF359846) : Color(0xFFCCCCCC), + color: status == StepStatus.Completed + ? AppGlobal.appGreenColor + : Color(0xFFCCCCCC), ), ], ), @@ -108,7 +130,9 @@ class StepWidget extends StatelessWidget { height: 8, ), AppText( - stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles[index - 1]}", + stepsTitles == null + ? "${TranslationBase.of(context).step} $index" + : "${stepsTitles[index - 1]}", fontWeight: FontWeight.bold, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, fontFamily: 'Poppins', @@ -126,11 +150,13 @@ class StepWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(4.0), ), - border: Border.all(color: status == StepStatus.InProgress - ? Color(0xFFF1E9D3) - : status == StepStatus.Locked - ? Color(0x29797979) - : Color(0xFFD8E8D8), width: 0.30), + border: Border.all( + color: status == StepStatus.InProgress + ? Color(0xFFF1E9D3) + : status == StepStatus.Locked + ? Color(0x29797979) + : Color(0xFFD8E8D8), + width: 0.30), ), child: AppText( status == StepStatus.InProgress @@ -145,8 +171,8 @@ class StepWidget extends StatelessWidget { color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked - ? Color(0xFF969696) - : Color(0xFF359846), + ? Color(0xFF969696) + : AppGlobal.appGreenColor, ), ) ], @@ -158,4 +184,4 @@ enum StepStatus { InProgress, Locked, Completed, -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index b6fce680..b370adfa 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -1,16 +1,15 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import '../../../../routes.dart'; import 'UCAF-detail-screen.dart'; @@ -177,7 +176,6 @@ class _UCAFPagerScreenState extends State borderColor: Colors.white, color: Colors.white, fontColor: Color(0xFFB8382B), - fontSize: 2.2, onPressed: () { Navigator.of(context).popUntil((route) { return route.settings.name == PATIENTS_PROFILE; @@ -199,7 +197,6 @@ class _UCAFPagerScreenState extends State borderColor: Color(0xFFB8382B), color: AppGlobal.appRedColor, fontColor: Colors.white, - fontSize: 2.0, onPressed: () { model.saveUCAFOnTap(); }, diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 9719b525..be98605e 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 9fa78cef..ef7cb9f5 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -5,11 +5,11 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -25,10 +25,12 @@ import '../../../../routes.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => + _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState extends State { +class _AdmissionRequestThirdScreenState + extends State { final _dietTypeRemarksController = TextEditingController(); final _sickLeaveCommentsController = TextEditingController(); final _postMedicalHistoryController = TextEditingController(); @@ -99,12 +101,14 @@ class _AdmissionRequestThirdScreenState extends State 0 + onClick: model.clinicList != null && + model.clinicList.length > 0 ? () { openListDialogField( - projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', + projectViewModel.isArabic + ? 'clinicNameArabic' + : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { @@ -135,21 +142,30 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.clinicList.length > 0) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getClinics().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.clinicList.length > 0) { openListDialogField( - projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', + projectViewModel.isArabic + ? 'clinicNameArabic' + : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { _selectedClinic = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -160,13 +176,17 @@ class _AdmissionRequestThirdScreenState extends State 0 + ? model.doctorsList != null && + model.doctorsList.length > 0 ? () { - openListDialogField('DoctorName', 'DoctorID', model.doctorsList, + openListDialogField('DoctorName', + 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; @@ -174,21 +194,29 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.doctorsList.length > 0) { - openListDialogField('DoctorName', 'DoctorID', model.doctorsList, + .getClinicDoctors( + _selectedClinic['clinicID']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == ViewState.Idle && + model.doctorsList.length > 0) { + openListDialogField('DoctorName', + 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } } : null, @@ -220,7 +248,8 @@ class _AdmissionRequestThirdScreenState extends State 0 + onClick: model.dietTypesList != null && + model.dietTypesList.length > 0 ? () { - openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { + openListDialogField( + 'nameEn', 'id', model.dietTypesList, + (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog( + context); await model .getDietTypes(patient.patientId) - .then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { - openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.dietTypesList.length > 0) { + openListDialogField( + 'nameEn', 'id', model.dietTypesList, + (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -288,7 +332,8 @@ class _AdmissionRequestThirdScreenState extends State list, Function(dynamic selectedValue) okFunction) { + void openListDialogField(String attributeName, String attributeValueId, + List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 99097777..3f1bf4ec 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -6,11 +6,11 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -25,10 +25,12 @@ import '../../../../routes.dart'; class AdmissionRequestThirdScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => + _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState extends State { +class _AdmissionRequestThirdScreenState + extends State { dynamic _selectedDiagnosis; dynamic _selectedIcd; dynamic _selectedDiagnosisType; @@ -105,13 +107,18 @@ class _AdmissionRequestThirdScreenState extends State 0 + onClick: model.diagnosisTypesList != null && + model.diagnosisTypesList.length > 0 ? () { - openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) { + openListDialogField('nameEn', 'id', + model.diagnosisTypesList, + (selectedValue) { setState(() { _selectedDiagnosis = selectedValue; }); @@ -119,17 +126,24 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.diagnosisTypesList.length > 0) { - openListDialogField('nameEn', 'id', model.diagnosisTypesList, (selectedValue) { + await model.getDiagnosis().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.diagnosisTypesList.length > 0) { + openListDialogField('nameEn', 'id', + model.diagnosisTypesList, + (selectedValue) { setState(() { _selectedDiagnosis = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { + } else if (model.state == + ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -139,13 +153,18 @@ class _AdmissionRequestThirdScreenState extends State 0 + onClick: model.icdCodes != null && + model.icdCodes.length > 0 ? () { - openListDialogField('description', 'code', model.icdCodes, (selectedValue) { + openListDialogField( + 'description', 'code', model.icdCodes, + (selectedValue) { setState(() { _selectedIcd = selectedValue; }); @@ -155,17 +174,24 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.icdCodes.length > 0) { - openListDialogField('description', 'code', model.icdCodes, (selectedValue) { + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.icdCodes.length > 0) { + openListDialogField( + 'description', 'code', model.icdCodes, + (selectedValue) { setState(() { _selectedIcd = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { + } else if (model.state == + ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -175,14 +201,19 @@ class _AdmissionRequestThirdScreenState extends State 0 + onClick: model.listOfDiagnosisSelectionTypes != + null && + model.listOfDiagnosisSelectionTypes.length > + 0 ? () { - openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes, + openListDialogField('description', 'code', + model.listOfDiagnosisSelectionTypes, (selectedValue) { setState(() { _selectedDiagnosisType = selectedValue; @@ -192,20 +223,29 @@ class _AdmissionRequestThirdScreenState extends State GifLoaderDialogUtils.hideDialog(context)); + .getMasterLookup(MasterKeysService + .DiagnosisSelectionType) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); if (model.state == ViewState.Idle && - model.listOfDiagnosisSelectionTypes.length > 0) { - openListDialogField('description', 'code', model.listOfDiagnosisSelectionTypes, + model.listOfDiagnosisSelectionTypes + .length > + 0) { + openListDialogField('description', 'code', + model.listOfDiagnosisSelectionTypes, (selectedValue) { setState(() { - _selectedDiagnosisType = selectedValue; + _selectedDiagnosisType = + selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { + } else if (model.state == + ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -244,47 +284,60 @@ class _AdmissionRequestThirdScreenState extends State list, Function(dynamic selectedValue) okFunction) { + void openListDialogField(String attributeName, String attributeValueId, + List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 0258d26f..c5fbe2df 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -7,12 +7,12 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -28,10 +28,12 @@ import '../../../../routes.dart'; class AdmissionRequestSecondScreen extends StatefulWidget { @override - _AdmissionRequestSecondScreenState createState() => _AdmissionRequestSecondScreenState(); + _AdmissionRequestSecondScreenState createState() => + _AdmissionRequestSecondScreenState(); } -class _AdmissionRequestSecondScreenState extends State { +class _AdmissionRequestSecondScreenState + extends State { final _postPlansEstimatedCostController = TextEditingController(); final _estimatedCostController = TextEditingController(); final _expectedDaysController = TextEditingController(); @@ -111,12 +113,14 @@ class _AdmissionRequestSecondScreenState extends State 0 + onClick: model.floorList != null && + model.floorList.length > 0 ? () { - openListDialogField('description', 'floorID', model.floorList, (selectedValue) { + openListDialogField( + 'description', + 'floorID', + model.floorList, (selectedValue) { setState(() { _selectedFloor = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.getFloors().then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.floorList.length > 0) { - openListDialogField('description', 'floorID', model.floorList, - (selectedValue) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getFloors().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.floorList.length > 0) { + openListDialogField( + 'description', + 'floorID', + model.floorList, (selectedValue) { setState(() { _selectedFloor = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -243,32 +274,46 @@ class _AdmissionRequestSecondScreenState extends State 0 + onClick: model.wardList != null && + model.wardList.length > 0 ? () { - openListDialogField('description', 'nursingStationID', model.wardList, - (selectedValue) { + openListDialogField( + 'description', + 'nursingStationID', + model.wardList, (selectedValue) { setState(() { _selectedWard = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.getWards().then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.wardList.length > 0) { - openListDialogField('description', 'nursingStationID', model.wardList, - (selectedValue) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getWards().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.wardList.length > 0) { + openListDialogField( + 'description', + 'nursingStationID', + model.wardList, (selectedValue) { setState(() { _selectedWard = selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -277,37 +322,54 @@ class _AdmissionRequestSecondScreenState extends State 0 + onClick: model.roomCategoryList != null && + model.roomCategoryList.length > 0 ? () { - openListDialogField('description', 'categoryID', model.roomCategoryList, + openListDialogField( + 'description', + 'categoryID', + model.roomCategoryList, (selectedValue) { setState(() { - _selectedRoomCategory = selectedValue; + _selectedRoomCategory = + selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog(context); - await model - .getRoomCategories() - .then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.roomCategoryList.length > 0) { - openListDialogField('description', 'categoryID', model.roomCategoryList, + GifLoaderDialogUtils.showMyDialog( + context); + await model.getRoomCategories().then( + (_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.roomCategoryList.length > 0) { + openListDialogField( + 'description', + 'categoryID', + model.roomCategoryList, (selectedValue) { setState(() { - _selectedRoomCategory = selectedValue; + _selectedRoomCategory = + selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -315,7 +377,8 @@ class _AdmissionRequestSecondScreenState extends State 0 + onClick: model.admissionTypeList != null && + model.admissionTypeList.length > 0 ? () { - openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) { + openListDialogField('nameEn', 'id', + model.admissionTypeList, + (selectedValue) { setState(() { - _selectedAdmissionType = selectedValue; + _selectedAdmissionType = + selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog( + context); await model - .getMasterLookup(MasterKeysService.AdmissionRequestType) - .then((_) => GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.Idle && model.admissionTypeList.length > 0) { - openListDialogField('nameEn', 'id', model.admissionTypeList, (selectedValue) { + .getMasterLookup(MasterKeysService + .AdmissionRequestType) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.admissionTypeList.length > + 0) { + openListDialogField('nameEn', 'id', + model.admissionTypeList, + (selectedValue) { setState(() { - _selectedAdmissionType = selectedValue; + _selectedAdmissionType = + selectedValue; }); }); - } else if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } else { - DrAppToastMsg.showErrorToast("Empty List"); + DrAppToastMsg.showErrorToast( + "Empty List"); } }, ), @@ -417,107 +501,140 @@ class _AdmissionRequestSecondScreenState extends State list, Function(dynamic selectedValue) okFunction) { + void openListDialogField(String attributeName, String attributeValueId, + List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index 593850a7..fe769397 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -3,20 +3,16 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/diabetic_chart/DiabeticType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.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/diabetic_chart/line_chart_for_diabetic.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; @@ -42,7 +38,10 @@ class _DiabeticChartState extends State { DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1), DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2), DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3), - DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) + DiabeticType( + nameAr: "Blood Glucose(Glucometer)", + nameEn: "Blood Glucose(Glucometer)", + value: 4) ]; DiabeticType selectedDiabeticType; @@ -56,7 +55,8 @@ class _DiabeticChartState extends State { onModelReady: (model) async { selectedDiabeticType = diabeticType[2]; - await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); + await model.getDiabeticChartValues(patient, selectedDiabeticType.value, + isLocalBusy: false); generateData(model); }, builder: (_, model, w) => AppScaffold( @@ -70,84 +70,69 @@ class _DiabeticChartState extends State { child: Column( children: [ Container( - width: MediaQuery.of(context).size.width * 0.7, + width: MediaQuery.of(context).size.width * 0.7, child: DropdownButtonHideUnderline( child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedDiabeticType.value, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return diabeticType - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - - padding: EdgeInsets.all(2), - margin: EdgeInsets.all(2), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: - BorderRadius.circular( - 20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: Center( - child: AppText( - diabeticType - .length - .toString(), - color: Colors.white, - fontSize: projectsProvider - .isArabic - ? 10 - : 11, - textAlign: - TextAlign.center, - ), - )), - ], - ), - AppText( - selectedDiabeticType.nameEn, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedDiabeticType.value, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return diabeticType.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + diabeticType.length.toString(), + color: Colors.white, + fontSize: + projectsProvider.isArabic ? 10 : 11, + textAlign: TextAlign.center, + ), + )), ], - ); - }).toList(); - }, - onChanged: (newValue) async { - await onChangeFunc(newValue, model, patient); - setState(() { - - }); - }, - items: diabeticType - .map((item) { - return DropdownMenuItem( - child: AppText( - item.nameEn, - textAlign: TextAlign.left, ), - value: item.value, - ); - }).toList(), - )), + AppText(selectedDiabeticType.nameEn, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + await onChangeFunc(newValue, model, patient); + setState(() {}); + }, + items: diabeticType.map((item) { + return DropdownMenuItem( + child: AppText( + item.nameEn, + textAlign: TextAlign.left, + ), + value: item.value, + ); + }).toList(), + )), ), timeSeriesData1.length != 0 || timeSeriesData2.length != 0 ? Padding( @@ -155,7 +140,6 @@ class _DiabeticChartState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( @@ -199,7 +183,9 @@ class _DiabeticChartState extends State { ], ), ) - : Center(child: ErrorMessage(error: TranslationBase.of(context).noItem)), + : Center( + child: ErrorMessage( + error: TranslationBase.of(context).noItem)), ], ), )), @@ -236,20 +222,17 @@ class _DiabeticChartState extends State { onChangeFunc(newValue, PatientViewModel model, patient) async { GifLoaderDialogUtils.showMyDialog(context); setState(() { - selectedDiabeticType = diabeticType[newValue-1]; + selectedDiabeticType = diabeticType[newValue - 1]; timeSeriesData1.clear(); timeSeriesData2.clear(); }); - await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); - if(model.state == ViewState.ErrorLocal){ + await model.getDiabeticChartValues(patient, selectedDiabeticType.value, + isLocalBusy: true); + if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } generateData(model); GifLoaderDialogUtils.hideDialog(context); - - - - } } diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index b3b1b581..3eea87f9 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -12,8 +12,10 @@ import 'package:provider/provider.dart'; class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; - DiabeticDetails( - {Key key, this.diabeticDetailsList,}); + DiabeticDetails({ + Key key, + this.diabeticDetailsList, + }); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -40,7 +42,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -52,7 +53,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), child: Container( child: AppText( - "Result", + "Result", fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -70,7 +71,8 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: + BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 671230c2..297c8fbb 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; @@ -12,7 +11,7 @@ class LineChartForDiabetic extends StatelessWidget { final bool isOX; LineChartForDiabetic( - {this.title, this.timeSeries1, this.indexes, this.isOX= false}); + {this.title, this.timeSeries1, this.indexes, this.isOX = false}); List xAxixs = List(); List yAxixs = List(); @@ -93,10 +92,12 @@ class LineChartForDiabetic extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontSize: 10, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, rotateAngle: -65, //rotateAngle:-65, interval: 100, @@ -121,13 +122,17 @@ class LineChartForDiabetic extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), - interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, - + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, + interval: getMaxY() - getMinY() <= 500 + ? 50 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200, margin: 12, ), ), @@ -226,10 +231,10 @@ class LineChartForDiabetic extends StatelessWidget { ); List lineChartData = List(); - if(spots.isNotEmpty){ + if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } - if(spots2.isNotEmpty){ + if (spots2.isNotEmpty) { lineChartData.add(lineChartBarData2); } return lineChartData; diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index e52a67df..e646252a 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -1,32 +1,19 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; -import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; -import 'package:doctor_app_flutter/core/model/note/note_model.dart'; -import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.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/notes/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 532d5e46..48fa30b8 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -21,6 +21,7 @@ class AllDischargeSummary extends StatefulWidget { class _AllDischargeSummaryState extends State { int pageIndex = 1; + @override Widget build(BuildContext context) { return BaseView( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index e88c242f..979fd207 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -1,11 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -25,6 +23,7 @@ class DischargeSummaryWidget extends StatefulWidget { class _DischargeSummaryWidgetState extends State { bool isCardExpanded = false; + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 0878994a..41961cd9 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 0313371b..44b8aa93 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -1,11 +1,12 @@ import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/errors/error_message.dart'; import 'package:flutter/material.dart'; + import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index be863b87..7eb53d0a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -1,17 +1,14 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; import 'lab_result_history_chart_and_detials.dart'; -import 'lab_result_chart_and_detials.dart'; class FlowChartPage extends StatelessWidget { final PatientLabOrders patientLabOrder; @@ -52,23 +49,9 @@ class FlowChartPage extends StatelessWidget { ) : Container( child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), - ), + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )), ), ), ); diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 118bc476..2cb2b7b9 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -15,7 +15,8 @@ class LabResultHistoryPage extends StatelessWidget { final PatiantInformtion patient; LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); -// TODO mosa UI changes + +// TODO Elham* UI changes and add translation @override Widget build(BuildContext context) { return BaseView( @@ -34,14 +35,17 @@ class LabResultHistoryPage extends StatelessWidget { ...List.generate(model.labOrdersResultHistoryList.length, (index) { return Container( - margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), + margin: EdgeInsets.symmetric( + vertical: 8.0, horizontal: 16.0), child: Column( children: [ Row( children: [ AppText( TranslationBase.of(context).description, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -49,8 +53,11 @@ class LabResultHistoryPage extends StatelessWidget { width: 1, ), AppText( - model.labOrdersResultHistoryList[index].description, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + model.labOrdersResultHistoryList[index] + .description, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, isCopyable: true, @@ -61,7 +68,9 @@ class LabResultHistoryPage extends StatelessWidget { children: [ AppText( "Reference Range", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -69,8 +78,11 @@ class LabResultHistoryPage extends StatelessWidget { width: 1, ), AppText( - model.labOrdersResultHistoryList[index].referanceRange, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + model.labOrdersResultHistoryList[index] + .referanceRange, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, isCopyable: true, @@ -81,7 +93,9 @@ class LabResultHistoryPage extends StatelessWidget { children: [ AppText( "Result Value", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -89,8 +103,11 @@ class LabResultHistoryPage extends StatelessWidget { width: 1, ), AppText( - model.labOrdersResultHistoryList[index].resultValue, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + model.labOrdersResultHistoryList[index] + .resultValue, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, isCopyable: true, @@ -101,7 +118,9 @@ class LabResultHistoryPage extends StatelessWidget { children: [ AppText( "Verified On", - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -109,8 +128,11 @@ class LabResultHistoryPage extends StatelessWidget { width: 1, ), AppText( - model.labOrdersResultHistoryList[index].verifiedOn, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + model.labOrdersResultHistoryList[index] + .verifiedOn, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, isCopyable: true, diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 6ca92a4a..166510d8 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/FlowChartPage.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -11,8 +11,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'LabResultHistoryPage.dart'; - class LabResultWidget extends StatelessWidget { final String filterName; final List patientLabResultList; @@ -163,21 +161,27 @@ class LabResultWidget extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - if(patientLabResultList[index].checkResultStatus() != 0) - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.red.shade700, - // borderRadius: BorderRadius.all( - // Radius.circular(25.0), - // ), - ), - child: Icon( - patientLabResultList[index].checkResultStatus() == 1 ? Icons.arrow_upward : Icons.arrow_downward, - color: Colors.white, - size: 16, + if (patientLabResultList[index] + .checkResultStatus() != + 0) + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red.shade700, + // borderRadius: BorderRadius.all( + // Radius.circular(25.0), + // ), + ), + child: Icon( + patientLabResultList[index] + .checkResultStatus() == + 1 + ? Icons.arrow_upward + : Icons.arrow_downward, + color: Colors.white, + size: 16, + ), ), - ), Expanded( child: Container( alignment: Alignment.center, @@ -185,13 +189,15 @@ class LabResultWidget extends StatelessWidget { vertical: 10, horizontal: 4), child: Center( child: AppText( - patientLabResultList[index].resultValue ?? + patientLabResultList[index] + .resultValue ?? "" + " " + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, isCopyable: true, - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: + SizeConfig.textMultiplier * 1.8, ), ), ), @@ -221,8 +227,8 @@ class LabResultWidget extends StatelessWidget { context, FadePage( page: FlowChartPage( - filterName: - patientLabResultList[index].description, + filterName: patientLabResultList[index] + .description, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 697d16d2..d60d1d73 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -24,12 +24,6 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /* decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), - border: Border.all(color: Colors.grey, width: 1), - ),*/ margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, @@ -94,10 +88,9 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic? AppDateUtils.getWeekDayArabic(date.weekday): AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - fontFamily: 'Poppins', ), ), @@ -110,7 +103,6 @@ class _VitalSignDetailsWidgetState extends State { '${vital.resultValue}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index 490d0ec4..84256efc 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -19,7 +19,8 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } -class _VitalSignDetailsWidgetState extends State { +class _VitalSignDetailsWidgetState + extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -113,4 +114,4 @@ class _VitalSignDetailsWidgetState extends State }); return tableRow; } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index 89860f44..002b108d 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -59,7 +59,6 @@ class LineChartCurvedState extends State { widget.title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -97,23 +96,25 @@ class LineChartCurvedState extends State { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontSize: 11, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, margin: 28, - rotateAngle:-65, + rotateAngle: -65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + DateTime date = AppDateUtils.convertStringToDate( + widget.labResult[value.toInt()].verifiedOnDateTime); if (widget.labResult.length < 8) { if (widget.labResult.length > value.toInt()) { return '${date.day}/ ${date.year}'; } else return ''; } else { - if (value.toInt() == 0) - return '${date.day}/ ${date.year}'; + if (value.toInt() == 0) return '${date.day}/ ${date.year}'; if (value.toInt() == widget.labResult.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { @@ -121,18 +122,17 @@ class LineChartCurvedState extends State { } } - - return ''; }, ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, getTitles: (value) { return '${value.toInt()}'; }, @@ -160,7 +160,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY()+2, + maxY: getMaxY() + 2, minY: getMinY(), lineBarsData: getData(), ); @@ -169,10 +169,10 @@ class LineChartCurvedState extends State { double getMaxY() { double max = 0; widget.labResult.forEach((element) { - try{ - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble > max) max = resultValueDouble;} - catch(e){ + try { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble; + } catch (e) { print(e); } }); @@ -182,13 +182,14 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; - try{ - min = double.parse(widget.labResult[0].resultValue); - - widget.labResult.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); - if (resultValueDouble < min) min = resultValueDouble; - });}catch(e){ + try { + min = double.parse(widget.labResult[0].resultValue); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble < min) min = resultValueDouble; + }); + } catch (e) { print(e); } int value = min.toInt(); @@ -199,13 +200,13 @@ class LineChartCurvedState extends State { List getData() { List spots = List(); for (int index = 0; index < widget.labResult.length; index++) { - try{ - var resultValueDouble = double.parse(widget.labResult[index].resultValue); - spots.add(FlSpot(index.toDouble(), resultValueDouble)); - }catch(e){ + try { + var resultValueDouble = + double.parse(widget.labResult[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } catch (e) { print(e); spots.add(FlSpot(index.toDouble(), 0.0)); - } } diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart index ea9300d0..f358abd2 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; @@ -98,10 +98,12 @@ class LineChartCurvedLabHistoryState extends State { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontSize: 11, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, margin: 28, rotateAngle: -65, getTitles: (value) { @@ -127,11 +129,12 @@ class LineChartCurvedLabHistoryState extends State { ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, getTitles: (value) { return '${value.toInt()}'; }, diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 545b4378..49f5c7f7 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -13,6 +13,8 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class AllLabSpecialResult extends StatefulWidget { const AllLabSpecialResult({Key key}) : super(key: key); @@ -86,6 +88,9 @@ class _AllLabSpecialResultState extends State { ], ), ), + if(model.allSpecialLabList.length == 0) + ErrorMessage(error: TranslationBase.of(context).noItem), + if(model.allSpecialLabList.length > 0) ListView.builder( physics: NeverScrollableScrollPhysics(), itemCount: model.allSpecialLabList.length, @@ -189,20 +194,9 @@ class _AllLabSpecialResultState extends State { if (model.allSpecialLabList.isEmpty && patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Lab Result Found'), - ) - ], - ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) ], ), ), diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 49fee0f4..42b4206d 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,13 +1,11 @@ - import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'LineChartCurved.dart'; import 'Lab_Result_details_wideget.dart'; - +import 'LineChartCurved.dart'; class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ @@ -19,7 +17,6 @@ class LabResultChartAndDetails extends StatelessWidget { final List labResult; final String name; - @override Widget build(BuildContext context) { return Padding( @@ -30,18 +27,17 @@ class LabResultChartAndDetails extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) + color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: LineChartCurved( + title: name, + labResult: labResult, ), - child: LineChartCurved(title: name,labResult:labResult,), ), Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), + color: Colors.white, borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -51,7 +47,9 @@ class LabResultChartAndDetails extends StatelessWidget { fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), LabResultDetailsWidget( labResult: labResult.reversed.toList(), ), @@ -62,5 +60,4 @@ class LabResultChartAndDetails extends StatelessWidget { ), ); } - } diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index dd8ace01..399a99ff 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.dart'; @@ -69,14 +69,14 @@ class _LabResultState extends State { ), ], ), - ], ), ), CardWithBgWidgetNew( widget: LabResultWidget( labResult: model.labResultList, - )) + ), + ) ], ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 4ccd4379..c377d04e 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -39,12 +39,11 @@ class _LaboratoryResultPageState extends State { builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileAppBar( - widget.patient, - isInpatient:widget.isInpatient, - isFromLabResult: true, + widget.patient, + isInpatient: widget.isInpatient, + isFromLabResult: true, appointmentDate: widget.patientLabOrders.orderDate, ), - baseViewModel: model, body: AppScaffold( isShowAppBar: false, diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 9bf81081..a90c72e1 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResultWidget.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -81,11 +81,12 @@ class _LaboratoryResultWidgetState extends State { padding: EdgeInsets.all(10.0), margin: EdgeInsets.only(left: 5, right: 5), decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - ),), + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + ), + ), child: Row( children: [ Expanded( @@ -95,7 +96,8 @@ class _LaboratoryResultWidgetState extends State { child: AppText( TranslationBase.of(context) .generalResult, - fontSize: SizeConfig.textMultiplier * 2.3, + fontSize: + SizeConfig.textMultiplier * 2.3, bold: false, ))), Container( @@ -138,9 +140,11 @@ class _LaboratoryResultWidgetState extends State { shrinkWrap: true, itemBuilder: (context, index) { return LabResultWidget( - patientLabOrder: widget.patientLabOrder, + patientLabOrder: + widget.patientLabOrder, filterName: model - .labResultLists[index].filterName, + .labResultLists[index] + .filterName, patientLabResultList: model .labResultLists[index] .patientLabResultList, @@ -186,12 +190,13 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only( - left: 0, right: 0), + margin: + EdgeInsets.only(left: 0, right: 0), child: AppText( TranslationBase.of(context) .specialResult, - fontSize: SizeConfig.textMultiplier * 2.3, + fontSize: + SizeConfig.textMultiplier * 2.3, bold: false, ))), Container( diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 67303256..6383de4b 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,6 +1,6 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_pag import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; @@ -18,6 +18,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class LabsHomePage extends StatefulWidget { @override _LabsHomePageState createState() => _LabsHomePageState(); @@ -208,7 +210,7 @@ class _LabsHomePageState extends State { clinic: model .patientLabOrdersList[index].clinicDescription, appointmentDate: - model.patientLabOrdersList[index].orderDate, + model.patientLabOrdersList[index].createdOn, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), @@ -220,20 +222,9 @@ class _LabsHomePageState extends State { if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Lab Result Found'), - ) - ], - ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) ], ), ), diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index db86dd72..7df9fc8e 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; @@ -13,7 +13,8 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient}) + : super(key: key); @override Widget build(BuildContext context) { @@ -53,8 +54,10 @@ class SpecialLabResultDetailsPage extends StatelessWidget { resultData != null ? Container( width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 72ee1311..54a7c75d 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -13,6 +13,8 @@ import 'package:flutter/material.dart'; import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; +import '../../../../config/config.dart'; + class AddVerifyMedicalReport extends StatefulWidget { final PatiantInformtion patient; final String patientType; @@ -38,6 +40,8 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { + HtmlEditorController _controller = HtmlEditorController(); + @override Widget build(BuildContext context) { String txtOfMedicalReport; @@ -68,13 +72,26 @@ class _AddVerifyMedicalReportState extends State { children: [ if (model.medicalReportTemplate.length > 0) HtmlRichEditor( - initialText: (widget.medicalReport != null + initialText: (widget.medicalReport != + null ? widget.medicalNote - : widget.model.medicalReportTemplate[0].templateText.length > 0 - ? widget.model.medicalReportTemplate[0].templateText + : widget + .model + .medicalReportTemplate[ + 0] + .templateText + .length > + 0 + ? widget + .model + .medicalReportTemplate[0] + .templateText : ""), + controller: _controller, hint: "Write the medical report ", - height: MediaQuery.of(context).size.height * 0.75, + height: + MediaQuery.of(context).size.height * + 0.75, ), ], ), @@ -100,27 +117,35 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.medicalReport != null - ?await widget.model.updateMedicalReport( + ? await widget.model.updateMedicalReport( widget.patient, txtOfMedicalReport, - widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, - widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) - : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); + widget.medicalReport != null + ? widget.medicalReport.lineItemNo + : null, + widget.medicalReport != null + ? widget.medicalReport.invoiceNo + : null) + : await widget.model.addMedicalReport( + widget.patient, txtOfMedicalReport); //model.getMedicalReportList(patient); Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); + if (widget.model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model.error); } } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); + DrAppToastMsg.showErrorToast( + "Please enter medical note"); } }, ), @@ -134,20 +159,25 @@ class _AddVerifyMedicalReportState extends State { title: widget.status == MedicalReportStatus.ADD ? TranslationBase.of(context).add : TranslationBase.of(context).verify, - color: Color(0xff359846), + color: AppGlobal.appGreenColor, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = + await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); + await widget.model.verifyMedicalReport( + widget.patient, widget.medicalReport); GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context); - if (widget.model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(widget.model.error); + if (widget.model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + widget.model.error); } } else { - DrAppToastMsg.showErrorToast("Please enter medical note"); + DrAppToastMsg.showErrorToast( + "Please enter medical note"); } }, ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index ab24f8e0..227d5346 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -1,16 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; @@ -59,27 +56,31 @@ class MedicalReportDetailPage extends StatelessWidget { ], ), ), - medicalReport.reportDataHtml != null ? Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - border: Border.fromBorderSide( - BorderSide( - color: Colors.white, - width: 1.0, + medicalReport.reportDataHtml != null + ? Container( + width: double.infinity, + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.white, + width: 1.0, + ), + ), + ), + child: Html(data: medicalReport.reportDataHtml ?? ""), + ) + : Container( + child: ErrorMessage( + error: "No Data", + ), ), - ), - ), - child: Html( - data: medicalReport.reportDataHtml ?? "" - ), - ) : Container( - child: ErrorMessage(error: "No Data",), - ), ], ), ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index bb03a9bc..249d5d0a 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel. 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/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; @@ -117,12 +117,15 @@ class _MedicalReportPageState extends State { arrivalType: arrivalType, medicalReport: model.medicalReportList[index], model: model, - medicalNote: model.medicalReportList[index].reportDataHtml, + medicalNote: model + .medicalReportList[index].reportDataHtml, ), - settings: RouteSettings(name: 'AddVerifyMedicalReport')), + settings: + RouteSettings(name: 'AddVerifyMedicalReport')), ); } else { - Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { + Navigator.of(context) + .pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { 'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, @@ -136,7 +139,9 @@ class _MedicalReportPageState extends State { margin: EdgeInsets.symmetric(horizontal: 8), child: CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : AppGlobal.appGreenColor, + bgColor: model.medicalReportList[index].status == 1 + ? Color(0xFFCC9B14) + : AppGlobal.appGreenColor, widget: Column( children: [ Row( @@ -149,16 +154,22 @@ class _MedicalReportPageState extends State { model.medicalReportList[index].status == 1 ? TranslationBase.of(context).onHold : TranslationBase.of(context).verified, - color: model.medicalReportList[index].status == 1 - ? Color(0xFFCC9B14) - : AppGlobal.appGreenColor, + color: + model.medicalReportList[index].status == + 1 + ? Color(0xFFCC9B14) + : AppGlobal.appGreenColor, fontSize: 1.4 * SizeConfig.textMultiplier, bold: true, ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN ?? "" - : model.medicalReportList[index].doctorName ?? "", + ? model.medicalReportList[index] + .doctorNameN ?? + "" + : model.medicalReportList[index] + .doctorName ?? + "", fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), @@ -188,12 +199,16 @@ class _MedicalReportPageState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only(left: 0, top: 4, right: 8, bottom: 0), + margin: EdgeInsets.only( + left: 0, top: 4, right: 8, bottom: 0), child: LargeAvatar( name: projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN - : model.medicalReportList[index].doctorName, - url: model.medicalReportList[index].doctorImageURL, + ? model + .medicalReportList[index].doctorNameN + : model + .medicalReportList[index].doctorName, + url: model + .medicalReportList[index].doctorImageURL, ), width: 50, height: 50, @@ -201,20 +216,27 @@ class _MedicalReportPageState extends State { Expanded( child: Container( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( projectViewModel.isArabic - ? model.medicalReportList[index].projectNameN - : model.medicalReportList[index].projectName, - fontSize: 1.6 * SizeConfig.textMultiplier, + ? model.medicalReportList[index] + .projectNameN + : model.medicalReportList[index] + .projectName, + fontSize: + 1.6 * SizeConfig.textMultiplier, color: Color(0xFF2E303A), ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index].clinicNameN - : model.medicalReportList[index].clinicName, - fontSize: 1.6 * SizeConfig.textMultiplier, + ? model.medicalReportList[index] + .clinicNameN + : model.medicalReportList[index] + .clinicName, + fontSize: + 1.6 * SizeConfig.textMultiplier, color: Color(0xFF2E303A), ), ], @@ -227,7 +249,9 @@ class _MedicalReportPageState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Icon( - model.medicalReportList[index].status == 1 ? DoctorApp.edit_1 : EvaIcons.eye, + model.medicalReportList[index].status == 1 + ? DoctorApp.edit_1 + : EvaIcons.eye, ), ], ), diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index f47c99ae..657e5ed6 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -8,27 +8,25 @@ import 'package:doctor_app_flutter/core/viewModel/patient_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/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; - - DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { @@ -90,11 +88,7 @@ class _ProgressNoteState extends State { patient, isInpatient: true, ), - body: model.patientProgressNoteList == null || - model.patientProgressNoteList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) - : Container( + body: Container( color: Colors.grey[200], child: Column( children: [ @@ -168,10 +162,8 @@ class _ProgressNoteState extends State { index] .createdBy) AppText( - TranslationBase.of(context) .notePending, - fontWeight: FontWeight.bold, color: Color(0xFFCC9B14), fontSize: 12, @@ -319,7 +311,8 @@ class _ProgressNoteState extends State { }, child: Container( decoration: BoxDecoration( - color: AppGlobal.appGreenColor, + color: AppGlobal + .appGreenColor, borderRadius: BorderRadius.circular( 10), @@ -463,7 +456,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase.of( context) - .createdBy, + .createdBy + ' ', fontSize: 10, ), Expanded( @@ -476,7 +469,27 @@ class _ProgressNoteState extends State { fontWeight: FontWeight.w600, fontSize: 12, - isCopyable:true, + isCopyable: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of(context).conditionDescription + ' : ', + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].conditionDescription ?? '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, ), ), ], @@ -510,7 +523,7 @@ class _ProgressNoteState extends State { .isArabic), fontWeight: FontWeight.w600, fontSize: 14, - isCopyable:true, + isCopyable: true, ), AppText( model @@ -528,7 +541,7 @@ class _ProgressNoteState extends State { DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, - isCopyable:true, + isCopyable: true, ), ], crossAxisAlignment: @@ -550,7 +563,7 @@ class _ProgressNoteState extends State { index] .notes, fontSize: 10, - isCopyable:true, + isCopyable: true, ), ), ]) diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 3fde4262..9df70b35 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -2,16 +2,16 @@ import 'package:doctor_app_flutter/config/config.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/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -26,6 +26,8 @@ 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; @@ -33,6 +35,8 @@ class UpdateNoteOrder extends StatefulWidget { final PatiantInformtion patient; final int visitType; final bool isUpdate; + final List elementList; + final Function(dynamic) okFunction; const UpdateNoteOrder( {Key key, @@ -40,7 +44,9 @@ class UpdateNoteOrder extends StatefulWidget { this.patientModel, this.patient, this.visitType, - this.isUpdate}) + this.isUpdate, + this.elementList, + this.okFunction}) : super(key: key); @override @@ -48,10 +54,11 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { + dynamic selectValue; int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -78,120 +85,35 @@ class _UpdateNoteOrderState extends State { @override Widget build(BuildContext context) { + String keyId = 'ParameterCode'; + projectViewModel = Provider.of(context); if (widget.note != null) { progressNoteController.text = widget.note.notes; - } + if(selectValue==null) + selectValue={}; + selectValue['ParameterCode'] = widget.note.condition; + selectValue['Description'] = widget.note.conditionDescription; - return AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Padding( - padding: EdgeInsets.all(0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - 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, - ), - SizedBox( - height: 10.0, - ), - Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Stack( - 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, - //TranslationBase.of(context).addProgressNote, - controller: progressNoteController, - maxLines: 35, - minLines: 25, - hasBorder: true, + } - // isTextFieldHasSuffix: true, - 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, - child: Column( - children: [ - IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ], - )) - ], - ), - ], - ), - ), - ), - ], - ), - ), - ), - ), - bottomSheet: Container( - height: progressNoteController.text.isNotEmpty? 130:70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - if(progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), - Container( - margin: EdgeInsets.all(5), - child: AppButton( + return BaseView( + onModelReady: (model) { + model.getStpMasterList(isLocalBusy: false); + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate @@ -201,73 +123,220 @@ class _UpdateNoteOrderState extends State { ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, - color: Color(0xff359846), - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { + ), + SizedBox( + height: 10.0, + ), + Container( + padding: EdgeInsets.only(right: 20, left: 20), + child: InkWell( + onTap: model.stpMasterList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.stpMasterList, + attributeName: 'Description', + attributeValueId: + model.stpMasterList.length == 1 + ? model.stpMasterList[0]['${keyId}'] + .toString() + : '${keyId}', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) => { + setState(() { + selectValue = selectedValue; + selectValue['isDefault'] = true; + }) + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).selectCondition,//'Select Condition', + dropDownText: model.stpMasterList.length == 1 + ? model.stpMasterList[0]['Description'] + : selectValue == null + ? null + : selectValue['Description'], + enabled: false, + isTextFieldHasSuffix: true, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + 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, + //TranslationBase.of(context).addProgressNote, + controller: progressNoteController, + maxLines: 35, + minLines: 25, + hasBorder: true, + + // isTextFieldHasSuffix: true, + 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, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: progressNoteController.text.isNotEmpty ? 130 : 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + if (progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { setState(() { - isSubmitted = true; + progressNoteController.text = ''; }); - if (progressNoteController.text.trim().isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + }, + ), + ), + Container( + 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, + color: AppGlobal.appGreenColor, + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + 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), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - verifiedNote: false, - patientTypeID: widget.patient.patientType, - patientOutSA: false, - ); - await widget.patientModel - .updatePatientProgressNote(reqModel); - } else { - CreateNoteModel reqModel = CreateNoteModel( - admissionNo: - int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, - visitType: widget.visitType, - patientID: widget.patient.patientId, - nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, - patientOutSA: false, - notes: progressNoteController.text); + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: + int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + conditionId: selectValue['ParameterCode']); + await widget.patientModel + .updatePatientProgressNote(reqModel); + } else { + CreateNoteModel reqModel = CreateNoteModel( + admissionNo: + int.parse(widget.patient.admissionNo), + createdBy: doctorProfile.doctorID, + visitType: widget.visitType, + patientID: widget.patient.patientId, + nursingRemarks: ' ', + 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) { - Helpers.showErrorToast(widget.patientModel.error); + if (widget.patientModel.state == + ViewState.ErrorLocal) { + Helpers.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()); + } + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).yourOrderAddedSuccessfully); + Navigator.of(context).pop(); } 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()); + Helpers.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); } - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } - })), - ], + })), + ], + ), ), ), ); @@ -296,7 +365,7 @@ class _UpdateNoteOrderState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -306,14 +375,14 @@ class _UpdateNoteOrderState extends State { } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text += reconizedWord + '\n'; + progressNoteController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 80e13a84..b0cf2a2d 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -1,31 +1,20 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; -import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.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/notes/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 4d566e6c..0592b4d0 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -1,31 +1,22 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; -import 'package:doctor_app_flutter/core/model/note/update_note_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/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_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/locator.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/update_operation_report.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; -import '../../../../config/shared_pref_kay.dart'; -import '../../../../models/patient/patiant_info_model.dart'; import '../../../../util/dr_app_shared_pref.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_texts_widget.dart'; @@ -68,306 +59,311 @@ class _ProgressNoteState extends State { ), body: Container( color: Colors.grey[200], - child:model.reservationList == null || - model.reservationList.length == 0 + child: model.reservationList == null || + model.reservationList.length == 0 ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), - ): Column( - children: [ - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.reservationList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: Colors.white, - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, - child: Column( - crossAxisAlignment: + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.reservationList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.white, + widget: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Row( + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model.reservationList[index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model.reservationList[index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], crossAxisAlignment: - CrossAxisAlignment - .start, + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .reservation, + fontSize: 10, + ), + Expanded( + child: AppText( + model.reservationList[index] + .oTReservationID + .toString(), + fontSize: 10, + ), + ) + ]), + SizedBox( + height: 8, + ), + if (model.reservationList[index] + .operationDate != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .operationDate, + fontSize: 10, + ), + Expanded( + child: AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .operationDate), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontSize: 10, + ), + ) + ]), + if (model.reservationList[index] + .timeStart != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of( - context) - .createdBy, + TranslationBase.of(context) + .operationTimeStart, fontSize: 10, ), Expanded( child: AppText( model .reservationList[ - index] - .doctorName ?? + index] + .timeStart, + fontSize: 10, + ), + ) + ]), + if (model.reservationList[index] + .remarks != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .remarks, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .remarks ?? '', - fontWeight: - FontWeight.w600, - fontSize: 12, + fontSize: 10, ), ), - ], - ), - ], - ), - ), - Column( - children: [ - AppText( - model - .reservationList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model - .reservationList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], - crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( + ]) + ], + ), + + SizedBox( + height: 20, + ), + + // if ( + // authenticationViewModel + // .doctorProfile.doctorID == + // model + // .operationReportList[ + // index] + // .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.end, children: [ - AppText( - TranslationBase.of(context).reservation, - fontSize: 10, - ), - Expanded( - child: AppText( - model.reservationList[index].oTReservationID.toString(), - fontSize: 10, - ), - ) - ]), - SizedBox( - height: 8, - ), - if (model.reservationList[index] - .operationDate != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).operationDate, - fontSize: 10, - ), - Expanded( - child: AppText( - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .operationDate), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true), - fontSize: 10, + InkWell( + onTap: () async { + await locator() + .logEvent( + eventCategory: + "Operation Report Screen", + eventAction: + "Update Operation Report ", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateOperationReport( + reservation: model + .reservationList[ + index], + patient: patient, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appGreenColor, + borderRadius: + BorderRadius.circular(10), ), - ) - ]), - if (model.reservationList[index] - .timeStart != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).operationTimeStart , - fontSize: 10, - ), - Expanded( - child: AppText( - model - .reservationList[ - index] - .timeStart, - fontSize: 10, - ), - ) - ]), - if (model.reservationList[index] - .remarks != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks, - fontSize: 10, - ), - Expanded( - child: AppText( - model - .reservationList[ - index] - .remarks ?? - '', - fontSize: 10, - ), - ), - ]) - ], - ), + // color:Colors.red[600], - SizedBox( - height: 20, - ), - - // if ( - // authenticationViewModel - // .doctorProfile.doctorID == - // model - // .operationReportList[ - // index] - // .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - InkWell( - onTap: () async { - await locator() - .logEvent( - eventCategory: - "Operation Report Screen", - eventAction: - "Update Operation Report ", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateOperationReport( - reservation: model - .reservationList[ - index], - patient: patient, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: AppGlobal.appGreenColor, - borderRadius: - BorderRadius.circular(10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of(context).operationReports, - fontSize: 10, - color: Colors.white, + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .operationReports, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - ], - ), - padding: EdgeInsets.all(6), + ), + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ), + ], ), - ), - SizedBox( - width: 10, - ), - SizedBox( - width: 10, - ), - ], - ), - SizedBox( - height: 10, + SizedBox( + height: 10, + ), + ], + ), ), - ], - ), - ), - ); - }), + ); + }), + ), + ), + ], ), - ), - ], - ), ), ), ); diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 28141d45..882bacc8 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -1,21 +1,12 @@ -import 'package:doctor_app_flutter/config/config.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/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; -import 'package:doctor_app_flutter/core/model/note/note_model.dart'; -import 'package:doctor_app_flutter/core/model/note/update_note_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/patient_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/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.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/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/util/dr_app_toast_msg.dart'; @@ -24,16 +15,16 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.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'; -import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; -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 '../../../../config/config.dart'; + class UpdateOperationReport extends StatefulWidget { final GetReservationsResponseModel reservation; + // final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; final int visitType; @@ -56,7 +47,7 @@ class _UpdateOperationReportState extends State { int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -100,8 +91,7 @@ class _UpdateOperationReportState extends State { return BaseView( onModelReady: (model) async { - await model - .getOperationReportDetails(widget.reservation); + await model.getOperationReportDetails(widget.reservation); OTReservationID.text = widget.reservation.oTReservationID.toString(); if (model.operationDetailsList.isNotEmpty) { @@ -156,7 +146,8 @@ class _UpdateOperationReportState extends State { child: Column( children: [ AppTextFieldCustom( - hintText:TranslationBase.of(context).reservation, + hintText: TranslationBase.of(context) + .reservation, controller: OTReservationID, maxLines: 1, minLines: 1, @@ -167,7 +158,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText:TranslationBase.of(context).preOperationDiagnosis, + hintText: TranslationBase.of(context) + .preOperationDiagnosis, controller: preOpDiagmosisController, maxLines: 20, minLines: 8, @@ -185,7 +177,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).postOperationDiagnosis, + hintText: TranslationBase.of(context) + .postOperationDiagnosis, controller: postOpDiagmosisNoteController, maxLines: 20, minLines: 8, @@ -203,7 +196,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).surgeon, + hintText: + TranslationBase.of(context).surgeon, controller: surgeonController, maxLines: 1, minLines: 1, @@ -220,7 +214,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText:TranslationBase.of(context).assistant, + hintText: + TranslationBase.of(context).assistant, controller: assistantNoteController, maxLines: 1, minLines: 1, @@ -239,7 +234,7 @@ class _UpdateOperationReportState extends State { ), AppTextFieldCustom( hintText: - TranslationBase.of(context).operation, + TranslationBase.of(context).operation, controller: operationController, maxLines: 20, minLines: 4, @@ -276,7 +271,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).finding, + hintText: + TranslationBase.of(context).finding, controller: findingController, maxLines: 20, minLines: 4, @@ -294,7 +290,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).surgeryProcedure, + hintText: TranslationBase.of(context) + .surgeryProcedure, controller: surgeryProcedureController, maxLines: 20, minLines: 8, @@ -313,7 +310,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).postOperationInstruction, + hintText: TranslationBase.of(context) + .postOperationInstruction, controller: postOpInstructionController, maxLines: 20, minLines: 8, @@ -332,7 +330,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).complicationDetails1, + hintText: TranslationBase.of(context) + .complicationDetails1, controller: complicationDetailsController, maxLines: 20, minLines: 4, @@ -350,7 +349,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).bloodLossDetail, + hintText: TranslationBase.of(context) + .bloodLossDetail, controller: bloodLossDetailController, maxLines: 20, minLines: 4, @@ -368,7 +368,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).histopathSpecimen, + hintText: TranslationBase.of(context) + .histopathSpecimen, controller: histopathSpecimenController, maxLines: 20, minLines: 4, @@ -387,7 +388,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).microbiologySpecimen, + hintText: TranslationBase.of(context) + .microbiologySpecimen, controller: microbiologySpecimenController, maxLines: 20, @@ -407,7 +409,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).otherSpecimen, + hintText: TranslationBase.of(context) + .otherSpecimen, controller: otherSpecimenController, maxLines: 20, minLines: 4, @@ -425,7 +428,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).scrubNurse, + hintText: TranslationBase.of(context) + .scrubNurse, controller: scrubNurseController, maxLines: 1, minLines: 1, @@ -443,7 +447,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText:TranslationBase.of(context).circulatingNurse, + hintText: TranslationBase.of(context) + .circulatingNurse, controller: circulatingNurseController, maxLines: 1, minLines: 1, @@ -462,7 +467,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).bloodTransfusedDetail, + hintText: TranslationBase.of(context) + .bloodTransfusedDetail, controller: BloodTransfusedDetailController, maxLines: 20, @@ -482,7 +488,8 @@ class _UpdateOperationReportState extends State { height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).anesthetist, + hintText: TranslationBase.of(context) + .anesthetist, controller: anasthetistController, maxLines: 1, minLines: 1, @@ -510,93 +517,101 @@ class _UpdateOperationReportState extends State { ), ), ), - bottomSheet: model.state != ViewState.Idle?Container(height: 0,): Container( - height: 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) +" "+ - TranslationBase.of(context).operationReports, - color: Color(0xff359846), - // disabled: operationReportsController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (isFormValid()) { - 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); - - if (model.state == - ViewState.ErrorLocal) { - Helpers.showErrorToast( - model.error); - } else { - // await model.( - // operationReportsRequest.toJson()); - - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - } - GifLoaderDialogUtils.hideDialog(context); - } - }, + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : Container( + height: 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: AppButton( + 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, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (isFormValid()) { + 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); + + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } else { + // await model.( + // operationReportsRequest.toJson()); + + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + } + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + ), + ], ), ), - ], - ), - ), )); } diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index 74d075e3..ce6389b9 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; @@ -37,9 +36,10 @@ class PendingOrdersScreen extends StatelessWidget { body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0 ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) : Column( children: [ Padding( @@ -70,10 +70,9 @@ class PendingOrdersScreen extends StatelessWidget { ), Expanded( child: Container( - height: MediaQuery.of(context).size.height *.9, + height: MediaQuery.of(context).size.height * .9, child: ListView.builder( - itemCount: - model.pendingOrdersList.length, + itemCount: model.pendingOrdersList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart new file mode 100644 index 00000000..d7904596 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart @@ -0,0 +1,206 @@ +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../widgets/transitions/fade_page.dart'; +import 'intervention_medication_history_screen.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class InterventionMedicationScreen extends StatefulWidget { + final PatiantInformtion patient; + final InterventionMedicationViewModel previousModel; + const InterventionMedicationScreen(this.patient, {Key key, this.previousModel}) : super(key: key); + + @override + _InterventionMedicationScreenState createState() => + _InterventionMedicationScreenState(); +} + +class _InterventionMedicationScreenState + extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) => model.getInterventionMedication( + patientId: widget.patient.patientId, + //admissionNo: int.parse(widget.patient.admissionNo), + fromDate: widget.previousModel.selectedFromDate, + toDate: widget.previousModel.selectedToDate, + ), + + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient: true, + ), + body: model.allInterventionList == null || + model.allInterventionList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allInterventionList.length, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + CustomRow( + valueSize: 14, + label: '', + value: model.allInterventionList[index].cS, + ) + ], + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(model + .allInterventionList[ + index] + .startDatetime), + isArabic: + projectViewModel + .isArabic, + isMonthShort: + true), + fontWeight: + FontWeight.w600, + fontSize: 14, + color: Color(0xFF2B353E), + ), + ], + ), + ], + ) + ], + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).description, + value: model.allInterventionList[index].description, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).medication, + value: model.allInterventionList[index].medication, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).doctorComments, + value: model.allInterventionList[index].doctorComments, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).statusDescription, + value: model.allInterventionList[index].statusDescription, + ), + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ), + onTap: () { + Navigator.push( + context, + FadePage( + page: InterventionMedicationHistoryScreen(widget.patient, model.allInterventionList[index]), + ), + ); + }, + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart new file mode 100644 index 00000000..10239f50 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart @@ -0,0 +1,299 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_res_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../../../config/config.dart'; +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../widgets/shared/user-guid/CusomRow.dart'; + + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class InterventionMedicationHistoryScreen extends StatefulWidget { + final PatiantInformtion patient; + final InterventionMedicationResModel interventionMedication; + const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key key}) : super(key: key); + + @override + _InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState(); +} + +class _InterventionMedicationHistoryScreenState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) => model.getInterventionMedicationHistory( + patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo, + ), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient: true, + ), + body: model.allInterventionHistoryList == null || + model.allInterventionHistoryList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allInterventionHistoryList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).createdByName, + value: model.allInterventionHistoryList[index].createdByName, + ), + ], + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + model + .allInterventionHistoryList[ + index].createdOn) + ,isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontWeight: FontWeight.w600, + fontSize: 14, + color: Color(0xFF2B353E), + ), + ], + ), + ], + ) + ], + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).remarks, + value: model.allInterventionHistoryList[index].remark, + ), + SizedBox( + height: 8, + ), + SizedBox( + height: 8, + ), + SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { + + GifLoaderDialogUtils.showMyDialog(context); + await model.setAcceptedOrRejected( + remarks: "", + memberId: model.allInterventionHistoryList[index].commentedBy, + prescriptionNo: model.allInterventionHistoryList[index].prescriptionId, + patientID: model.allInterventionHistoryList[index].patientId, + orderNo: model.allInterventionHistoryList[index].orderNo, + admissionNo: model.allInterventionHistoryList[index].admissionNo, + interventionStatus: 1, + status: 61 + ); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + } else { + await model.getInterventionMedicationHistory(patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo,); + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Has been Successfully accepted"); + } + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appGreenColor, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .accept, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + + GifLoaderDialogUtils.showMyDialog(context); + await model.setAcceptedOrRejected( + remarks: "", + memberId: model.allInterventionHistoryList[index].commentedBy, + prescriptionNo: model.allInterventionHistoryList[index].prescriptionId, + patientID: model.allInterventionHistoryList[index].patientId, + orderNo: model.allInterventionHistoryList[index].orderNo, + admissionNo: model.allInterventionHistoryList[index].admissionNo, + interventionStatus: 2, + status: 61 + ); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + } else { + await model.getInterventionMedicationHistory(patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo,); + GifLoaderDialogUtils.hideDialog(context); + + DrAppToastMsg.showSuccesToast( + "Has been Successfully Rejected"); + } + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appRedColor, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .reject, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart new file mode 100644 index 00000000..191ac79e --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart @@ -0,0 +1,262 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../../config/config.dart'; +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../base/base_view.dart'; +import 'intervention_medication.dart'; + +class PharmacyInterventionScreen extends StatefulWidget { + final OutPatientFilterType outPatientFilterType; + + const PharmacyInterventionScreen({ + Key key, + this.outPatientFilterType, + }) : super(key: key); + + @override + _PharmacyInterventionScreenState createState() => + _PharmacyInterventionScreenState(); +} + +class _PharmacyInterventionScreenState + extends State { + @override + void initState() { + // TODO: implement initState + super.initState(); + } + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) + ? "" + : TranslationBase.of(context).pharmacyIntervention, + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, + model, + firstDate: DateTime( + DateTime.now().year - 20, + DateTime.now().month, + DateTime.now().day), + lastDate: DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day + 100), + selectedDate: model.selectedFromDate != null + ? model.selectedFromDate + : DateTime.now(), + ), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).fromDate, + "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}" + , + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, + model, + isFromDate: false, + firstDate: DateTime( + DateTime.now().year - 20, + DateTime.now().month, + DateTime.now().day), + lastDate: DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day + 100), + selectedDate: model.selectedToDate != null + ? model.selectedToDate + : DateTime.now().add(Duration(days: 1)), + ), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).toDate, + "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}" + , + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + 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, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).search, + padding: 5, + color: AppGlobal.appGreenColor, + onPressed: () async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InterventionMedicationScreen( + patient, + previousModel: model, + )), + ); + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ))); + } + + selectDate(BuildContext context, InterventionMedicationViewModel model, + {bool isFromDate = true, + DateTime firstDate, + lastDate, + selectedDate}) async { + Helpers.hideKeyboard(context); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: firstDate, + lastDate: lastDate, + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null) { + if (isFromDate) { + setState(() { + model.selectedFromDate = picked; + var date = picked.add(Duration(days: 1)); + if (date.isBefore(lastDate)) { + model.selectedToDate = date; + } else + model.selectedToDate = lastDate; + }); + } else { + setState(() { + model.selectedToDate = picked; + }); + } + } + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } +} diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..c3aab3f4 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index 50585143..c6f96dde 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -51,44 +51,44 @@ class _OutPatientPrescriptionDetailsItemState !_showDetails ? Container() : AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - Divider( - color: Color(0xFF000000), - height: 0.5, - ), - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), + duration: Duration(milliseconds: 200), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + ), + children: [ + buildTableRow( + key: 'Route', + des: widget.prescriptionReport.route), + buildTableRow( + key: 'Frequency Timing', + des: widget.prescriptionReport.frequency), + buildTableRow(key: 'Insurance Covered', des: ''), + buildTableRow( + key: 'Duration Days', + des: widget.prescriptionReport.days), + buildTableRow( + key: 'IDoctor Remarks', + des: widget.prescriptionReport.remarks), + ], + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + ], ), - children: [ - buildTableRow( - key: 'Route', - des: widget.prescriptionReport.route), - buildTableRow( - key: 'Frequency Timing', - des: widget.prescriptionReport.frequency), - buildTableRow(key: 'Insurance Covered', des: ''), - buildTableRow( - key: 'Duration Days', - des: widget.prescriptionReport.days), - buildTableRow( - key: 'IDoctor Remarks', - des: widget.prescriptionReport.remarks), - ], - ), - Divider( - color: Color(0xFF000000), - height: 0.5, - ), - ], - ), - ) + ) ], ), ); @@ -115,7 +115,7 @@ class _OutPatientPrescriptionDetailsItemState Expanded( child: Container( margin: - EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), + EdgeInsets.only(left: 4, top: 2.5, right: 2.5, bottom: 2.5), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -135,4 +135,4 @@ class _OutPatientPrescriptionDetailsItemState ), ]); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/patient_profile_card_model.dart similarity index 100% rename from lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart rename to lib/screens/patients/profile/profile_screen/patient_profile_card_model.dart diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index a62fae57..a80c975b 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,14 +1,15 @@ 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/viewstate.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/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.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/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; @@ -17,7 +18,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -231,25 +232,27 @@ class _PatientProfileScreenState extends State top: 180, left: 20, right: 20, - child: Row( + child: Row( children: [ Expanded(child: Container()), if (patient.episodeNo == 0) AppButton( - loading: model.state== ViewState.BusyLocal, - disabled: model.state== ViewState.BusyLocal, - + loading: model.state == ViewState.BusyLocal, + disabled: + model.state == ViewState.BusyLocal, title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", color: isFromLiveCare || isInpatient - ? Colors.red.shade700 + ? AppGlobal.appRedColor : patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, + ? AppGlobal.appRedColor + : AppGlobal.appRedColor, fontColor: Colors.white, - vPadding: 8, + // vPadding: 8, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, - hPadding: 20, + hPadding: 25, fontWeight: FontWeight.normal, fontSize: 12, icon: SvgPicture.asset( @@ -260,7 +263,8 @@ class _PatientProfileScreenState extends State onPressed: () async { if ((isFromLiveCare && patient.appointmentNo != null) || - patient.patientStatusType == 43 || isInpatient ) { + patient.patientStatusType == 43 || + isInpatient) { createEpisode( patient: patient, model: model); } @@ -268,20 +272,25 @@ class _PatientProfileScreenState extends State ), if (patient.episodeNo != 0) AppButton( - loading: model.state== ViewState.BusyLocal, - disabled: model.state== ViewState.BusyLocal, - + loading: + model.state == ViewState.BusyLocal, + disabled: + model.state == ViewState.BusyLocal, title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: ((isInpatient) || isFromLiveCare) && model.state!= ViewState.BusyLocal - ? Colors.red.shade700 + color: ((isInpatient) || + isFromLiveCare) && + model.state != ViewState.BusyLocal + ? AppGlobal.appRedColor : patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, + ?AppGlobal.appRedColor + : AppGlobal.appRedColor, fontColor: Colors.white, - vPadding: 8, + // vPadding: 8, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, - hPadding: 20, + hPadding: 25, fontWeight: FontWeight.normal, fontSize: 12, icon: SvgPicture.asset( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 6dc954c3..d4c20025 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -1,9 +1,8 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -59,12 +58,19 @@ class ProfileGridForInPatient extends StatelessWidget { RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg', isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + 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).progress, TranslationBase.of(context).note, @@ -168,6 +174,20 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, ), + PatientProfileCardModel( + "VTE", + "Assessment", + VTE_ASSESSMENT, + 'assets/images/svgs/profile_screen/diabetic chart.svg', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + TranslationBase.of(context).pharmacy, + TranslationBase.of(context).intervention, + PHARMACY_INTERVENTION, + 'assets/images/svgs/profile_screen/medical report.svg', + isInPatient: isInpatient, + ), ]; return Padding( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 0c3da34b..b2f844dd 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -1,9 +1,8 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -33,43 +32,83 @@ class ProfileGridForOther extends StatelessWidget { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + 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', + 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', + 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', + 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, - ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', + 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, + 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', + 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', + 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', + 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, + 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', + 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)) + : patient.patientStatusType != 43 || + patient.appointmentNo == null), + if (isFromLiveCare || + (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, @@ -78,15 +117,21 @@ class ProfileGridForOther extends StatelessWidget { isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null - : patient.patientStatusType != 43 || 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', + 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), + : patient.patientStatusType != 43 || + patient.appointmentNo == null), ]; return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index cc738b17..8e54c8ca 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -1,9 +1,8 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -17,56 +16,108 @@ class ProfileGridForSearch extends StatelessWidget { String to; ProfileGridForSearch( - {Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to}) + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, + this.from, + this.to}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + 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', + 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', + 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', + 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, - ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', + 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, + 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', + 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', + 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/vital signs.svg', + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).service, + PATIENT_INSURANCE_APPROVALS_NEW, + 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), if (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: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).ucaf, + PATIENT_UCAF_REQUEST, + 'assets/images/svgs/profile_screen/UCAF.svg', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), if (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: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_PATIENT_TO_DOCTOR, + 'assets/images/svgs/profile_screen/refer patient.svg', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), if (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: patient.patientStatusType != 43 ? true : false), + PatientProfileCardModel( + TranslationBase.of(context).admission, + TranslationBase.of(context).request, + PATIENT_ADMISSION_REQUEST, + 'assets/images/svgs/profile_screen/admission req.svg', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), ]; - return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: GridView( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 1e742de9..bc9ec56a 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,13 +1,13 @@ 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/radiology_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.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:url_launcher/url_launcher.dart'; @@ -22,7 +22,12 @@ class RadiologyDetailsPage extends StatelessWidget { final bool isInpatient; RadiologyDetailsPage( - {Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); + {Key key, + this.finalRadiology, + this.patient, + this.patientType, + this.arrivalType, + this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -45,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget { ), isShowAppBar: true, baseViewModel: model, - body: SingleChildScrollView( + body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -94,19 +99,19 @@ class RadiologyDetailsPage extends StatelessWidget { height: 80, width: double.maxFinite, child: Container( - margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), - child: SecondaryButton( + margin: + EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), + child: AppButton( color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", - textColor: Color(0xffFFFFFF), - onTap: () async { + onPressed: () async { await locator().logEvent( eventCategory: "RadiologyDetailsPage", eventAction: "Open Radiology Image", ); launch(model.radImageURL); }, - label: TranslationBase.of(context).openRad, + title: TranslationBase.of(context).openRad, ), ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 958301fd..7aecef4d 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,13 +1,13 @@ 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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -17,6 +17,8 @@ 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(); @@ -45,7 +47,8 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - 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], @@ -63,7 +66,8 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && + patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -83,7 +87,8 @@ class _RadiologyHomePageState extends State { ], ), ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -103,7 +108,8 @@ class _RadiologyHomePageState extends State { ], ), ), - if ((patient.patientStatusType != null && patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { @@ -140,26 +146,43 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment + 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), ), )), @@ -167,19 +190,26 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, + doctorName: + model.radiologyList[index].doctorName, + profileUrl: + model.radiologyList[index].doctorImageURL, + invoiceNO: + '${model.radiologyList[index].invoiceNo}', + branch: + '${model.radiologyList[index].projectName}', + clinic: model + .radiologyList[index].clinicDescription, appointmentDate: - model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, + 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), ), @@ -190,22 +220,12 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && + patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Radiology Found'), - ) - ], - ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) ], ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index e7714074..d0a6e15e 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -38,7 +38,9 @@ class RadiologyReportScreen extends StatelessWidget { fontSize: 2.5 * SizeConfig.textMultiplier, ), ), - SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) + SizedBox( + height: MediaQuery.of(context).size.height * 0.13, + ) ], ), ), diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 15d176d0..835339ea 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -21,8 +21,6 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; -import 'ReplySummeryOnReferralPatient.dart'; - class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; @@ -38,15 +36,17 @@ class AddReplayOnReferralPatient extends StatefulWidget { : super(key: key); @override - _AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState(); + _AddReplayOnReferralPatientState createState() => + _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState extends State { +class _AddReplayOnReferralPatientState + extends State { bool isSubmitted = false; int replay = 1; int reject = 2; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); TextEditingController replayOnReferralController = TextEditingController(); @@ -54,7 +54,8 @@ class _AddReplayOnReferralPatientState extends State void initState() { requestPermissions(); super.initState(); - replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks ?? ""; + replayOnReferralController.text = + widget.myReferralInPatientModel.referredDoctorRemarks ?? ""; } @override @@ -86,7 +87,9 @@ class _AddReplayOnReferralPatientState extends State maxLines: 35, minLines: 25, hasBorder: true, - validationError: replayOnReferralController.text.isEmpty && isSubmitted + validationError: replayOnReferralController + .text.isEmpty && + isSubmitted ? TranslationBase.of(context).emptyMessage : null, ), @@ -146,18 +149,25 @@ class _AddReplayOnReferralPatientState extends State ); if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replayReferred( - replayOnReferralController.text.trim(), widget.myReferralInPatientModel, reject); - if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientReferralViewModel.error); + await widget.patientReferralViewModel + .replayReferred( + replayOnReferralController.text.trim(), + widget.myReferralInPatientModel, + reject); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Has been rejected"); + DrAppToastMsg.showSuccesToast( + "Has been rejected"); Navigator.of(context).pop(); Navigator.of(context).pop(); } } else { - Helpers.showErrorToast("You can't add empty reply"); + Helpers.showErrorToast( + "You can't add empty reply"); setState(() { isSubmitted = false; }); @@ -179,18 +189,25 @@ class _AddReplayOnReferralPatientState extends State }); if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replayReferred( - replayOnReferralController.text.trim(), widget.myReferralInPatientModel, replay); - if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientReferralViewModel.error); + await widget.patientReferralViewModel + .replayReferred( + replayOnReferralController.text.trim(), + widget.myReferralInPatientModel, + replay); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); } else { GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Reply Added Successfully"); + DrAppToastMsg.showSuccesToast( + "Your Reply Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); } } else { - Helpers.showErrorToast("You can't add empty reply"); + Helpers.showErrorToast( + "You can't add empty reply"); setState(() { isSubmitted = false; }); @@ -215,7 +232,8 @@ class _AddReplayOnReferralPatientState extends State 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, @@ -230,7 +248,7 @@ class _AddReplayOnReferralPatientState extends State void errorListener(SpeechRecognitionError error) {} void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -240,13 +258,13 @@ class _AddReplayOnReferralPatientState extends State } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - replayOnReferralController.text += reconizedWord + '\n'; + replayOnReferralController.text += recognizedWord + '\n'; }); } } diff --git a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart index 72bd6825..9af341b0 100644 --- a/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/ReplySummeryOnReferralPatient.dart @@ -2,19 +2,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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 ReplySummeryOnReferralPatient extends StatefulWidget { final MyReferralPatientModel referredPatient; final String doctorReply; @@ -42,13 +36,12 @@ class _ReplySummeryOnReferralPatientState body: Container( child: Column( children: [ - Expanded( child: SingleChildScrollView( child: Container( width: double.infinity, - margin: - EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: EdgeInsets.symmetric( + horizontal: 16, vertical: 16), padding: EdgeInsets.symmetric( horizontal: 16, vertical: 16), decoration: BoxDecoration( @@ -100,7 +93,9 @@ class _ReplySummeryOnReferralPatientState color: Colors.red[600], ), ), - SizedBox(width: 4,), + SizedBox( + width: 4, + ), Expanded( child: AppButton( onPressed: () {}, diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index bd349f0f..87fe16ba 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -110,7 +110,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referralPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referralPatient.referralStatus == 46 || referralPatient @@ -374,7 +374,6 @@ class MyReferralDetailScreen extends StatelessWidget { title: TranslationBase.of(context).accept, color: Color(0xFF4BA821), fontColor: Colors.white, - fontSize: 1.6, hPadding: 8, vPadding: 12, disabled: model.state == ViewState.Busy, @@ -401,7 +400,6 @@ class MyReferralDetailScreen extends StatelessWidget { title: TranslationBase.of(context).reject, color: AppGlobal.appRedColor, fontColor: Colors.white, - fontSize: 1.6, hPadding: 8, vPadding: 12, disabled: model.state == ViewState.Busy, diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index b2242ff7..1d633b48 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; import 'my-referral-patient-screen.dart'; class MyReferralInPatientScreen extends StatefulWidget { @@ -47,7 +48,8 @@ class _MyReferralInPatientScreenState extends State { if (patientType == PatientType.IN_PATIENT) { await model.getMyReferralPatientService(localBusy: true); } else { - await model.getMyReferralOutPatientService(localBusy: true); + await model.getMyReferralOutPatientService( + localBusy: true); } GifLoaderDialogUtils.hideDialog(context); }, @@ -56,23 +58,9 @@ class _MyReferralInPatientScreenState extends State { ), model.myReferralPatients.isEmpty ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) + child: ErrorMessage( + error: TranslationBase.of(context).referralEmptyMsg, + )) : Expanded( child: SingleChildScrollView( child: Container( @@ -94,8 +82,9 @@ class _MyReferralInPatientScreenState extends State { context, FadePage( page: MyReferralDetailScreen( - referralPatient: model - .myReferralPatients[index]), + referralPatient: + model.myReferralPatients[ + index]), ), ); } else { @@ -103,7 +92,8 @@ class _MyReferralInPatientScreenState extends State { context, FadePage( page: ReferralPatientDetailScreen( - model.myReferralPatients[index], + model.myReferralPatients[ + index], model), ), ); diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 2eefeb43..1813a6d2 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-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'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../../../../routes.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; class MyReferralPatientScreen extends StatelessWidget { @override @@ -20,23 +20,10 @@ class MyReferralPatientScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).referralEmptyMsg, + ))) : SingleChildScrollView( child: Container( margin: EdgeInsets.only(top: 70), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 59e58198..c620de1c 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,18 +1,16 @@ import 'dart:ui'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../util/tab_helper.dart'; import '../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; @@ -60,11 +58,11 @@ class _PatientReferralScreen extends State // backgroundColor: Colors.white, appBar: PreferredSize( preferredSize: - Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( - height: Helpers.getTabHeight(context), - color: Helpers.getBgTabColor(), + height: TabHelper.getTabHeight(context), + color: TabHelper.getBgTabColor(), child: Center( child: TabBar( isScrollable: false, @@ -74,31 +72,42 @@ class _PatientReferralScreen extends State indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), + EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - decoration: Helpers.getBoxTabsBoxDecoration( - isActive: index == 0, isFirst: true, projectViewModel:projectsProvider ), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: index == 0, + isFirst: true, + projectViewModel: projectsProvider), child: Center( - child: Helpers.getTabText(title:TranslationBase.of(context).myReferredPatient, isActive:index == 0 ) - ), + child: TabHelper.getTabText( + title: TranslationBase.of(context) + .myReferredPatient, + isActive: index == 0)), ), Center( child: Container( - decoration:Helpers.getBoxTabsBoxDecoration( - isActive: index == 1, isMiddle: true, projectViewModel:projectsProvider ), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: index == 1, + isMiddle: true, + projectViewModel: projectsProvider), child: Center( - child:Helpers.getTabText(title:TranslationBase.of(context).referral, isActive:index == 1 ) - ), + child: TabHelper.getTabText( + title: TranslationBase.of(context).referral, + isActive: index == 1)), ), ), Center( child: Container( - decoration:Helpers.getBoxTabsBoxDecoration( - isActive: index == 2, isLast: true, projectViewModel:projectsProvider ), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: index == 2, + isLast: true, + projectViewModel: projectsProvider), child: Center( - child: Helpers.getTabText(title:TranslationBase.of(context).discharged, isActive:index == 2 ), + child: TabHelper.getTabText( + title: TranslationBase.of(context).discharged, + isActive: index == 2), ), ), ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 41686ead..8b229479 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -49,7 +49,7 @@ class _PatientMakeInPatientReferralScreenState String doctorError; String frequencyError; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); @override @@ -88,7 +88,7 @@ class _PatientMakeInPatientReferralScreenState } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -98,14 +98,14 @@ class _PatientMakeInPatientReferralScreenState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - _remarksController.text += reconizedWord + '\n'; + _remarksController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); @@ -261,24 +261,23 @@ class _PatientMakeInPatientReferralScreenState attributeName: 'facilityName', attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getClinics( - _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } - }); + okFunction: (selectedValue) async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getClinics( + _selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } }, ); showDialog( @@ -316,25 +315,24 @@ class _PatientMakeInPatientReferralScreenState TranslationBase.of(context) .clinicSearch, okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedDoctor = null; - _selectedClinic = selectedValue; - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getClinicDoctors( - patient, - _selectedClinic['ClinicID'], - _selectedBranch['facilityId']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } - }); + okFunction: (selectedValue) async { + _selectedDoctor = null; + _selectedClinic = selectedValue; + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getClinicDoctors( + patient, + _selectedClinic['ClinicID'], + _selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } }, ); showDialog( @@ -517,7 +515,7 @@ class _PatientMakeInPatientReferralScreenState child: AppButton( title: TranslationBase.of(context).refer, fontWeight: FontWeight.w700, - color: Color(0XFF359846), + color: AppGlobal.appGreenColor, onPressed: () async { setState(() { if (_referTo == null) { diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index f9371834..c50769e6 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -3,13 +3,14 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -123,16 +124,18 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length - 1] .patientDetails .gender, - referredDate: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[0], - referredTime: model - .patientReferral[ - model.patientReferral.length - 1] - .referredOn - .split(" ")[1], + + ///TODO Elham* check this + // referredDate: model + // .patientReferral[ + // model.patientReferral.length - 1] + // .referredOn + // .split(" ")[0], + // referredTime: model + // .patientReferral[ + // model.patientReferral.length - 1] + // .referredOn + // .split(" ")[1], patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", isSameBranch: model @@ -173,54 +176,62 @@ class _PatientMakeReferralScreenState extends State { fontWeight: FontWeight.w700, color: HexColor("#359846"), onPressed: () async { - setState(() async { - await locator().logEvent( - eventCategory: "Refer Patient", - eventAction: "Submit Refer", - ); - if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; - } else { - branchError = null; - } - if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; - } else { - hospitalError = null; - } - if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; - } else { - clinicError = null; - } - if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; - } else { - doctorError = null; - } - }); + await locator().logEvent( + eventCategory: "Refer Patient", + eventAction: "Submit Refer", + ); + if (_referTo == null) { + branchError = + TranslationBase.of(context).fieldRequired; + } else { + branchError = null; + } + if (_selectedBranch == null) { + hospitalError = + TranslationBase.of(context).fieldRequired; + } else { + hospitalError = null; + } + if (_selectedClinic == null) { + clinicError = + TranslationBase.of(context).fieldRequired; + } else { + clinicError = null; + } + if (_selectedDoctor == null) { + doctorError = + TranslationBase.of(context).fieldRequired; + } else { + doctorError = null; + } + if (appointmentDate == null || _selectedBranch == null || _selectedClinic == null || _selectedDoctor == null || _remarksController.text == null) return; - model + GifLoaderDialogUtils.showMyDialog(context); + await model .makeReferral( patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], - _remarksController.text) - .then((_) { + _remarksController.text); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); - }); + } + }, ), ) @@ -308,20 +319,18 @@ class _PatientMakeReferralScreenState extends State { attributeName: 'facilityName', attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinics(_selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); + okFunction: (selectedValue) async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } }, ); showDialog( @@ -357,22 +366,20 @@ class _PatientMakeReferralScreenState extends State { usingSearch: true, hintSearchText: TranslationBase.of(context).clinicSearch, okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() async { - _selectedDoctor = null; - _selectedClinic = selectedValue; - GifLoaderDialogUtils.showMyDialog(context); - await model - .getClinicDoctors( - patient, - _selectedClinic['ClinicID'], - _selectedBranch['facilityId']) - .then((_) => - GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }); + okFunction: (selectedValue) async { + _selectedDoctor = null; + _selectedClinic = selectedValue; + GifLoaderDialogUtils.showMyDialog(context); + await model + .getClinicDoctors( + patient, + _selectedClinic['ClinicID'], + _selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } }, ); showDialog( diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index d88d5a95..464d8e49 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.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/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -23,7 +23,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { final MyReferralPatientModel referredPatient; final PatientReferralViewModel patientReferralViewModel; - ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); + ReferralPatientDetailScreen( + this.referredPatient, this.patientReferralViewModel); @override Widget build(BuildContext context) { @@ -54,7 +55,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Helpers.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -71,14 +73,18 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromReferralO(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model + .getPatientFromReferralO(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "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( @@ -95,14 +101,18 @@ class ReferralPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = model.getPatientFromReferralO(referredPatient); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model + .getPatientFromReferralO(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", "isInpatient": true, "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: Padding( @@ -137,7 +147,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", @@ -145,8 +156,12 @@ class ReferralPatientDetailScreen extends StatelessWidget { fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) - : referredPatient.referralStatus == 46 || referredPatient.referralStatus == 2 + ? AppGlobal.inProgressColor + : referredPatient.referralStatus == + 46 || + referredPatient + .referralStatus == + 2 ? AppGlobal.appGreenColor : Colors.red[700], ), @@ -162,23 +177,28 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), 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.5 * SizeConfig.textMultiplier, + fontSize: + 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: + 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -195,29 +215,35 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -225,22 +251,31 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), if (referredPatient.frequency != 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.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.frequencyDescription ?? '', + referredPatient + .frequencyDescription ?? + '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ), @@ -252,22 +287,29 @@ class ReferralPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != null + 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'); }, )) @@ -279,21 +321,26 @@ class ReferralPatientDetailScreen 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.5 * SizeConfig.textMultiplier, + fontSize: + 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.priorityDescription ?? '', + referredPatient.priorityDescription ?? + '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: + 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -302,24 +349,33 @@ class ReferralPatientDetailScreen 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.5 * SizeConfig.textMultiplier, + fontSize: + 1.5 * 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.6 * SizeConfig.textMultiplier, + fontSize: + 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -329,7 +385,8 @@ class ReferralPatientDetailScreen 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_up.png', height: 50, @@ -337,17 +394,26 @@ class ReferralPatientDetailScreen 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, height: 25, width: 30, errorBuilder: - (BuildContext context, Object exception, StackTrace stackTrace) { + (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text(''); }, )) @@ -363,22 +429,30 @@ class ReferralPatientDetailScreen 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.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * SizeConfig.textMultiplier, + fontSize: 1.5 * + SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient.referringClinicDescription, + referredPatient + .referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * SizeConfig.textMultiplier, + fontSize: 1.3 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -402,8 +476,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { children: [ Container( width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: + EdgeInsets.symmetric(horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -440,8 +516,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.referredDoctorRemarks.isNotEmpty) Container( width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), - padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + margin: + EdgeInsets.symmetric(horizontal: 16, vertical: 0), + padding: EdgeInsets.symmetric( + horizontal: 16, vertical: 16), decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, @@ -486,7 +564,6 @@ class ReferralPatientDetailScreen extends StatelessWidget { color: Colors.red[700], fontColor: Colors.white, fontWeight: FontWeight.w700, - fontSize: 1.8, hPadding: 8, vPadding: 12, onPressed: () async { @@ -500,8 +577,10 @@ class ReferralPatientDetailScreen extends StatelessWidget { widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, - isEdited: referredPatient.referredDoctorRemarks != null && - referredPatient.referredDoctorRemarks.isNotEmpty, + isEdited: + referredPatient.referredDoctorRemarks != null && + referredPatient + .referredDoctorRemarks.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 354ee04f..f1467f64 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart'; @@ -11,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; class ReferredPatientScreen extends StatefulWidget { @override @@ -47,30 +49,15 @@ class _ReferredPatientScreenState extends State { }, ), ), - model.listMyReferredPatientModel == null || - model.listMyReferredPatientModel.length == 0 - ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), - ) - : Expanded( + if (model.listMyReferredPatientModel == null || + model.listMyReferredPatientModel.length == 0) Center( + child: ErrorMessage( + error: TranslationBase.of(context).referralEmptyMsg, + )) else Expanded( child: SingleChildScrollView( // DoctorApplication.svc/REST/GtMyReferredPatient child: Container( + child: Column( children: [ ListView.builder( @@ -98,23 +85,30 @@ class _ReferredPatientScreenState extends State { referralStatusCode: model .getReferredPatientItem(index) .referralStatus, - patientName: - "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientGender: model .getReferredPatientItem(index) .gender, - referredDate: AppDateUtils - .convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "dd/MM/yyyy"), - referredTime: AppDateUtils - .convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "hh:mm a"), + referredDate: model.state == ViewState.BusyLocal ?"": + AppDateUtils.getDayMonthYearDateFormatted( + patientType == PatientType.IN_PATIENT? + AppDateUtils.getDateTimeFromServerFormat( + model.getReferredPatientItem(index).referralDate, + ):AppDateUtils.getDateTimeFromString( + model.getReferredPatientItem(index).referralDate, + ), + isMonthShort: true + ), + referredTime:model.state == ViewState.BusyLocal ?"":AppDateUtils.getHour( + patientType == PatientType.IN_PATIENT? + AppDateUtils.getDateTimeFromServerFormat( + model.getReferredPatientItem(index).referralDate, + ):AppDateUtils.getDateTimeFromString( + model.getReferredPatientItem(index).referralDate, + ), + // isMonthShort: true + ), patientID: "${model.getReferredPatientItem(index).patientID}", isSameBranch: model @@ -133,8 +127,8 @@ class _ReferredPatientScreenState extends State { doctorAvatar: model .getReferredPatientItem(index) .doctorImageURL, - referralDoctorName: - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + referralDoctorName: "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 21634d0f..518c9f9c 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -15,7 +15,6 @@ 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 { @@ -156,7 +155,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor : Colors.red[700], @@ -565,7 +564,6 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Colors.red[700], fontColor: Colors.white, fontWeight: FontWeight.w700, - fontSize: 1.8, hPadding: 8, vPadding: 12, disabled: referredPatient.referredDoctorRemarks == null diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 53447743..dc18fe9c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -4,12 +4,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/models/SOAP/PatchAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -118,9 +118,7 @@ class _AddAssessmentDetailsState extends State { heightFactor: 1, child: BaseView( onModelReady: (model) async { - model.callAddAssessmentLookupsServices(); - }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -218,8 +216,8 @@ class _AddAssessmentDetailsState extends State { ), ) : AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - onClick: model.listOfICD10 != null + height: Helpers.getTextFieldHeight(), + onClick: model.listOfICD10 != null ? () { setState(() { widget.mySelectedAssessment @@ -242,45 +240,39 @@ class _AddAssessmentDetailsState extends State { )), )), ), - - if(widget.mySelectedAssessment - .selectedICD != null) - Column( - children: [ - SizedBox( - height: 3, - ), - Container( - width: MediaQuery - .of(context) - .size - .width * 0.7, - child: AppText( - widget.mySelectedAssessment - .selectedICD.description + - (' (${widget.mySelectedAssessment - .selectedICD.code} )'), - color: Color(0xFF575757), - fontSize: 10, - fontWeight: FontWeight.w700, - letterSpacing: -0.4, - ), - ), - ], + if (widget.mySelectedAssessment.selectedICD != null) + Column( + children: [ + SizedBox( + height: 3, ), + Container( + width: + MediaQuery.of(context).size.width * 0.7, + child: AppText( + widget.mySelectedAssessment.selectedICD + .description + + (' (${widget.mySelectedAssessment.selectedICD.code} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + ], + ), SizedBox( height: 7, ), AppTextFieldCustom( height: Helpers.getTextFieldHeight(), - onClick: model.listOfDiagnosisCondition != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisCondition, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, - + selectedValue: widget.mySelectedAssessment + .selectedDiagnosisCondition, okFunction: (MasterKeyModel selectedValue) { setState(() { @@ -329,13 +321,13 @@ class _AddAssessmentDetailsState extends State { ), AppTextFieldCustom( height: Helpers.getTextFieldHeight(), - onClick: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisType, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, + selectedValue: widget.mySelectedAssessment + .selectedDiagnosisType, okFunction: (MasterKeyModel selectedValue) { setState(() { @@ -390,8 +382,12 @@ class _AddAssessmentDetailsState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), - + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightShort + ? 15 + : 10), ), ])), ), @@ -399,35 +395,34 @@ class _AddAssessmentDetailsState extends State { ), ), ), - bottomSheet: model.state == ViewState.Busy?Container(height: 0,): - - BottomSheetDialogButton( - label: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), - onTap: () async { - 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); - } - }, - ), + bottomSheet: model.state == ViewState.Busy + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: (widget.isUpdate + ? 'Update Assessment Details' + : 'Add Assessment Details'), + onTap: () async { + 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); + } + }, + ), ), ), ); @@ -470,7 +465,6 @@ class _AddAssessmentDetailsState extends State { } GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -478,7 +472,7 @@ class _AddAssessmentDetailsState extends State { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; - widget.addSelectedAssessment(mySelectedAssessment, isUpdate); + widget.addSelectedAssessment(mySelectedAssessment, isUpdate); Navigator.of(context).pop(); } } diff --git a/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart b/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart index 331b2d15..0119b076 100644 --- a/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart +++ b/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart @@ -1,3 +1,3 @@ -abstract class AssessmentCallBack{ - nextFunction(model); -} \ No newline at end of file +abstract class AssessmentCallBack { + nextFunction(model); +} diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 80cdc34c..22a32070 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -3,10 +3,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.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/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; @@ -56,7 +55,7 @@ class _UpdateAssessmentPageState extends State model.setAssessmentCallBack(this); mySelectedAssessmentList.clear(); - await model.onUpdateAssessmentStepStart(widget.patientInfo); + await model.onUpdateAssessmentStepStart(widget.patientInfo); if (model.patientAssessmentList.isNotEmpty) { model.patientAssessmentList.forEach((element) { @@ -143,318 +142,327 @@ class _UpdateAssessmentPageState extends State return Container( margin: EdgeInsets.only( left: 5, right: 5, top: 15, bottom: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + child: Column( children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Row( + children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - ""), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 5, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - ), - children: [ - new TextSpan( - text: assessment - .selectedICD.description - .toString(), - ), - ], - ), - ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( + RichText( + text: new TextSpan( + style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + .getTextMultiplierBasedOnWidth() * + 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - letterSpacing: -0.4, - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment.appointmentId - .toString() ?? - "", - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), - ), - ], - ), + new TextSpan( + text: assessment + .selectedICD.code + .trim() + .toUpperCase() ?? + ""), + ], ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), + ), + 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, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + children: [ + new TextSpan( + text: assessment + .selectedICD.description + .toString(), + ), + ], ), ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, + ), + RichText( + text: new TextSpan( style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), + 3.5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, ), - ), - ], - ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( + children: [ + new TextSpan( + text: TranslationBase.of( context) - .dType + - ' : ', - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), - ), + .appointmentNo, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: assessment.appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, + ), + RichText( + text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), - ), - ], - ), - ), - if (assessment.doctorName != null) - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .doctor + - ' : ', - style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * 3, - letterSpacing: -0.4, - color: Color(0xFF575757), + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: - assessment.doctorName ?? - '', - style: new TextStyle( + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + 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, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), ), - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .doctor + + ' : ', + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: + assessment.doctorName ?? + '', + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), 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), - RemarkText( - remark: assessment.remark ?? "", - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( + Row( + mainAxisAlignment: + MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.end, + CrossAxisAlignment.start, children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + SizedBox( + height: 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, + (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 ?? "", ), ], ), ], ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, + ), + ) + ], ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, - size: 18, - ), - ) ], ), ], diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 42b94656..59bf42c7 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.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_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -14,7 +14,7 @@ import 'examinations_list_search_widget.dart'; class AddExaminationPage extends StatefulWidget { final List mySelectedExamination; - final Function (List)addSelectedExamination; + final Function(List) addSelectedExamination; final Function(MasterKeyModel) removeExamination; AddExaminationPage( @@ -79,13 +79,13 @@ class _AddExaminationPageState extends State { isServiceSelected(master), removeExamination: (selectedExamination) { setState(() { - mySelectedExaminationLocal.remove(selectedExamination); + mySelectedExaminationLocal + .remove(selectedExamination); }); }, addExamination: (selectedExamination) { - - mySelectedExaminationLocal - .insert(0, selectedExamination); + mySelectedExaminationLocal.insert( + 0, selectedExamination); // setState(() {}); }, ), @@ -105,7 +105,8 @@ class _AddExaminationPageState extends State { : BottomSheetDialogButton( label: "${TranslationBase.of(context).addExamination}", onTap: () { - widget.addSelectedExamination(mySelectedExaminationLocal); + widget + .addSelectedExamination(mySelectedExaminationLocal); }, ), )); diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index c9202e52..fa174f42 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -1,8 +1,8 @@ // ignore: must_be_immutable import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; @@ -66,27 +66,28 @@ class _AddExaminationWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: (){ + onTap: () { onExamTap(); }, child: Row( children: [ Checkbox( - value:widget.isServiceSelected(widget.item), + value: widget.isServiceSelected(widget.item), activeColor: Colors.red[800], onChanged: (bool newValue) { onExamTap(); }), Container( child: AppText( - projectViewModel.isArabic - ? widget.item.nameAr != null && widget.item.nameAr != "" - ? widget.item.nameAr - : widget.item.nameEn - : widget.item.nameEn, - + projectViewModel.isArabic + ? widget.item.nameAr != null && + widget.item.nameAr != "" + ? widget.item.nameAr + : widget.item.nameEn + : widget.item.nameEn, color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3 : 3.8), letterSpacing: -0.56, ), ), @@ -265,22 +266,21 @@ class _AddExaminationWidgetState extends State { ); } - onExamTap(){ - setState(() { - if (widget.isServiceSelected(widget.item)) { - if (examination.isLocal) - widget.removeExamination(examination); - widget.expandClick(); - } else { - examination.isNormal = status == 1; - examination.isAbnormal = status == 2; - examination.notExamined = status == 3; - examination.remark = remarksController.text; - widget.addExamination(examination); - widget.expandClick(); - } - }); - } + onExamTap() { + setState(() { + if (widget.isServiceSelected(widget.item)) { + if (examination.isLocal) widget.removeExamination(examination); + widget.expandClick(); + } else { + examination.isNormal = status == 1; + examination.isAbnormal = status == 2; + examination.notExamined = status == 3; + examination.remark = remarksController.text; + widget.addExamination(examination); + widget.expandClick(); + } + }); + } MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { Iterable exam = widget.mySelectedExamination.where( diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 89691cf2..193aea9d 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index c041b545..edc3dcce 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; @@ -13,13 +13,14 @@ class ExaminationsListSearchWidget extends StatefulWidget { final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; - final List mySelectedExamination; + final List mySelectedExamination; ExaminationsListSearchWidget( {this.removeExamination, this.addExamination, this.isServiceSelected, - this.masterList, this.mySelectedExamination}); + this.masterList, + this.mySelectedExamination}); @override _ExaminationsListSearchWidgetState createState() => @@ -47,7 +48,6 @@ class _ExaminationsListSearchWidgetState hintText: TranslationBase.of(context).searchExamination, isTextFieldHasSuffix: true, hasBorder: false, - controller: filteredSearchController, onChanged: (value) { filterSearchResults(value); diff --git a/lib/screens/patients/profile/soap_update/objective/objective_call_back.dart b/lib/screens/patients/profile/soap_update/objective/objective_call_back.dart index 466f344e..402125af 100644 --- a/lib/screens/patients/profile/soap_update/objective/objective_call_back.dart +++ b/lib/screens/patients/profile/soap_update/objective/objective_call_back.dart @@ -1,3 +1,3 @@ -abstract class ObjectiveCallBack{ - nextFunction(model); -} \ No newline at end of file +abstract class ObjectiveCallBack { + nextFunction(model); +} diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index c4964975..0be5d2a6 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -108,8 +108,8 @@ class _UpdateObjectivePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex, + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, patientInfo: widget.patientInfo, ), ExpandableSOAPWidget( @@ -206,27 +206,33 @@ class _UpdateObjectivePageState extends State submitUpdateObjectivePage(SOAPViewModel model) async { if (mySelectedExamination.isNotEmpty) { - if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && + if (!model.isAddExamInProgress && + widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { Navigator.of(context).pop(); - }else{ + } else { widget.changeLoadingState(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); + new PostPhysicalExamRequestModel(); mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + if (postPhysicalExamRequestModel + .listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; + []; ListHisProgNotePhysicalExaminationVM - 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, + 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(), @@ -240,13 +246,13 @@ class _UpdateObjectivePageState extends State examinationType: exam.isNormal ? 1 : exam.isAbnormal - ? 2 - : 3, + ? 2 + : 3, examinationTypeName: exam.isNormal ? "Normal" : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", + ? 'AbNormal' + : "Not Examined", isNew: exam.isNew, ); if (widget.patientInfo.admissionNo != null && @@ -269,13 +275,13 @@ class _UpdateObjectivePageState extends State if (model.state == ViewState.ErrorLocal) { widget.changeLoadingState(false); Helpers.showErrorToast(model.error); - if(widget.patientInfo.admissionNo != null && + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); model.isAddExamInProgress = false; } } else { - if(widget.patientInfo.admissionNo != null && + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); widget.changeLoadingState(false); @@ -284,10 +290,8 @@ class _UpdateObjectivePageState extends State widget.changeLoadingState(true); widget.changePageViewIndex(2); } - } } - } else { Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } @@ -329,7 +333,7 @@ class _UpdateObjectivePageState extends State element.selectedExamination.id, orElse: () => null)) == null) { - mySelectedExamination.insert(0,element); + mySelectedExamination.insert(0, element); } }); diff --git a/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart b/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart index 14fef483..0a3efab0 100644 --- a/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart +++ b/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart @@ -1,3 +1,3 @@ -abstract class PlanCallBack{ - nextFunction(model); -} \ No newline at end of file +abstract class PlanCallBack { + nextFunction(model); +} diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 37a6096e..22f18b3e 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 6449913c..f66ef604 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -8,48 +8,45 @@ class SOAPOpenItems extends StatelessWidget { final String label; const SOAPOpenItems({Key key, this.onTap, this.label}) : super(key: key); + @override Widget build(BuildContext context) { - return InkWell( + return InkWell( onTap: onTap, child: Container( - padding: EdgeInsets.symmetric( - vertical: 8, horizontal: 8.0), + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8.0), margin: EdgeInsets.symmetric(vertical: 8), decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade400, width: 0.5), + border: Border.all(color: Colors.grey.shade400, width: 0.5), borderRadius: BorderRadius.all( Radius.circular(8), ), color: Colors.white, ), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "$label", - fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4.5, - fontWeight: FontWeight.w700, - color: Color(0xFF2E303A), - letterSpacing:-0.44 , - ), - AppText( - "${TranslationBase.of(context).searchHere}", - fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*3.5, - fontWeight: FontWeight.w500, - color: Color(0xFF575757), - letterSpacing:-0.56 , - ), - ], - )), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "$label", + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + letterSpacing: -0.44, + ), + AppText( + "${TranslationBase.of(context).searchHere}", + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + fontWeight: FontWeight.w500, + color: Color(0xFF575757), + letterSpacing: -0.56, + ), + ], + )), Icon( Icons.add_box_rounded, size: 28, @@ -61,6 +58,3 @@ class SOAPOpenItems extends StatelessWidget { ); } } - - - diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 8d29150e..7d9e3d82 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -8,7 +8,9 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ Key key, - this.currentIndex, this.changePageViewIndex, this.patientInfo, + this.currentIndex, + this.changePageViewIndex, + this.patientInfo, }) : super(key: key); final int currentIndex; @@ -21,19 +23,27 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15,), + SizedBox( + height: SizeConfig.isHeightVeryShort + ? 30 + : SizeConfig.isHeightShort + ? 35 + : 15, + ), AppText( TranslationBase.of(context).createNew, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3 : 4), fontWeight: FontWeight.w700, - letterSpacing:-0.72, + letterSpacing: -0.72, color: Color(0xFF2E303A), - ), - AppText(TranslationBase.of(context).episode, - fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8), + AppText( + TranslationBase.of(context).episode, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 6 : 8), fontWeight: FontWeight.bold, - letterSpacing:-1.44, + letterSpacing: -1.44, color: Color(0xFF2E303A), ), Container( @@ -45,8 +55,8 @@ class SOAPStepHeader extends StatelessWidget { ), ), SizedBox( - height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 1 : 2), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 1 : 2), ), ], ); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index 835dd225..440e1e3e 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -3,6 +3,8 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../../config/config.dart'; + class BottomSheetDialogButton extends StatelessWidget { final Function onTap; final String label; @@ -32,11 +34,8 @@ class BottomSheetDialogButton extends StatelessWidget { widthFactor: .80, child: Center( child: AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), title: label, - padding: 10, - color: Color(0xFF359846), + color: AppGlobal.appGreenColor, onPressed: onTap, ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index f5134c1c..ef7f246d 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -10,6 +10,7 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { final String title; double headerHeight = SizeConfig.heightMultiplier * 15; + @override Widget build(BuildContext context) { return Container( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index c1b2d443..e9164cdc 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -14,24 +14,28 @@ class ExpandableSOAPWidget extends StatelessWidget { final bool isRequired; const ExpandableSOAPWidget( - {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle, this.isRequired= true}) + {Key key, + this.isExpanded, + this.child, + this.onTap, + this.headerTitle, + this.isRequired = true}) : super(key: key); @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.symmetric(vertical: SizeConfig.isHeightVeryShort ?10:20, horizontal: 10), + padding: EdgeInsets.symmetric( + vertical: SizeConfig.isHeightVeryShort ? 10 : 20, horizontal: 10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), ), child: HeaderBodyExpandableNotifier( - headerWidget: InkWell( + headerWidget: InkWell( onTap: onTap, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -40,24 +44,32 @@ class ExpandableSOAPWidget extends StatelessWidget { onTap: onTap, child: Row( children: [ - AppText(headerTitle, - variant: isExpanded ? "bodyText" : '', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), - letterSpacing:-0.64, + AppText( + headerTitle, + variant: isExpanded ? "bodyText" : '', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isHeightVeryShort + ? 4.8 + : SizeConfig.isWidthLarge + ? 4 + : 5), + letterSpacing: -0.64, fontWeight: FontWeight.w700, - color: Color(0xFF2E303A),), - if(isRequired) - Icon( - FontAwesomeIcons.asterisk, - size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, - ) + color: Color(0xFF2E303A), + ), + if (isRequired) + Icon( + FontAwesomeIcons.asterisk, + size: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + ) ], ), ), InkWell( onTap: onTap, - child: Icon( - isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline), + child: Icon(isExpanded + ? EvaIcons.arrowIosUpwardOutline + : EvaIcons.arrowIosDownwardOutline), ) ], ), @@ -67,4 +79,4 @@ class ExpandableSOAPWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart index 91ef6954..c3a66b77 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart @@ -1,11 +1,12 @@ - import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; class RemarkText extends StatelessWidget { - final String remark; + final String remark; + const RemarkText({ - Key key, this.remark, + Key key, + this.remark, }) : super(key: key); @override @@ -21,4 +22,4 @@ class RemarkText extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart index 1e5231c9..51384bdc 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -19,17 +18,17 @@ class RemoveButton extends StatelessWidget { children: [ Container( child: AppText( - label??TranslationBase.of(context).remove, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + label ?? TranslationBase.of(context).remove, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontWeight: FontWeight.w700, color: HexColor("#D02127"), - letterSpacing:-0.48, + letterSpacing: -0.48, ), ), Icon( FontAwesomeIcons.times, color: HexColor("#D02127"), - size: SizeConfig.getTextMultiplierBasedOnWidth() *4, + size: SizeConfig.getTextMultiplierBasedOnWidth() * 4, ), ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart index fb1bdcc9..75ec62f8 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart @@ -7,16 +7,17 @@ class StepDetailsWidget extends StatelessWidget { final double marginLeft; const StepDetailsWidget({ - Key key, this.stepLabel, this.marginLeft = 0, + Key key, + this.stepLabel, + this.marginLeft = 0, }) : super(key: key); @override Widget build(BuildContext context) { - return AppText( - stepLabel, + return AppText(stepLabel, fontWeight: FontWeight.bold, marginLeft: marginLeft, - fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, - ); + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, + ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart index 10562d53..95b3d061 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../../../config/config.dart'; + class StatusLabel extends StatelessWidget { const StatusLabel({ Key key, @@ -23,8 +25,8 @@ class StatusLabel extends StatelessWidget { color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < selectedStepId - ? Color(0xFFD8E8DB) - : Color(0xFFCCCCCC), + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), borderRadius: BorderRadius.all( Radius.circular(5.0), ), @@ -35,18 +37,18 @@ class StatusLabel extends StatelessWidget { stepId == selectedStepId ? TranslationBase.of(context).inProgress : stepId < selectedStepId - ? TranslationBase.of(context).completed - : TranslationBase.of(context).locked, + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId - ? Color(0xFF359846) - : Color(0xFF969696), + ? AppGlobal.appGreenColor + : Color(0xFF969696), ), ), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index e1c97d75..cb1cb2f1 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -1,12 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import '../../../../../../config/config.dart'; import 'Step_details_widget.dart'; class StepsWidget extends StatelessWidget { @@ -85,7 +86,7 @@ class StepsWidget extends StatelessWidget { color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -115,7 +116,7 @@ class StepsWidget extends StatelessWidget { Positioned( top: circleTop, left: patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty + patientInfo.admissionNo.isEmpty ? MediaQuery.of(context).size.width * 0.25 : MediaQuery.of(context).size.width * 0.71, child: InkWell( @@ -137,7 +138,7 @@ class StepsWidget extends StatelessWidget { color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -167,7 +168,7 @@ class StepsWidget extends StatelessWidget { ), ), if (patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty) + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, left: MediaQuery.of(context).size.width * 0.47, @@ -192,7 +193,7 @@ class StepsWidget extends StatelessWidget { color: index == 2 ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -222,7 +223,7 @@ class StepsWidget extends StatelessWidget { ), ), if (patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty) + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, right: 0, @@ -245,7 +246,7 @@ class StepsWidget extends StatelessWidget { color: index == 3 ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -288,8 +289,11 @@ class StepsWidget extends StatelessWidget { top: 30, child: Center( child: Container( - width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty?0.9:0.85), + width: MediaQuery.of(context).size.width * + (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty + ? 0.9 + : 0.85), child: Divider( color: Colors.grey, height: 0.75, @@ -320,7 +324,7 @@ class StepsWidget extends StatelessWidget { color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -348,8 +352,11 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: circleTop, - right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty?0.25:0.71), + right: MediaQuery.of(context).size.width * + (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty + ? 0.25 + : 0.71), child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -369,7 +376,7 @@ class StepsWidget extends StatelessWidget { color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -396,7 +403,7 @@ class StepsWidget extends StatelessWidget { ), ), if (patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty) + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, right: MediaQuery.of(context).size.width * 0.50, @@ -451,7 +458,7 @@ class StepsWidget extends StatelessWidget { ), ), if (patientInfo.admissionNo == null || - patientInfo.admissionNo.isEmpty) + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, left: 0, diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 6c5d4f02..29ed59d7 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -1,7 +1,7 @@ -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; class SoapUtils { static MySelectedHistory generateMySelectedHistory( @@ -36,7 +36,7 @@ class SoapUtils { static MySelectedExamination generateMySelectedExamination( {examination, allergySeverity, - isChecked = false, + isChecked = false, remark, isLocal = true, isNormal, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 60c43d00..6d8ff628 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -2,8 +2,8 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.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_dialog_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -186,4 +186,3 @@ class _AddAllergiesState extends State { } } } - diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 130e730d..72b198b6 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.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/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -84,7 +84,8 @@ class _AddAllergiesItemState extends State { : widget.item.nameEn : widget.item.nameEn, color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3:3.8), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3 : 3.8), letterSpacing: -0.56, ), width: MediaQuery.of(context).size.width * 0.55, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 8819f04a..3f00cbc8 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; @@ -10,7 +10,6 @@ import 'package:flutter/material.dart'; import 'allergies_item.dart'; - class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { final SOAPViewModel model; final Function() addSelectedAllergy; @@ -68,8 +67,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - hintText: - TranslationBase.of(context).selectAllergy, + hintText: TranslationBase.of(context).selectAllergy, isTextFieldHasSuffix: true, hasBorder: false, controller: filteredSearchController, @@ -95,14 +93,15 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: ListView.builder( itemCount: items.length, itemBuilder: (context, index) { - return AddAllergiesItem( - item:items[index], + item: items[index], model: widget.model, removeAllergy: widget.removeAllergy, - addAllergy:widget.addAllergy, - isServiceSelected: widget.isServiceSelected, - getServiceSelectedAllergy: widget.getServiceSelectedAllergy, + addAllergy: widget.addAllergy, + isServiceSelected: + widget.isServiceSelected, + getServiceSelectedAllergy: + widget.getServiceSelectedAllergy, ); }, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index c8a519c3..84bd1c9b 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -71,7 +71,9 @@ class _UpdateAllergiesWidgetState extends State { : TextDecoration.lineThrough, bold: true, color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 3.5, fontWeight: FontWeight.w700, letterSpacing: -0.48, // fontHeight:0.18 , @@ -87,7 +89,9 @@ class _UpdateAllergiesWidgetState extends State { ? null : TextDecoration.lineThrough, color: Color(0xFFCC9B14), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 3, fontWeight: FontWeight.w700, letterSpacing: -0.48, ), @@ -105,7 +109,9 @@ class _UpdateAllergiesWidgetState extends State { padding: const EdgeInsets.symmetric(vertical: 8), child: Row( children: [ - RemarkText(remark: selectedAllergy.remark,), + RemarkText( + remark: selectedAllergy.remark, + ), ], ), ), @@ -202,5 +208,3 @@ class _UpdateAllergiesWidgetState extends State { }); } } - - diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 0e5e6ec1..a1afa20f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -45,52 +45,44 @@ class UpdateChiefComplaints extends StatelessWidget { ? complaintsControllerError : null, ), - SizedBox( + SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, + hintText: TranslationBase.of(context).historyOfPresentIllness, controller: illnessController, inputType: TextInputType.multiline, - maxLines: 25, minLines: 7, hasBorder: true, - validationError: illnessControllerError != '' - ? illnessControllerError - : null, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget( - medicationController: medicationController, - ), - SizedBox( - height: 10, - ), + validationError: + illnessControllerError != '' ? illnessControllerError : null, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .currentMedications, + hintText: TranslationBase.of(context).currentMedications, controller: medicationController, maxLines: 25, minLines: 7, hasBorder: true, inputType: TextInputType.multiline, - validationError: medicationControllerError != '' ? medicationControllerError : null, - - ), - SizedBox( - height: 10, - ), - ]), + ), + SizedBox( + height: 10, + ), + ]), ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index b10d831d..9d6c5ddc 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.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_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 57698f56..cadab120 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -68,15 +68,21 @@ class _PriorityBarState extends State { : item, textAlign: TextAlign.center, style: TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 3.5, color: Colors.black, fontWeight: FontWeight.bold, ), ), ), ), - if(_isActive) - Container(width: 120,height: 4,color: AppGlobal.appRedColor,) + if (_isActive) + Container( + width: 120, + height: 4, + color: AppGlobal.appRedColor, + ) ], ), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index e00a83f5..e7438c65 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -67,7 +67,8 @@ class _UpdateHistoryWidgetState extends State ? null : TextDecoration.lineThrough, color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontWeight: FontWeight.w700, letterSpacing: -0.48, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 72330be3..f8c3527d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_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/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_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_dialog_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index c6427511..a8889849 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; @@ -22,11 +22,12 @@ class _UpdateMedicationWidgetState extends State { Widget build(BuildContext context) { return Column( children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addMedication}",onTap: () { - openMedicationList(context); - - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addMedication}", + onTap: () { + openMedicationList(context); + }, + ), SizedBox( height: 20, ) @@ -34,7 +35,6 @@ class _UpdateMedicationWidgetState extends State { ); } - openMedicationList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, @@ -49,6 +49,3 @@ class _UpdateMedicationWidgetState extends State { }); } } - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart index e8d0e11f..2736ff9f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart +++ b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart @@ -1,3 +1,3 @@ -abstract class SubjectiveCallBack{ +abstract class SubjectiveCallBack { Function nextFunction(model); -} \ No newline at end of file +} diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index fd5e6b45..075126fb 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.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/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index a6740a2c..acd1e827 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.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/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -57,17 +57,16 @@ class _UpdateSoapIndexState extends State }); } - void changeStateFun(){ - setState(() { - - }); + void changeStateFun() { + setState(() {}); } + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( - builder: (_,model,w)=>AppScaffold( + builder: (_, model, w) => AppScaffold( isLoading: _isLoading, isShowAppBar: true, appBar: PatientProfileAppBar(patient), @@ -127,35 +126,37 @@ class _UpdateSoapIndexState extends State ], ), ), - bottomSheet:_isLoading?Container(height: 0,): Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10), - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: getBottomSheet(model, patient) + bottomSheet: _isLoading + ? Container( + height: 0, + ) + : Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: getBottomSheet(model, patient)), + ), + SizedBox( + height: 5, + ), + ], ), ), - SizedBox( - height: 5, - ), - ], - ), - ), - ), ); } @@ -168,9 +169,6 @@ class _UpdateSoapIndexState extends State child: AppButton( title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, color: Colors.red[700], onPressed: () async { model.nextOnSubjectPage(model); @@ -188,9 +186,9 @@ class _UpdateSoapIndexState extends State child: AppButton( title: TranslationBase.of(context).previous, color: Colors.grey[300], - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, + // height: SizeConfig.heightMultiplier * + // (SizeConfig.isHeightVeryShort ? 8 : 6), + // padding: 10, fontColor: Colors.black, fontWeight: FontWeight.w600, onPressed: () { @@ -204,12 +202,15 @@ class _UpdateSoapIndexState extends State Expanded( child: AppButton( title: patient.admissionNo != null && - patient.admissionNo.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next, + patient.admissionNo.isNotEmpty && + !model.isAddExamInProgress + ? TranslationBase.of(context).finish + : TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, + // height: SizeConfig.heightMultiplier * + // (SizeConfig.isHeightVeryShort ? 8 : 6), + // padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { await model.nextOnObjectivePage(model); @@ -231,9 +232,6 @@ class _UpdateSoapIndexState extends State title: TranslationBase.of(context).previous, color: Colors.grey[300], fontColor: Colors.black, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { @@ -249,12 +247,10 @@ class _UpdateSoapIndexState extends State title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, + disabled: model.state == ViewState.BusyLocal, onPressed: () async { - model.nextOnAssessmentPage(model); + model.nextOnAssessmentPage(model); }, ), ), @@ -270,16 +266,13 @@ class _UpdateSoapIndexState extends State children: [ Expanded( child: AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, title: TranslationBase.of(context).previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - changePageViewIndex(2); + changePageViewIndex(2); }, ), ), @@ -288,9 +281,7 @@ class _UpdateSoapIndexState extends State ), Expanded( child: AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, + title: model.isAddProgress ? TranslationBase.of(context).next : TranslationBase.of(context).finish, @@ -298,7 +289,7 @@ class _UpdateSoapIndexState extends State color: Colors.red[700], disabled: model.progressNoteText.isEmpty, onPressed: () async { - model.nextOnPlanPage(model); + model.nextOnPlanPage(model); }, ), ), diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 564c8c2c..d1fcfef1 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,9 +1,9 @@ -import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; @@ -16,8 +16,8 @@ class LineChartCurved extends StatelessWidget { List yAxixs = List(); // DateFormat format = DateFormat("yyyy-MM-dd"); - DateFormat yearFormat = DateFormat("yyyy/MMM"); - DateFormat monthFormat = DateFormat("MMM"); + DateFormat yearFormat = DateFormat("yyyy/MMM/dd"); + DateFormat monthFormat = DateFormat("dd/MMM"); bool isDatesSameYear = true; @override @@ -96,6 +96,7 @@ class LineChartCurved extends StatelessWidget { } } + LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( @@ -110,10 +111,12 @@ class LineChartCurved extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontSize: 10, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, rotateAngle: -65, //rotateAngle:-65, margin: 22, @@ -160,30 +163,25 @@ class LineChartCurved extends StatelessWidget { return ''; }, ), - leftTitles: SideTitles( - showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), - getTitles: (value) { - // if (timeSeries.length < 10) { - // return '${value.toInt()}'; - // } else { - // if (value == getMinY()) - // return '${value.toInt()}'; - // if (value == getMaxY()) + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval:getInterval(), + + // getTitles: (value) { + // if (value.toInt() == 0) // return '${value.toInt()}'; - // if (yAxixs.contains(value)) { + // else if (value.toInt() % horizontalInterval == 0) // return '${value.toInt()}'; - // } - // return ''; - // } - return '${value.toInt()}'; - }, - margin: 12, - ), + // else + // return ''; + // }, + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -205,12 +203,44 @@ class LineChartCurved extends StatelessWidget { ), minX: 0, maxX: (timeSeries.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: getMinY(), + maxY: getMaxY() + getInterval(), + minY: 0, lineBarsData: getData(context), ); } + // double getMaxY() { + // double max = 0; + // timeSeries.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // + // return max.roundToDouble(); + // } + // + // double getMinY() { + // double min = timeSeries[0].sales; + // timeSeries.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // int value = min.toInt(); + // + // return value.toDouble(); + // } + + + double getInterval(){ + + return getMaxY() - getMinY() <= 100 + ? 20 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200; + + } + double getMaxY() { double max = 0; timeSeries.forEach((element) { diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 1c387c9a..a84cd045 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -13,7 +13,11 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final bool isOX; LineChartCurvedBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); + {this.title, + this.timeSeries1, + this.indexes, + this.timeSeries2, + this.isOX = false}); List xAxixs = List(); List yAxixs = List(); @@ -43,7 +47,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -79,22 +82,30 @@ class LineChartCurvedBloodPressure extends StatelessWidget { shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), ), - SizedBox(width: 5,), - AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) + SizedBox( + width: 5, + ), + AppText( + isOX ? "SAO2" : TranslationBase.of(context).systolicLng) ], ), - SizedBox(width: 15,), + SizedBox( + width: 15, + ), Row( children: [ Container( width: 20, height: 20, decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.red), + shape: BoxShape.rectangle, color: Colors.red), + ), + SizedBox( + width: 5, ), - SizedBox(width: 5,), - AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) + AppText( + isOX ? "FIO2" : TranslationBase.of(context).diastolicLng, + ) ], ), ], @@ -128,10 +139,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( - color: Colors.black, - fontSize: 10, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, rotateAngle: -65, //rotateAngle:-65, margin: 22, @@ -155,11 +168,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( + getTextStyles: (cxt, value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 10, ), + interval:getInterval(), getTitles: (value) { return '${value.toInt()}'; }, @@ -185,23 +199,31 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: getMinY(), + maxX: 0, + maxY: getMaxY() + getInterval(), + minY: 0, lineBarsData: getData(context), ); } + double getInterval(){ + + return getMaxY() - getMinY() <= 100 + ? 20 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200; + + } + + + double getMaxY() { double max = 0; timeSeries1.forEach((element) { double resultValueDouble = element.sales; if (resultValueDouble > max) max = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble > max) max = resultValueDouble; - }); return max.roundToDouble(); } @@ -212,15 +234,39 @@ class LineChartCurvedBloodPressure extends StatelessWidget { double resultValueDouble = element.sales; if (resultValueDouble < min) min = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble < min) min = resultValueDouble; - }); - int value = min.toInt(); return value.toDouble(); } + // double getMaxY() { + // double max = 0; + // timeSeries1.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // + // return max.roundToDouble(); + // } + // + // double getMinY() { + // double min = timeSeries1[0].sales; + // timeSeries1.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // + // int value = min.toInt(); + // + // return value.toDouble(); + // } List getData(context) { List spots = List(); @@ -261,10 +307,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ); List lineChartData = List(); - if(spots.isNotEmpty){ + if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } - if(spots2.isNotEmpty){ + if (spots2.isNotEmpty) { lineChartData.add(lineChartBarData2); } return lineChartData; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index 146a8ddb..f4ea6d75 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -79,20 +79,26 @@ class VitalSignDetailPainScale extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.only(left: 8), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Expanded( flex: 2, child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Container( child: AppText( - TranslationBase.of(context).painScale, - fontSize: SizeConfig.textMultiplier * 1.5, + TranslationBase.of(context) + .painScale, + fontSize: + SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, ), @@ -105,7 +111,9 @@ class VitalSignDetailPainScale extends StatelessWidget { "${vitalList[index].painScoreDesc ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.3, + fontSize: + SizeConfig.textMultiplier * + 1.3, ), ), ), @@ -119,7 +127,8 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: AppText( "Location", - fontSize: SizeConfig.textMultiplier * 1.5, + fontSize: + SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, ), @@ -132,7 +141,9 @@ class VitalSignDetailPainScale extends StatelessWidget { "${vitalList[index].painLocation ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.3, + fontSize: + SizeConfig.textMultiplier * + 1.3, ), ), ), @@ -144,8 +155,9 @@ class VitalSignDetailPainScale extends StatelessWidget { Expanded( child: Container( child: AppText( - "Character", - fontSize: SizeConfig.textMultiplier * 1.5, + "Character", + fontSize: + SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, ), @@ -158,7 +170,9 @@ class VitalSignDetailPainScale extends StatelessWidget { "${vitalList[index].painCharacter ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.3, + fontSize: + SizeConfig.textMultiplier * + 1.3, ), ), ), @@ -171,7 +185,8 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: AppText( "Duration", - fontSize: SizeConfig.textMultiplier * 1.5, + fontSize: + SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, ), @@ -184,7 +199,9 @@ class VitalSignDetailPainScale extends StatelessWidget { "${vitalList[index].painDuration ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.3, + fontSize: + SizeConfig.textMultiplier * + 1.3, ), ), ), @@ -196,8 +213,10 @@ class VitalSignDetailPainScale extends StatelessWidget { Expanded( child: Container( child: AppText( - TranslationBase.of(context).painManagement, - fontSize: SizeConfig.textMultiplier * 1.5, + TranslationBase.of(context) + .painManagement, + fontSize: + SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, ), @@ -210,7 +229,9 @@ class VitalSignDetailPainScale extends StatelessWidget { "${vitalList[index].isPainManagementDone ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.3, + fontSize: + SizeConfig.textMultiplier * + 1.3, ), ), ), @@ -223,7 +244,8 @@ class VitalSignDetailPainScale extends StatelessWidget { child: Container( child: AppText( "Frequency", - fontSize: SizeConfig.textMultiplier * 1.5, + fontSize: + SizeConfig.textMultiplier * 1.5, color: Color(0XFF28353E), fontWeight: FontWeight.w600, ), @@ -236,7 +258,9 @@ class VitalSignDetailPainScale extends StatelessWidget { "${vitalList[index].painFrequency ?? "-"}", fontWeight: FontWeight.w700, color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.3, + fontSize: + SizeConfig.textMultiplier * + 1.3, ), ), ), @@ -248,13 +272,24 @@ class VitalSignDetailPainScale extends StatelessWidget { ), Expanded( child: Container( - padding: EdgeInsets.all(8), + padding: EdgeInsets.symmetric(horizontal: 8), child: Center( - child: AppText( - "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", - fontWeight: FontWeight.w700, - color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.6, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + AppText( + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "hh:mm a")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 69f45d6e..5042f707 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -50,7 +50,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -65,7 +64,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -80,7 +78,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -96,7 +93,8 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: + BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 09694ad6..1bfe3643 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -3,12 +3,12 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; @@ -20,7 +20,8 @@ class VitalSignDetailsScreen extends StatelessWidget { int projectID; bool isNotOneAppointment; - VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); + VitalSignDetailsScreen( + {this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { @@ -35,7 +36,8 @@ class VitalSignDetailsScreen extends StatelessWidget { String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( - onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient), + onModelReady: (model) => + model.getPatientVitalSignHistory(patient, from, to, isInpatient), builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, @@ -74,7 +76,8 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.23, width: double.infinity, padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + margin: EdgeInsets.symmetric( + horizontal: 16.0, vertical: 8.0), decoration: BoxDecoration( shape: BoxShape.rectangle, color: Colors.white, @@ -98,13 +101,17 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png', - height: MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -112,28 +119,38 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, + fontSize: + SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, fontWeight: FontWeight.w700, ), AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, + fontSize: + SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, fontWeight: FontWeight.w700, ), ], )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', - height: MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -142,29 +159,40 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * + 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, ), ), AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', - height: MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -172,28 +200,38 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, + fontSize: + SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, ), AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, + fontSize: + SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -201,28 +239,38 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, ), AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Image.asset( mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context).size.height * 0.10, + height: MediaQuery.of(context) + .size + .height * + 0.10, ), const SizedBox( height: 4, @@ -232,17 +280,24 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * + 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, ), ), AppText( "(35<)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: + SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, ), ], )), @@ -254,7 +309,8 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), + margin: EdgeInsets.symmetric( + horizontal: 16.0, vertical: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -270,10 +326,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: TranslationBase.of(context).height, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Height, + pageTitle: + TranslationBase.of( + context) + .height, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -283,28 +345,40 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context).height, - imagePath: "${assetBasePath}height.png", + des: TranslationBase.of(context) + .height, + imagePath: + "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm, + unit: TranslationBase.of(context) + .cm, ), ), ), if (isNotOneAppointment) InkWell( onTap: () async { - await locator().logEvent( - eventCategory: "Vital Sign Details Screen", - eventAction: "Vital Sign Details", + await locator() + .logEvent( + eventCategory: + "Vital Sign Details Screen", + eventAction: + "Vital Sign Details", ); Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: TranslationBase.of(context).weight, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.Weight, + pageTitle: + TranslationBase.of( + context) + .weight, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -313,9 +387,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ); }, child: VitalSignItem( - des: TranslationBase.of(context).weight, - imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg, + des: TranslationBase.of(context) + .weight, + imagePath: + "${assetBasePath}weight.png", + unit: TranslationBase.of(context) + .kg, lastVal: mode.weightKg, ), ), @@ -324,10 +401,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: TranslationBase.of(context).temperature, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Temperature, + pageTitle: + TranslationBase.of( + context) + .temperature, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -337,10 +420,13 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context).temperature, - imagePath: "${assetBasePath}temperature.png", + des: TranslationBase.of(context) + .temperature, + imagePath: + "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC, + unit: TranslationBase.of(context) + .tempC, ), ), ), @@ -349,10 +435,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: TranslationBase.of(context).heart, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .heart, + pageTitle: + TranslationBase.of( + context) + .heart, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -361,10 +453,13 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).heart, - imagePath: "${assetBasePath}heart_rate.png", + des: TranslationBase.of(context) + .heart, + imagePath: + "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm, + unit: + TranslationBase.of(context).bpm, ), ), InkWell( @@ -372,10 +467,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: TranslationBase.of(context).respirationRate, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Respiration, + pageTitle: + TranslationBase.of( + context) + .respirationRate, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -384,10 +485,14 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).respirationRate, - imagePath: "${assetBasePath}respiration_rate.png", - lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context).respirationSigns, + des: TranslationBase.of(context) + .respirationRate, + imagePath: + "${assetBasePath}respiration_rate.png", + lastVal: + mode.respirationBeatPerMinute, + unit: TranslationBase.of(context) + .respirationSigns, ), ), InkWell( @@ -395,10 +500,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context).bloodPressure, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .BloodPressure, + pageTitle: + TranslationBase.of( + context) + .bloodPressure, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -407,10 +518,13 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure, - imagePath: "${assetBasePath}blood_pressure.png", + des: TranslationBase.of(context) + .bloodPressure, + imagePath: + "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias, + unit: TranslationBase.of(context) + .sysDias, ), ), InkWell( @@ -418,10 +532,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Oxygenation, - pageTitle: TranslationBase.of(context).oxygenation, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Oxygenation, + pageTitle: + TranslationBase.of( + context) + .oxygenation, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -430,8 +550,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).oxygenation, - imagePath: "${assetBasePath}oxg.png", + des: TranslationBase.of(context) + .oxygenation, + imagePath: + "${assetBasePath}oxg.png", lastVal: "${mode.oxygenation}%", unit: "", ), @@ -441,10 +563,16 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.PainScale, - pageTitle: TranslationBase.of(context).painScale, - vitalList: mode.patientVitalSignsHistory, + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .PainScale, + pageTitle: + TranslationBase.of( + context) + .painScale, + vitalList: mode + .patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -453,10 +581,13 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context).painScale, - imagePath: "${assetBasePath}painScale.png", + des: TranslationBase.of(context) + .painScale, + imagePath: + "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context).severe, + unit: TranslationBase.of(context) + .severe, ), ), ], diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index cec53580..37b1552b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -55,7 +55,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60, @@ -77,7 +76,6 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - fontFamily: 'Poppins', ), // height: 60 @@ -93,7 +91,8 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: + BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 0ed9da56..d0c13672 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.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-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -191,7 +191,8 @@ class VitalSignItemDetailsScreen extends StatelessWidget { backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, appBar: PatientProfileAppBar( - patient,), + patient, + ), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -202,7 +203,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, @@ -230,7 +231,8 @@ class VitalSignItemDetailsScreen extends StatelessWidget { } if (vitalListTemp.length != 0 && - chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { + chartInfo['viewKey'] == 'BloodPressure' || + chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, name: projectViewModel.isArabic @@ -243,8 +245,12 @@ class VitalSignItemDetailsScreen extends StatelessWidget { title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], - viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', - viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', + viewKey1: chartInfo['viewKey'] == 'BloodPressure' + ? 'BloodPressureHigher' + : 'SAO2', + viewKey2: chartInfo['viewKey'] == 'BloodPressure' + ? 'BloodPressureLower' + : 'FIO2', ); } diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index ef8049ce..c0db764c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -31,50 +31,49 @@ class VitalSingChartAndDetials extends StatelessWidget { generateData(); return timeSeriesData.length != 0 ? Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ), ), - child: LineChartCurved( - title: name, - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).graphDetails, - fontSize: SizeConfig.textMultiplier * 2.1, - fontWeight: FontWeight.bold, - - fontFamily: 'Poppins', - ), - SizedBox(height: 8,), - VitalSignDetailsWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - viewKey: viewKey, - ), - ], - ), - ), - /*AppExpandableNotifier( + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -84,9 +83,9 @@ class VitalSingChartAndDetials extends StatelessWidget { viewKey: viewKey, ), ),*/ - ], - ), - ) + ], + ), + ) : Container( width: double.infinity, height: MediaQuery.of(context).size.height, @@ -101,7 +100,7 @@ class VitalSingChartAndDetials extends StatelessWidget { vitalList.reversed.toList().forEach( (element) { DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey] != null && element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index d0416539..aac05ceb 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -47,7 +47,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, - isOX: title2=="SAO2", + isOX: title2 == "SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, @@ -116,21 +116,23 @@ class VitalSingChartBloodPressure extends StatelessWidget { vitalList.reversed.toList().forEach( (element) { DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey1]?.toInt() != 0) + AppDateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey1]?.toInt() != 0 && + element.toJson()[viewKey1]?.toInt() != null) timeSeriesData1.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.toJson()[viewKey1].toDouble(), + element.toJson()[viewKey1]?.toDouble(), ), ); - if (element.toJson()[viewKey2]?.toInt() != 0) + if (element.toJson()[viewKey2]?.toInt() != 0 && + element.toJson()[viewKey2]?.toInt() != null) timeSeriesData2.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.toJson()[viewKey2].toDouble(), + element.toJson()[viewKey2]?.toDouble(), ), ); }, diff --git a/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart b/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart new file mode 100644 index 00000000..e619185e --- /dev/null +++ b/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart @@ -0,0 +1,282 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/vte_assessment_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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class VteAssessmentScreen extends StatefulWidget { + const VteAssessmentScreen({Key key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => model.getVteAssessment(patientId: patient.patientId, + // admissionNo: 2016023498 + + admissionNo:int.parse(patient.admissionNo) + ), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.allVteHistoryList == null || + model.allVteHistoryList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allVteHistoryList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + model + .allVteHistoryList[ + index].riskScore, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .allVteHistoryList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromString(model + .allVteHistoryList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .allVteHistoryList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromString(model + .allVteHistoryList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .VTE_Type + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .vTEType, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .pharmacology + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .pharmacology, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .reasonsThrombo + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .reasonsThrombo, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Ambulation Protocol : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .ambulationProtocol, + fontSize: 12, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index 17405829..5a289bb8 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -9,7 +9,8 @@ class CustomEditableText extends StatefulWidget { Key key, @required this.controller, this.hint, - this.isEditable = false, this.isSubmitted, + this.isEditable = false, + this.isSubmitted, }) : super(key: key); final TextEditingController controller; @@ -27,7 +28,7 @@ class _CustomEditableTextState extends State { Widget build(BuildContext context) { return Column( children: [ - if(!widget.isEditable) + if (!widget.isEditable) Container( height: 60, decoration: BoxDecoration( @@ -62,7 +63,6 @@ class _CustomEditableTextState extends State { child: Icon( DoctorApp.edit_1, size: 20, - ), onTap: () { setState(() { @@ -74,17 +74,15 @@ class _CustomEditableTextState extends State { ), ), ), - if(widget.isEditable) + if (widget.isEditable) AppTextFieldCustom( hintText: widget.hint, //TranslationBase.of(context).addoperationReports, controller: widget.controller, - validationError: widget.controller - .text.isEmpty && - widget.isSubmitted - ? TranslationBase.of(context) - .emptyMessage - : null, + validationError: + widget.controller.text.isEmpty && widget.isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, maxLines: 1, minLines: 1, hasBorder: true, @@ -92,4 +90,4 @@ class _CustomEditableTextState extends State { ], ); } -} \ No newline at end of file +} diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index 6443e972..17bdac40 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -1,22 +1,12 @@ import 'package:doctor_app_flutter/config/config.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/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; -import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; -import 'package:doctor_app_flutter/core/model/note/note_model.dart'; -import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_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/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -25,17 +15,12 @@ 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/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; -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 'CustomEditableText.dart'; @@ -366,7 +351,6 @@ class _RegisterConfirmationPatientPageState borderColor: Color(0xFFeaeaea), color: Color(0xFFeaeaea), fontColor: Colors.black, - fontSize: 2.2, onPressed: () { Navigator.of(context).pop(); }, @@ -386,7 +370,6 @@ class _RegisterConfirmationPatientPageState borderColor: Color(0xFFB8382B), color: HexColor("#D02127"), fontColor: Colors.white, - fontSize: 2.0, onPressed: () async { setState(() { isSubmitted = true; diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index e7423f89..671511b9 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -9,7 +9,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'RegisterSearchPatientPage.dart'; @@ -143,7 +142,6 @@ class _RegisterPatientPageState extends State borderColor: Color(0xFFeaeaea), color: Color(0xFFeaeaea), fontColor: Colors.black, - fontSize: 2.2, onPressed: () { Navigator.of(context).pop(); }, @@ -160,10 +158,9 @@ class _RegisterPatientPageState extends State hasBorder: true, vPadding: 12, hPadding: 8, - borderColor: Color(0xFF359846), - color: Color(0xFF359846), + borderColor: AppGlobal.appGreenColor, + color: AppGlobal.appGreenColor, fontColor: Colors.white, - fontSize: 2.0, onPressed: () {}, ), ), @@ -186,7 +183,6 @@ class _RegisterPatientPageState extends State borderColor: Color(0xFFeaeaea), color: Color(0xFFeaeaea), fontColor: Colors.black, - fontSize: 2.2, onPressed: () { Navigator.of(context).pop(); }, @@ -206,7 +202,6 @@ class _RegisterPatientPageState extends State borderColor: Color(0xFFB8382B), color: AppGlobal.appRedColor, fontColor: Colors.white, - fontSize: 2.0, onPressed: () { changePageViewIndex(_currentIndex + 1); }, diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart index 69a2c643..f3ca4ea7 100644 --- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -1,30 +1,23 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/CalenderType.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; -import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; - -import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; - import 'package:doctor_app_flutter/util/translations_delegate_base.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/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; - import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/country_textfield_custom.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:hijri_picker/hijri_picker.dart'; -import 'package:doctor_app_flutter/core/enum/CalenderType.dart'; -import 'package:intl/intl.dart'; class RegisterSearchPatientPage extends StatefulWidget { final Function changePageViewIndex; @@ -291,8 +284,10 @@ class _RegisterSearchPatientPageState extends State { } else { _birthDateInGregorian = selectedDate; birthDateInHijri = HijriCalendar() - .gregorianToHijri(selectedDate.year, - selectedDate.month, selectedDate.day); + .gregorianToHijri( + selectedDate.year, + selectedDate.month, + selectedDate.day) as HijriCalendar; print(_birthDateInGregorian); print(birthDateInHijri); @@ -321,12 +316,11 @@ class _RegisterSearchPatientPageState extends State { child: AppButton( title: TranslationBase.of(context).cancel, hasBorder: true, - vPadding: 12, + // vPadding: 12, hPadding: 8, borderColor: Color(0xFFeaeaea), color: Color(0xFFeaeaea), fontColor: Colors.black, - fontSize: 2.2, onPressed: () { Navigator.of(context).pop(); }, @@ -341,12 +335,9 @@ class _RegisterSearchPatientPageState extends State { child: AppButton( title: TranslationBase.of(context).next, hasBorder: true, - vPadding: 12, - hPadding: 8, borderColor: Color(0xFFB8382B), color: AppGlobal.appRedColor, fontColor: Colors.white, - fontSize: 2.0, onPressed: () async { setState(() { isSubmitted = true; diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 9636f2ca..bfc8b035 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -1,9 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -440,7 +437,6 @@ class _ActivationPageState extends State { borderColor: Color(0xFFeaeaea), color: Color(0xFFeaeaea), fontColor: Colors.black, - fontSize: 2.2, onPressed: () { Navigator.of(context).pop(); }, @@ -460,7 +456,6 @@ class _ActivationPageState extends State { borderColor: Color(0xFFB8382B), color: HexColor("#D02127"), fontColor: Colors.white, - fontSize: 2.0, onPressed: () async { GifLoaderDialogUtils.showMyDialog(context); await widget.model.checkActivationCode( diff --git a/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart new file mode 100644 index 00000000..854ec4ae --- /dev/null +++ b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart @@ -0,0 +1,146 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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 'drug_to_drug.dart'; + +class AddDrugWidget extends StatefulWidget { + final PatiantInformtion patient; + final List prescriptionList; + final MedicineViewModel medicineModel; + final PrescriptionViewModel modelPrescription; + final dynamic units; + final dynamic route; + final dynamic frequency; + final dynamic duration; + final dynamic doseTime; + final dynamic uom; + final dynamic x; + final GetMedicationResponseModel selectedMedication; + final String strength; + final String indication; + final String instruction; + final DateTime selectedDate; + + const AddDrugWidget( + {Key key, + this.patient, + this.prescriptionList, + this.medicineModel, + this.modelPrescription, + this.units, + this.route, + this.frequency, + this.duration, + this.doseTime, + this.uom, + this.x, + this.selectedMedication, + this.strength, + this.indication, + this.instruction, + this.selectedDate}) + : super(key: key); + + @override + _AddDrugWidgetState createState() => _AddDrugWidgetState(); +} + +class _AddDrugWidgetState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + baseViewModel: widget.medicineModel, + appBar: + BottomSheetTitle(title: TranslationBase.of(context).addMedication), + body: Container( + height: SizeConfig.realScreenHeight * .8, + width: SizeConfig.realScreenWidth, + child: SingleChildScrollView( + child: Column( + children: [ + DrugToDrug( + widget.patient, + widget.medicineModel.getPrescriptionForDrug( + widget.prescriptionList, widget.medicineModel), + widget.medicineModel.patientAssessmentList), + ], + )), + ), + bottomSheet: widget.medicineModel.state == ViewState.BusyLocal || + widget.medicineModel.state == ViewState.Busy + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: TranslationBase.of(context).addMedication, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await widget.medicineModel.postPrescription( + isLocalBusy: true, + icdCode: widget.medicineModel.patientAssessmentList.isNotEmpty + ? widget.medicineModel.patientAssessmentList[0] + .icdCode10ID.isEmpty + ? "test" + : widget.medicineModel.patientAssessmentList[0] + .icdCode10ID + .toString() + : "test", + dose: widget.strength, + doseUnit: + widget.medicineModel.itemMedicineListUnit.length == 1 + ? widget.medicineModel + .itemMedicineListUnit[0]['parameterCode'] + .toString() + : widget.units['parameterCode'].toString(), + patient: widget.patient, + doseTimeIn: widget.doseTime['id'].toString(), + model: widget.modelPrescription, + duration: widget.duration['id'].toString(), + frequency: widget.medicineModel.itemMedicineList.length == 1 + ? widget + .medicineModel.itemMedicineList[0]['parameterCode'] + .toString() + : widget.frequency['parameterCode'].toString(), + route: widget.medicineModel.itemMedicineListRoute.length == 1 + ? widget.medicineModel + .itemMedicineListRoute[0]['parameterCode'] + .toString() + : widget.route['parameterCode'].toString(), + drugId: widget.selectedMedication.itemId.toString(), + strength: widget.strength, + indication: widget.indication, + instruction: widget.instruction, + doseTime: widget.selectedDate, + ); + if (widget.medicineModel.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(widget.medicineModel.error); + } else if (widget.modelPrescription.state == ViewState.Idle) { + await widget.modelPrescription.getPrescriptionListNew( + appNo: widget.patient.appointmentNo, + mrn: widget.patient.patientMRN, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).medicationHasBeenAdded); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }, + ), + ); + } +} diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart similarity index 66% rename from lib/screens/prescription/drugtodrug.dart rename to lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart index 15abfeb6..2ce61af0 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart @@ -4,13 +4,14 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.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/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; @@ -18,7 +19,9 @@ class DrugToDrug extends StatefulWidget { final PatiantInformtion patient; final prescription; final List listAssessment; + DrugToDrug(this.patient, this.prescription, this.listAssessment); + @override _DrugToDrug createState() => _DrugToDrug(); } @@ -26,6 +29,7 @@ class DrugToDrug extends StatefulWidget { class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; + /// TODO Elham* fix this List> expandableList = [ {'name': 'CRITICAL', 'level': 'LEVEL_4'}, {'name': 'HIGH', 'level': 'LEVEL_3'}, @@ -33,15 +37,10 @@ class _DrugToDrug extends State { {'name': 'LOW', 'level': 'LEVEL_1'}, {'name': 'INFO', 'level': 'INFO'}, ]; - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: 2954208, //widget.patient.patientMRN, - episodeId: 210011002, //widget.patient.episodeNo, - appointmentNo: 2016055308, //widget.patient.appointmentNo, - doctorID: '', - editedBy: ''); - VitalSignsViewModel model = new VitalSignsViewModel(); - SOAPViewModel model2 = new SOAPViewModel(); + + VitalSignsViewModel vitalSignsViewModel = new VitalSignsViewModel(); + SOAPViewModel soapViewModel = new SOAPViewModel(); @override void initState() { @@ -54,18 +53,18 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (model3) => model3.getDrugToDrug( - model.patientVitalSigns, + onModelReady: (prescriptionViewModel) => prescriptionViewModel.getDrugToDrug( + vitalSignsViewModel.patientVitalSigns, widget.listAssessment, - model2.patientAllergiesList, + soapViewModel.patientAllergiesList, widget.patient, widget.prescription), - builder: (BuildContext context, PrescriptionViewModel model3, + builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget child) => NetworkBaseView( - baseViewModel: model3, + baseViewModel: prescriptionViewModel, child: Container( - height: SizeConfig.realScreenHeight * .4, + height: SizeConfig.realScreenHeight * .9, child: new ListView.builder( itemCount: expandableList.length, itemBuilder: (context, i) { @@ -75,7 +74,7 @@ class _DrugToDrug extends State { ' ' + '(' + getDrugInfo(expandableList[i]['level'], - model3) + prescriptionViewModel) .length .toString() + ')', @@ -83,7 +82,7 @@ class _DrugToDrug extends State { fontWeight: FontWeight.bold, ), children: getDrugInfo( - expandableList[i]['level'], model3) + expandableList[i]['level'], prescriptionViewModel) .map((item) { return Container( padding: EdgeInsets.all(10), @@ -95,10 +94,8 @@ class _DrugToDrug extends State { })))) : Container( height: SizeConfig.realScreenHeight * .45, - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Colors.black), - ))); + child: GifLoaderContainer() + ); } getTypeID() async { @@ -109,17 +106,28 @@ class _DrugToDrug extends State { } getRequestedData() async { - await model.getPatientVitalSign(widget.patient); - await model2.getPatientAllergy(generalGetReqForSOAP); - await model2.getMasterLookup(MasterKeysService.DiagnosisType); - if (model.state == ViewState.Idle && model2.state == ViewState.Idle) { + + + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + /// TODO Elham* fix this today + patientMRN: widget.patient.patientMRN, + episodeId: widget.patient.episodeNo, + appointmentNo: + widget.patient.appointmentNo, + doctorID: '', + editedBy: ''); + + await vitalSignsViewModel.getPatientVitalSign(widget.patient); + await soapViewModel.getPatientAllergy(generalGetReqForSOAP); + await soapViewModel.getMasterLookup(MasterKeysService.DiagnosisType); + if (vitalSignsViewModel.state == ViewState.Idle && soapViewModel.state == ViewState.Idle) { setState(() { isLoaded = true; }); } } - List getDrugInfo(level, model3) { - return model3.drugToDrug.where((i) => i['Severity'] == level).toList(); + List getDrugInfo(level, prescriptionViewModel) { + return prescriptionViewModel.drugToDrug.where((i) => i['Severity'] == level).toList(); } } diff --git a/lib/screens/prescription/add_prescription/add_prescription.dart b/lib/screens/prescription/add_prescription/add_prescription.dart new file mode 100644 index 00000000..074a01fe --- /dev/null +++ b/lib/screens/prescription/add_prescription/add_prescription.dart @@ -0,0 +1,171 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/prescription_form_widget.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/search_preescription_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class AddPrescription extends StatefulWidget { + final PrescriptionViewModel prescriptionViewModel; + final PatiantInformtion patient; + final List prescriptionList; + + AddPrescription( + this.prescriptionViewModel, this.patient, this.prescriptionList); + + @override + _AddPrescriptionState createState() => _AddPrescriptionState(); +} + +class _AddPrescriptionState extends State { + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; + int selectedType; + + bool visibilitySearch = true; + + TextEditingController strengthController = TextEditingController(); + TextEditingController unitController = TextEditingController(); + TextEditingController indicationController = TextEditingController(); + TextEditingController instructionController = TextEditingController(); + + bool visibilityPrescriptionForm = false; + + final myController = TextEditingController(); + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; + MedicineViewModel medicineViewModel; + + GlobalKey key = + new GlobalKey>(); + + TextEditingController drugIdController = TextEditingController(); + TextEditingController doseController = TextEditingController(); + final searchController = TextEditingController(); + stt.SpeechToText speech = stt.SpeechToText(); + var event = RobotProvider(); + var recognizedWord; + + final GlobalKey formKey = GlobalKey(); + final double spaceBetweenTextFields = 12; + dynamic route; + dynamic frequency; + dynamic duration; + dynamic doseTime; + dynamic indication; + dynamic units; + dynamic uom; + dynamic box; + dynamic x; + + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: ( + BuildContext context, + MedicineViewModel model, + Widget child, + ) => + NetworkBaseView( + baseViewModel: model, + child: GestureDetector( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: DraggableScrollableSheet( + initialChildSize: 0.98, + maxChildSize: 0.98, + minChildSize: 0.9, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.65, + color: Color(0xffF8F8F8), + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), + child: Column( + children: [ + Column( + children: [ + SizedBox( + height: 60, + ), + ], + ), + SizedBox( + height: spaceBetweenTextFields, + ), + Container( + child: Column( + children: [ + Visibility( + visible: visibilitySearch, + child: SearchPrescriptionWidget( + spaceBetweenTextFields: + spaceBetweenTextFields, + medicineViewModel: model, + prescriptionViewModel: + widget.prescriptionViewModel, + onItemSelected: + (GetMedicationResponseModel + medication) async { + setState(() { + visibilitySearch = !visibilitySearch; + _selectedMedication = medication; + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getAssessmentList(patientInfo: widget.patient, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }, + + ), + ), + Visibility( + visible: !visibilitySearch, + child: Container( + child: Column( + children: [ + PrescriptionFormWidget( + patient: widget.patient, + prescriptionViewModel: + widget.prescriptionViewModel, + medicineViewModel: model, + prescriptionList: + widget.prescriptionList, + selectedMedication: _selectedMedication, + ), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart new file mode 100644 index 00000000..13ec5a15 --- /dev/null +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -0,0 +1,547 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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/speech-text-popup.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:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; +import '../../../widgets/transitions/slide_up_page.dart'; +import 'add_drug/add_drug_widget.dart'; + +class PrescriptionFormWidget extends StatefulWidget { + final PatiantInformtion patient; + final List prescriptionList; + final PrescriptionViewModel prescriptionViewModel; + final MedicineViewModel medicineViewModel; + final GetMedicationResponseModel selectedMedication; + + const PrescriptionFormWidget( + {Key key, + this.patient, + this.prescriptionList, + this.prescriptionViewModel, + this.medicineViewModel, + this.selectedMedication}); + + @override + _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); +} + +class _PrescriptionFormWidgetState extends State { + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; + + int selectedType; + + TextEditingController strengthController = TextEditingController(); + TextEditingController unitController = TextEditingController(); + TextEditingController indicationController = TextEditingController(); + TextEditingController instructionController = TextEditingController(); + + bool visibilityPrescriptionForm = false; + bool visibilitySearch = true; + + final myController = TextEditingController(); + DateTime selectedDate; + int strengthChar; + GlobalKey key = + new GlobalKey>(); + + TextEditingController drugIdController = TextEditingController(); + TextEditingController doseController = TextEditingController(); + final searchController = TextEditingController(); + stt.SpeechToText speech = stt.SpeechToText(); + var event = RobotProvider(); + var recognizedWord; + + final GlobalKey formKey = GlobalKey(); + final double spaceBetweenTextFields = 12; + dynamic route; + dynamic frequency; + dynamic duration; + dynamic doseTime; + dynamic units; + dynamic uom; + dynamic box; + dynamic x; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + 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); + if (available) { + speech.listen( + onResult: resultListener, + listenMode: stt.ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + print(error); + } + + void statusListener(String status) { + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; + } + + void resultListener(result) { + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); + + if (result.finalResult == true) { + setState(() { + SpeechToText.closeAlertDialog(context); + speech.stop(); + instructionController.text += recognizedWord + '\n'; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return Form( + key: formKey, + child: Column( + children: [ + AppText( + widget.selectedMedication?.description ?? "", + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 15.0, + ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + width: 6, + ), + AppText( + TranslationBase.of(context).orderType, + fontWeight: FontWeight.w500, + ), + SizedBox( + width: 18, + ), + Radio( + activeColor: AppGlobal.appRedColor, + value: 1, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + ], + ), + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: AppTextFieldCustom( + validationError: strengthError, + hintText: TranslationBase.of(context).strength, + isTextFieldHasSuffix: false, + enabled: true, + controller: strengthController, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 5) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .only5DigitsAllowedForStrength, + ); + } + }, + inputType: TextInputType.numberWithOptions( + decimal: true, + ), + ), + ), + SizedBox( + width: 5.0, + ), + PrescriptionTextFiled( + width: MediaQuery.of(context).size.width * 0.510, + element: + widget.medicineViewModel.itemMedicineListUnit.length == 1 + ? widget.medicineViewModel.itemMedicineListUnit[0] + : units, + elementError: unitError, + keyName: 'description', + keyId: 'parameterCode', + hintText: TranslationBase.of(context).unit, + elementList: widget.medicineViewModel.itemMedicineListUnit, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + units['isDefault'] = true; + }); + }, + ), + ], + ), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + elementList: widget.medicineViewModel.itemMedicineListRoute, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 + ? route = widget.medicineViewModel.itemMedicineListRoute[0] + : route, + elementError: routeError, + keyId: 'parameterCode', + keyName: 'description', + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + route['isDefault'] = true; + }); + }, + hintText: TranslationBase.of(context).route, + ), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + hintText: TranslationBase.of(context).frequency, + elementError: frequencyError, + // element: frequency, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 + ? frequency = widget.medicineViewModel.itemMedicineListRoute[0] + : frequency, + elementList: widget.medicineViewModel.itemMedicineList, + keyId: 'parameterCode', + keyName: 'description', + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + frequency['isDefault'] = true; + if (widget.selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + widget.medicineViewModel.getBoxQuantity( + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: widget.selectedMedication.itemId, + strength: double.parse(strengthController.text)); + + return; + } + }); + }), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + hintText: TranslationBase.of(context).doseTime, + elementError: doseTimeError, + element: doseTime, + elementList: widget.medicineViewModel.medicationDoseTimeList, + keyId: 'id', + keyName: 'nameEn', + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }), + SizedBox(height: spaceBetweenTextFields), + if (widget.medicineViewModel.patientAssessmentList.isNotEmpty) + Container( + height: screenSize.height * 0.070, + width: double.infinity, + color: Colors.white, + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: AppTextFieldCustom( + hintText: widget + .medicineViewModel.patientAssessmentList[0].icdCode10ID + .toString(), + enabled: true, + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.57, + color: Colors.white, + child: AppTextFieldCustom( + maxLines: 5, + hintText: widget + .medicineViewModel.patientAssessmentList[0].asciiDesc + .toString(), + enabled: true, + ), + ), + ], + ), + ), + SizedBox(height: spaceBetweenTextFields), Container( + color: Colors.transparent, + child: InkWell( + onTap: () => selectDate(context, widget.prescriptionViewModel), + child: AppTextFieldCustom( + validationError: strengthError, + hintText: TranslationBase.of(context).date, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.calendar_today, + color: Colors.black, + ), + ), + dropDownText: selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + enabled: false, + ), + ), + ), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + element: duration, + elementError: durationError, + hintText: TranslationBase.of(context).duration, + elementList: widget.medicineViewModel.medicationDurationList, + keyName: 'nameEn', + keyId: 'id', + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + if (widget.selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + box = widget.medicineViewModel.boxQuintity; + return; + } + }); + }, + ), + SizedBox(height: spaceBetweenTextFields), + Container( + color: Colors.white, + child: AppTextFieldCustom( + hintText: "UOM", + isTextFieldHasSuffix: false, + dropDownText: uom != null ? uom : null, + enabled: false, + ), + ), + SizedBox(height: spaceBetweenTextFields), + Container( + color: Colors.white, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).boxQuantity, + isTextFieldHasSuffix: false, + dropDownText: box != null + ? widget.medicineViewModel.boxQuintity.toString() + : null, + enabled: false, + ), + ), + SizedBox(height: spaceBetweenTextFields), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + child: Stack( + children: [ + TextFields( + maxLines: 6, + minLines: 4, + hintText: TranslationBase.of(context).instruction, + controller: instructionController, + ), + Positioned( + top: 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + size: 35, + ), + onPressed: () { + initSpeechState().then((value) => {onVoiceText()}); + }, + ), + ), + ], + ), + ), + SizedBox(height: spaceBetweenTextFields), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + color: Color(0xff359846), + title: TranslationBase.of(context).addMedication, + fontWeight: FontWeight.w600, + onPressed: () async { + addMedicationButton(widget.medicineViewModel); + }, + ), + ], + ), + ), + ], + ), + ); + } + + selectDate(BuildContext context, PrescriptionViewModel model) async { + Helpers.hideKeyboard(context); + DateTime selectedDate; + selectedDate = DateTime.now(); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != selectedDate) { + setState(() { + this.selectedDate = picked; + }); + } + } + + addMedicationButton(MedicineViewModel model) async { + await locator().logEvent( + eventCategory: "Add Prescription Form", + eventAction: "Add Prescription", + ); + if (duration != null && + doseTime != null && + frequency != null && + selectedDate != null && + strengthController.text != "") { + if (widget.selectedMedication.isNarcotic == true) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .narcoticMedicineCanOnlyBePrescribedFromVida); + Navigator.pop(context); + return; + } + + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).thousandIsTheMAXForTheStrength); + return; + } + if (double.parse(strengthController.text) < 0.0) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).strengthCanNotBeZero); + return; + } + + if (formKey.currentState.validate()) { + Navigator.push( + context, + SlideUpPageRoute( + widget: AddDrugWidget( + patient: widget.patient, + medicineModel: widget.medicineViewModel, + modelPrescription: widget.prescriptionViewModel, + prescriptionList: widget.prescriptionList, + route: route, + doseTime: doseTime, + duration: duration, + frequency: frequency, + units: units, + uom: uom, + x: x, + selectedMedication: widget.selectedMedication, + strength: strengthController.text, + indication: indicationController.text, + instruction: instructionController.text, + selectedDate: selectedDate, + ), + ), + ); + // Navigator.pop(context); + // openDrugToDrug(model, prescriptionViewModel); + } + } else { + setState(() { + if (duration == null) { + durationError = TranslationBase.of(context).fieldRequired; + } else { + durationError = null; + } + if (doseTime == null) { + doseTimeError = TranslationBase.of(context).fieldRequired; + } else { + doseTimeError = null; + } + if (route == null) { + routeError = TranslationBase.of(context).fieldRequired; + } else { + routeError = null; + } + if (frequency == null) { + frequencyError = TranslationBase.of(context).fieldRequired; + } else { + frequencyError = null; + } + if (units == null) { + unitError = TranslationBase.of(context).fieldRequired; + } else { + unitError = null; + } + if (strengthController.text == "") { + strengthError = TranslationBase.of(context).fieldRequired; + } else { + strengthError = null; + } + }); + } + formKey.currentState.save(); + } +} diff --git a/lib/screens/prescription/add_prescription/search_preescription_widget.dart b/lib/screens/prescription/add_prescription/search_preescription_widget.dart new file mode 100644 index 00000000..8adeddd4 --- /dev/null +++ b/lib/screens/prescription/add_prescription/search_preescription_widget.dart @@ -0,0 +1,137 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import '../../../config/config.dart'; +import '../../../core/model/search_drug/get_medication_response_model.dart'; +import '../../../core/viewModel/medicine_view_model.dart'; +import '../../../core/viewModel/prescription/prescription_view_model.dart'; +import '../../../util/helpers.dart'; +import '../../../util/translations_delegate_base.dart'; +import '../../../widgets/medicine/medicine_item_widget.dart'; +import '../../../widgets/shared/buttons/app_buttons_widget.dart'; +import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart'; +import '../../../widgets/shared/network_base_view.dart'; +import '../../../widgets/shared/text_fields/app_text_form_field.dart'; +import '../../base/base_view.dart'; + +final myController = TextEditingController(); + +class SearchPrescriptionWidget extends StatelessWidget { + final double spaceBetweenTextFields; + final MedicineViewModel medicineViewModel; + final PrescriptionViewModel prescriptionViewModel; + final Function(GetMedicationResponseModel) onItemSelected; + + const SearchPrescriptionWidget( + {Key key, + this.spaceBetweenTextFields, + this.medicineViewModel, + this.prescriptionViewModel, + this.onItemSelected}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: ( + BuildContext context, + MedicineViewModel model, + Widget child, + ) => + NetworkBaseView( + baseViewModel: model, + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + borderColor: Colors.white, + hintText: TranslationBase.of(context).searchMedicineNameHere, + controller: myController, + onSaved: (value) {}, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + inputFormatter: ONLY_LETTERS, + ), + ), + ), + SizedBox( + height: 15.0, + ), + Container( + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.8, + child: Container( + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine( + context, + model, + ); + }, + ), + ], + ), + ), + ), + if (myController.text != '') + Container( + height: MediaQuery.of(context).size.height * 0.5, + child: ListView.builder( + padding: const EdgeInsets.only(top: 20), + scrollDirection: Axis.vertical, + itemCount: model.allMedicationList == null + ? 0 + : model.allMedicationList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: + model.allMedicationList[index].description), + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.getItem(itemID: model.allMedicationList[index].itemId, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + onItemSelected(model.allMedicationList[index]); + // uom = _selectedMedication.uom; + }, + ); + }, + ), + ), + ], + ), + ), + SizedBox( + height: spaceBetweenTextFields, + ), + ], + ), + ), + ); + } + + searchMedicine(context, MedicineViewModel model) async { + FocusScope.of(context).unfocus(); + if (myController.text.length < 3) { + Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + return; + } + GifLoaderDialogUtils.showMyDialog(context); + await model.getMedicationList(drug: myController.text, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + } +} diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart deleted file mode 100644 index 8c07afcf..00000000 --- a/lib/screens/prescription/add_prescription_form.dart +++ /dev/null @@ -1,1177 +0,0 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; -import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; -import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_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/locator.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.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/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; -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; - -addPrescriptionForm(context, PrescriptionViewModel model, - PatiantInformtion patient, prescription) { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext bc) { - return PrescriptionFormWidget(model, patient, prescription); - }); -} - -postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = - new PostPrescriptionReqModel(); - List prescriptionList = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - postProcedureReqModel.clinicID = patient.clinicId; - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - - prescriptionList.add(PrescriptionRequestModel( - covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), - remarks: instruction, - approvalRequired: true, - icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); - postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else if (model.state == ViewState.Idle) { - model.getPrescriptions(patient); - DrAppToastMsg.showSuccesToast('Medication has been added'); - } -} - -class PrescriptionFormWidget extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final List prescriptionList; - - PrescriptionFormWidget(this.model, this.patient, this.prescriptionList); - - @override - _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); -} - -class _PrescriptionFormWidgetState extends State { - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; - - int selectedType; - - TextEditingController strengthController = TextEditingController(); - TextEditingController indicationController = TextEditingController(); - TextEditingController instructionController = TextEditingController(); - - bool visbiltyPrescriptionForm = false; - bool visbiltySearch = true; - - final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); - - TextEditingController drugIdController = TextEditingController(); - TextEditingController doseController = TextEditingController(); - final searchController = TextEditingController(); - stt.SpeechToText speech = stt.SpeechToText(); - var event = RobotProvider(); - var reconizedWord; - - final GlobalKey formKey = GlobalKey(); - final double spaceBetweenTextFileds = 12; - dynamic route; - dynamic frequency; - dynamic duration; - dynamic doseTime; - dynamic indication; - dynamic units; - dynamic uom; - dynamic box; - dynamic x; - - @override - void initState() { - requestPermissions(); - event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { - if (this.mounted) { - initSpeechState().then((value) => {onVoiceText()}); - } - } - }); - selectedType = 1; - super.initState(); - } - - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - 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); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: lang == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } - } - - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - print(error); - } - - void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; - } - - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } - - void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); - - if (result.finalResult == true) { - setState(() { - SpeechToText.closeAlertDialog(context); - speech.stop(); - instructionController.text += reconizedWord + '\n'; - }); - } else { - print(result.finalResult); - } - } - - Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) async { - x = model.patientAssessmentList.map((element) { - return element.icdCode10ID; - }); - GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: widget.patient.appointmentNo); - if (model.medicationStrengthList.length == 0) { - await model.getMedicationStrength(); - } - if (model.medicationDurationList.length == 0) { - await model.getMedicationDuration(); - } - if (model.medicationDoseTimeList.length == 0) { - await model.getMedicationDoseTime(); - } - await model.getPatientAssessment(getAssessmentReqModel); - }, - builder: ( - BuildContext context, - MedicineViewModel model, - Widget child, - ) => - NetworkBaseView( - baseViewModel: model, - child: GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: DraggableScrollableSheet( - initialChildSize: 0.98, - maxChildSize: 0.98, - minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.65, - color: Color(0xffF8F8F8), - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - children: [ - Column( - children: [ - SizedBox( - height: 60, - ), - ], - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - children: [ - FractionallySizedBox( - widthFactor: 0.9, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - onTap: () { - visbiltyPrescriptionForm = false; - visbiltySearch = true; - }, - borderColor: Colors.white, - hintText: TranslationBase.of(context) - .searchMedicineNameHere, - controller: myController, - onSaved: (value) {}, - onFieldSubmitted: (value) { - searchMedicine(context, model); - }, - inputFormatter: ONLY_LETTERS, - ), - ), - ), - SizedBox( - height: 15.0, - ), - Visibility( - visible: visbiltySearch, - child: Container( - child: Column( - children: [ - FractionallySizedBox( - widthFactor: 0.8, - child: Container( - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of( - context) - .search, - onPressed: () async { - await searchMedicine( - context, model); - }, - ), - ], - ), - ), - ), - if (myController.text != '') - Container( - height: MediaQuery.of(context) - .size - .height * - 0.5, - child: ListView.builder( - padding: const EdgeInsets.only( - top: 20), - scrollDirection: Axis.vertical, - itemCount: - model.allMedicationList == - null - ? 0 - : model - .allMedicationList - .length, - itemBuilder: - (BuildContext context, - int index) { - return InkWell( - child: MedicineItemWidget( - label: model - .allMedicationList[ - index] - .description), - onTap: () { - model.getItem( - itemID: model - .allMedicationList[ - index] - .itemId); - visbiltyPrescriptionForm = - true; - visbiltySearch = false; - _selectedMedication = - model.allMedicationList[ - index]; - uom = _selectedMedication - .uom; - }, - ); - }, - ), - ), - ], - ), - ), - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Visibility( - visible: visbiltyPrescriptionForm, - child: Container( - child: Column( - children: [ - AppText( - _selectedMedication?.description ?? - "", - bold: true, - ), - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context) - .orderType, - fontWeight: FontWeight.w600, - ), - Radio( - activeColor: - Color(0xFFB9382C), - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context) - .regular), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.35, - child: AppTextFieldCustom( - //height: 40, - validationError: - strengthError, - hintText: 'Strength', - isTextFieldHasSuffix: false, - enabled: true, - controller: - strengthController, - onChanged: (String value) { - setState(() { - strengthChar = - value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, - ); - } - }, - inputType: TextInputType - .numberWithOptions( - decimal: true, - ), - ), - ), - SizedBox( - width: 5.0, - ), - PrescriptionTextFiled( - width: MediaQuery.of(context) - .size - .width * - 0.510, - element: model - .itemMedicineListUnit - .length == - 1 - ? model - .itemMedicineListUnit[0] - : units, - elementError: unitError, - keyName: 'description', - keyId: 'parameterCode', - hintText: 'Unit', - elementList: model - .itemMedicineListUnit, - okFunction: (selectedValue) { - setState(() { - units = selectedValue; - units['isDefault'] = true; - }); - }, - ), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - elementList: - model.itemMedicineListRoute, - element: model.itemMedicineListRoute - .length == - 1 - ? model.itemMedicineListRoute[0] - : route, - elementError: routeError, - keyId: 'parameterCode', - keyName: 'description', - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - route['isDefault'] = true; - }); - }, - hintText: - TranslationBase.of(context) - .route, - ), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - hintText: - TranslationBase.of(context) - .frequency, - elementError: frequencyError, - element: frequency, - elementList: - model.itemMedicineList, - keyId: 'parameterCode', - keyName: 'description', - okFunction: (selectedValue) { - setState(() { - frequency = selectedValue; - frequency['isDefault'] = true; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController.text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); - - return; - } - }); - }), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - hintText: - TranslationBase.of(context) - .doseTime, - elementError: doseTimeError, - element: doseTime, - elementList: - model.medicationDoseTimeList, - keyId: 'id', - keyName: 'nameEn', - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }), - SizedBox( - height: spaceBetweenTextFileds), - if (model - .patientAssessmentList.isNotEmpty) - Container( - height: screenSize.height * 0.070, - width: double.infinity, - color: Colors.white, - child: Row( - children: [ - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, - child: TextField( - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), - enabled: true, - readOnly: true, - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.57, - color: Colors.white, - child: TextField( - maxLines: 5, - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), - enabled: true, - readOnly: true, - ), - ), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: () => selectDate( - context, widget.model), - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - element: duration, - elementError: durationError, - hintText: - TranslationBase.of(context) - .duration, - elementList: - model.medicationDurationList, - keyName: 'nameEn', - keyId: 'id', - okFunction: (selectedValue) { - setState(() { - duration = selectedValue; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController.text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text), - ); - box = model.boxQuintity; - - return; - } - }); - }, - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - color: Colors.white, - child: AppTextFieldCustom( - hintText: "UOM", - isTextFieldHasSuffix: false, - dropDownText: - uom != null ? uom : null, - enabled: false, - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - color: Colors.white, - child: AppTextFieldCustom( - hintText: - TranslationBase.of(context) - .boxQuantity, - isTextFieldHasSuffix: false, - dropDownText: box != null - ? model.boxQuintity.toString() - : null, - enabled: false, - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), - child: Stack( - children: [ - TextFields( - maxLines: 6, - minLines: 4, - hintText: TranslationBase.of( - context) - .instruction, - controller: - instructionController, - //keyboardType: TextInputType.number, - ), - Positioned( - top: 0, - right: 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - size: 35, - ), - onPressed: () { - initSpeechState().then( - (value) => - {onVoiceText()}); - }, - ), - ), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - color: Color(0xff359846), - title: TranslationBase.of( - context) - .addMedication, - fontWeight: FontWeight.w600, - onPressed: () async { - await locator< - AnalyticsService>() - .logEvent( - eventCategory: - "Add Prescription Form", - eventAction: - "Add Prescription", - ); - if (duration != null && - doseTime != null && - frequency != null && - selectedDate != null && - strengthController - .text != - "") { - if (_selectedMedication - .isNarcotic == - true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .narcoticMedicineCanOnlyBePrescribedFromVida); - Navigator.pop(context); - return; - } - - if (double.parse( - strengthController - .text) > - 1000.0) { - DrAppToastMsg - .showErrorToast( - "1000 is the MAX for the strength"); - return; - } - if (double.parse( - strengthController - .text) < - 0.0) { - DrAppToastMsg - .showErrorToast( - "strength can't be zero"); - return; - } - - if (formKey.currentState - .validate()) { - Navigator.pop(context); - openDrugToDrug(model); - { - // postProcedure( - // icdCode: model - // .patientAssessmentList - // .isNotEmpty - // ? model - // .patientAssessmentList[ - // 0] - // .icdCode10ID - // .isEmpty - // ? "test" - // : model - // .patientAssessmentList[ - // 0] - // .icdCode10ID - // .toString() - // : "test", - // // icdCode: model - // // .patientAssessmentList - // // .map((value) => value - // // .icdCode10ID - // // .trim()) - // // .toList() - // // .join(' '), - // dose: strengthController - // .text, - // doseUnit: model - // .itemMedicineListUnit - // .length == - // 1 - // ? model - // .itemMedicineListUnit[ - // 0][ - // 'parameterCode'] - // .toString() - // : units['parameterCode'] - // .toString(), - // patient: widget.patient, - // doseTimeIn: - // doseTime['id'] - // .toString(), - // model: widget.model, - // duration: duration['id'] - // .toString(), - // frequency: model - // .itemMedicineList - // .length == - // 1 - // ? model - // .itemMedicineList[ - // 0][ - // 'parameterCode'] - // .toString() - // : frequency[ - // 'parameterCode'] - // .toString(), - // route: model.itemMedicineListRoute - // .length == - // 1 - // ? model - // .itemMedicineListRoute[ - // 0][ - // 'parameterCode'] - // .toString() - // : route['parameterCode'] - // .toString(), - // drugId: - // _selectedMedication - // .itemId - // .toString(), - // strength: - // strengthController - // .text, - // indication: - // indicationController - // .text, - // instruction: - // instructionController - // .text, - // doseTime: selectedDate, - // ); - } - } - } else { - setState(() { - if (duration == null) { - durationError = - TranslationBase.of( - context) - .fieldRequired; - } else { - durationError = null; - } - if (doseTime == null) { - doseTimeError = - TranslationBase.of( - context) - .fieldRequired; - } else { - doseTimeError = null; - } - if (route == null) { - routeError = - TranslationBase.of( - context) - .fieldRequired; - } else { - routeError = null; - } - if (frequency == null) { - frequencyError = - TranslationBase.of( - context) - .fieldRequired; - } else { - frequencyError = null; - } - if (units == null) { - unitError = - TranslationBase.of( - context) - .fieldRequired; - } else { - unitError = null; - } - if (strengthController - .text == - "") { - strengthError = - TranslationBase.of( - context) - .fieldRequired; - } else { - strengthError = null; - } - }); - } - - formKey.currentState.save(); - }, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ); - }), - ), - ), - ); - } - - selectDate(BuildContext context, PrescriptionViewModel model) async { - Helpers.hideKeyboard(context); - DateTime selectedDate; - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now(), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - this.selectedDate = picked; - }); - } - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.keyboard_arrow_down_sharp, - color: Color(0xff2E303A), - ) - : null, - hintStyle: TextStyle( - fontSize: 13, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - labelText: selectedText != null ? '$hintText\n$selectedText' : null, - labelStyle: TextStyle( - fontSize: 13, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - ); - } - - openDrugToDrug(model) { - showModalBottomSheet( - context: context, - builder: (context) { - return Container( - height: SizeConfig.realScreenHeight * .8, - width: SizeConfig.realScreenWidth, - child: SingleChildScrollView( - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - DrugToDrug( - widget.patient, - getPriscriptionforDrug(widget.prescriptionList, model), - model.patientAssessmentList), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), - child: AppButton( - title: TranslationBase.of(context).addMedication, - onPressed: () { - Navigator.pop(context); - - postPrescription( - icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID - .isEmpty - ? "test" - : model.patientAssessmentList[0].icdCode10ID - .toString() - : "test", - dose: strengthController.text, - doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'] - .toString() - : units['parameterCode'].toString(), - patient: widget.patient, - doseTimeIn: doseTime['id'].toString(), - model: widget.model, - duration: duration['id'].toString(), - frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] - .toString() - : frequency['parameterCode'].toString(), - route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'] - .toString() - : route['parameterCode'].toString(), - drugId: _selectedMedication.itemId.toString(), - strength: strengthController.text, - indication: indicationController.text, - instruction: instructionController.text, - doseTime: selectedDate, - ); - }, - )) - ], - )), - - //], - //) - ); - }); - } - - getPriscriptionforDrug( - List prescriptionList, MedicineViewModel model) { - var prescriptionDetails = []; - if (prescriptionList.length > 0) { - prescriptionList[0].entityList.forEach((element) { - if (element.mediSpanGPICode != null) { - prescriptionDetails.add({ - 'DrugId': element.mediSpanGPICode, - 'DrugName': element.medicationName, - 'Dose': element.doseDailyQuantity, - 'DoseType': element.doseDailyUnitID, - 'Unit': element.uom, - 'FrequencyType': element.frequencyID, - 'Duration': element.doseDurationDays, - 'RouteID': element.routeID, - 'IsScreen': element.isSIG - }); - } - }); - } - if (_selectedMedication.mediSpanGPICode != null) { - prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, - 'Dose': strengthController.text, - 'DoseType': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'].toString() - : units['parameterCode'].toString(), - 'Unit': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['description'] - : units['description'], - 'FrequencyType': model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'].toString() - : frequency['parameterCode'].toString(), - 'Duration': duration['id'].toString(), - 'RouteID': model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'].toString() - : route['parameterCode'].toString(), - 'IsScreen': true - }); - } - return prescriptionDetails; - } - - searchMedicine(context, MedicineViewModel model) async { - FocusScope.of(context).unfocus(); - if (myController.text.length < 3) { - Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); - return; - } - await model.getMedicationList(drug: myController.text); - } -} diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart new file mode 100644 index 00000000..d6403602 --- /dev/null +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -0,0 +1,180 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_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/prescription/prescriptions_items/prescription_items_in_patient.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_service_title.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'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.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 '../../util/helpers.dart'; +import '../../widgets/shared/errors/error_message.dart'; + +class NewPrescriptionsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; + bool isFromLiveCare = routeArgs['isFromLiveCare']; + return BaseView( + onModelReady: (model) async { + model.getPrescriptionListNew( + mrn: patient.patientMRN, appNo: patient.appointmentNo); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: FractionallySizedBox( + widthFactor: 1.0, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions, + ), + ], + ), + ), + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || + (isFromLiveCare && patient.appointmentNo != null)) + AddNewOrder( + onTap: () { + Navigator.push( + context, + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + prescriptionModel: model, + procedureType: ProcedureType.PRESCRIPTION, + ), + settingRoute: 'AddProcedureTabPage'), + ); + }, + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.92, + child: ListView.builder( + physics: BouncingScrollPhysics(), + itemCount: model.prescriptionListNew.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Helpers.convertToTitleCase(model + .prescriptionListNew[index] + .medicationName), + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :", + value: model + .prescriptionListNew[index].doctorName, + ), + CustomRow( + label: TranslationBase.of(context).orderTypeDescription + ': ',//"Order Type Description :", + value: model.prescriptionListNew[index] + .orderTypeDescription, + ), + CustomRow( + label: TranslationBase.of(context).status + ': ', + value: + model.prescriptionListNew[index].status, + ), + CustomRow( + label: TranslationBase.of(context).indication + ': ', //"indication :", + value: model + .prescriptionListNew[index].indication, + ), + CustomRow( + label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :", + value: model + .prescriptionListNew[index].doseDetail, + ), + CustomRow( + label: TranslationBase.of(context).quantity + ': ',//"quantity :", + value: model + .prescriptionListNew[index].quantity + .toString(), + ),CustomRow( + label: TranslationBase.of(context).startDate + ': ', //"start Date :", + value: model + .prescriptionListNew[index].startDate + .toString(), + ),CustomRow( + label: TranslationBase.of(context).stopDate + ': ',//"stop Date :", + value: model + .prescriptionListNew[index].stopDate + .toString(), + ), + if(model + .prescriptionListNew[index].remarks != null&& model + .prescriptionListNew[index].remarks!= "") + CustomRow( + label: TranslationBase.of(context).remarks + ': ',//"Remark :", + value: model + .prescriptionListNew[index].remarks + .toString(), + ), + ], + ), + ),); + }), + ), + ), + if (model.prescriptionListNew.isEmpty && + patient.patientStatusType != 43) + Center( + child: ErrorMessage( + error: TranslationBase.of(context).noPrescriptionsFound, + )) + ], + ), + ), + )), + ); + } +} diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart new file mode 100644 index 00000000..19d12416 --- /dev/null +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -0,0 +1,234 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_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/prescription/prescriptions_items/prescription_items_in_patient.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_service_title.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'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.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 '../../util/helpers.dart'; +import '../../widgets/shared/errors/error_message.dart'; + +class OldPrescriptionsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; + bool isFromLiveCare = routeArgs['isFromLiveCare']; + return BaseView( + onModelReady: (model) async { + patient.admissionNo == null + ? model.getPrescriptions(patient, + patientType: patientType, isLocalBusy: false) + : model.getMedicationForInPatient(patient); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: patient.admissionNo == null + ? FractionallySizedBox( + widthFactor: 1.0, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context) + .prescriptions + "(${TranslationBase.of(context) + .old }) ", + ), + ], + ), + ), + ListView.builder( + physics: BouncingScrollPhysics(), + itemCount: model.prescriptionsList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: model + .prescriptionsList[index], + patient: patient, + arrivalType: arrivalType, + ), + ), + ), + child: Column( + children: [ + DoctorCard( + doctorName: + Helpers.convertToTitleCase(model + .prescriptionsList[index] + .doctorName), + profileUrl: model + .prescriptionsList[index] + .doctorImageURL, + branch: model + .prescriptionsList[index].name, + clinic: model.prescriptionsList[index] + .clinicDescription, + isPrescriptions: true, + appointmentDate: AppDateUtils + .getDateTimeFromServerFormat( + model.prescriptionsList[index] + .appointmentDate, + ), + ), + ], + )); + }), + if (model.prescriptionsList.isEmpty && + patient.patientStatusType != 43) + Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .noPrescriptionsFound, + )) + ], + ), + ), + ) + : Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context) + .prescriptions + "(${TranslationBase.of(context) + .old }) ", + ), + model.medicationForInPatient.length == 0? + Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .noPrescriptionsFound, + )): ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.medicationForInPatient.length, + itemBuilder: (context, index) { + //model.medicationForInPatient.length, + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .pHRItemDescription), + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: "Doctor Name :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .doctorName + .toString()), + ), + CustomRow( + label: "Status :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .statusDescription + .toString()), + ), + CustomRow( + label: "dose :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .dose + .toString()), + ), CustomRow( + label: "comments :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .comments + .toString()), + ), + + ], + ), + ), + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: + model.medicationForInPatient[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: AppDateUtils + .getDateTimeFromServerFormat( + model.medicationForInPatient[index] + .startDatetime, + ), + stopOn: AppDateUtils + .getDateTimeFromServerFormat( + model.medicationForInPatient[index] + .stopDatetime, + ), + ), + ), + ), + ); + }), + ], + ), + ), + ), + ))); + } +} diff --git a/lib/screens/prescription/prescription_authorazation_form.dart b/lib/screens/prescription/prescription_authorazation_form.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index cac2f99a..3930cffd 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -8,10 +8,10 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_template_detai import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.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/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -37,14 +37,21 @@ class PrescriptionCheckOutScreen extends StatefulWidget { final List prescriptionList; final ProcedureTempleteDetailsModel groupProcedures; - const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) + const PrescriptionCheckOutScreen( + {Key key, + this.model, + this.patient, + this.prescriptionList, + this.groupProcedures}) : super(key: key); @override - _PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState(); + _PrescriptionCheckOutScreenState createState() => + _PrescriptionCheckOutScreenState(); } -class _PrescriptionCheckOutScreenState extends State { +class _PrescriptionCheckOutScreenState + extends State { postPrescription( {String duration, String doseTimeIn, @@ -61,7 +68,8 @@ class _PrescriptionCheckOutScreenState extends State String icdCode, PatiantInformtion patient, String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); + PostPrescriptionReqModel postProcedureReqModel = + new PostPrescriptionReqModel(); List prescriptionList = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -89,7 +97,7 @@ class _PrescriptionCheckOutScreenState extends State Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); - DrAppToastMsg.showSuccesToast('Medication has been added'); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).medicationHasBeenAdded); } } @@ -106,24 +114,25 @@ class _PrescriptionCheckOutScreenState extends State TextEditingController indicationController = TextEditingController(); TextEditingController instructionController = TextEditingController(); - bool visbiltyPrescriptionForm = true; - bool visbiltySearch = true; + bool visibilityPrescriptionForm = true; + bool visibilitySearch = true; final myController = TextEditingController(); DateTime selectedDate; int strengthChar; GetMedicationResponseModel _selectedMedication; - GlobalKey key = new GlobalKey>(); + GlobalKey key = + new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); final searchController = TextEditingController(); stt.SpeechToText speech = stt.SpeechToText(); var event = RobotProvider(); - var reconizedWord; + var recognizedWord; final GlobalKey formKey = GlobalKey(); - final double spaceBetweenTextFileds = 12; + final double spaceBetweenTextFields = 12; dynamic route; dynamic frequency; dynamic duration; @@ -151,7 +160,8 @@ class _PrescriptionCheckOutScreenState extends State 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, @@ -169,7 +179,7 @@ class _PrescriptionCheckOutScreenState extends State } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -179,14 +189,14 @@ class _PrescriptionCheckOutScreenState extends State } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - instructionController.text += reconizedWord + '\n'; + instructionController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); @@ -194,7 +204,8 @@ class _PrescriptionCheckOutScreenState extends State } Future 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; } @@ -210,7 +221,10 @@ class _PrescriptionCheckOutScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); + // TODO Elham* move this logic to the model + model.getItem( + itemID: int.parse( + widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; @@ -251,7 +265,8 @@ class _PrescriptionCheckOutScreenState extends State height: MediaQuery.of(context).size.height * 1.35, color: Color(0xffF8F8F8), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), child: Column( children: [ Column( @@ -275,7 +290,8 @@ class _PrescriptionCheckOutScreenState extends State width: 7.0, ), AppText( - TranslationBase.of(context).newPrescriptionOrder, + TranslationBase.of(context) + .newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -284,7 +300,7 @@ class _PrescriptionCheckOutScreenState extends State ], ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Container( child: Form( @@ -301,47 +317,53 @@ class _PrescriptionCheckOutScreenState extends State ), ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Visibility( - visible: visbiltyPrescriptionForm, + visible: visibilityPrescriptionForm, child: Container( child: Column( children: [ AppText( - widget.groupProcedures.procedureName ?? "", + widget.groupProcedures.procedureName ?? + "", bold: true, ), Container( child: Row( children: [ AppText( - TranslationBase.of(context).orderType, + TranslationBase.of(context) + .orderType, fontWeight: FontWeight.w600, ), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, value: 1, groupValue: selectedType, onChanged: (value) { setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular), + Text(TranslationBase.of(context) + .regular), ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.35, + width: MediaQuery.of(context) + .size + .width * + 0.35, child: AppTextFieldCustom( height: 40, validationError: strengthError, - hintText: 'Strength', + hintText: TranslationBase.of(context).strength, isTextFieldHasSuffix: false, enabled: true, controller: strengthController, @@ -350,12 +372,16 @@ class _PrescriptionCheckOutScreenState extends State strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).only5DigitsAllowedForStrength, + DrAppToastMsg + .showErrorToast( + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, ); } }, - inputType: TextInputType.numberWithOptions( + inputType: TextInputType + .numberWithOptions( decimal: true, ), ), @@ -364,13 +390,17 @@ class _PrescriptionCheckOutScreenState extends State width: 5.0, ), PrescriptionTextFiled( - width: MediaQuery.of(context).size.width * 0.560, + width: MediaQuery.of(context) + .size + .width * + 0.560, element: units, elementError: unitError, keyName: 'description', keyId: 'parameterCode', hintText: 'Select', - elementList: model.itemMedicineListUnit, + elementList: + model.itemMedicineListUnit, okFunction: (selectedValue) { setState(() { units = selectedValue; @@ -381,9 +411,10 @@ class _PrescriptionCheckOutScreenState extends State ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - elementList: model.itemMedicineListRoute, + elementList: + model.itemMedicineListRoute, element: route, elementError: routeError, keyId: 'parameterCode', @@ -394,11 +425,13 @@ class _PrescriptionCheckOutScreenState extends State route['isDefault'] = true; }); }, - hintText: TranslationBase.of(context).route, + hintText: + TranslationBase.of(context).route, ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - hintText: TranslationBase.of(context).frequency, + hintText: TranslationBase.of(context) + .frequency, elementError: frequencyError, element: frequency, elementList: model.itemMedicineList, @@ -411,23 +444,31 @@ class _PrescriptionCheckOutScreenState extends State if (_selectedMedication != null && duration != null && frequency != null && - strengthController.text != null) { + strengthController.text != + null) { model.getBoxQuantity( - freq: frequency['parameterCode'], + freq: frequency[ + 'parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, - strength: double.parse(strengthController.text)); + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text)); return; } }); }), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - hintText: TranslationBase.of(context).doseTime, + hintText: TranslationBase.of(context) + .doseTime, elementError: doseTimeError, element: doseTime, - elementList: model.medicationDoseTimeList, + elementList: + model.medicationDoseTimeList, keyId: 'id', keyName: 'nameEn', okFunction: (selectedValue) { @@ -435,8 +476,9 @@ class _PrescriptionCheckOutScreenState extends State doseTime = selectedValue; }); }), - SizedBox(height: spaceBetweenTextFileds), - if (model.patientAssessmentList.isNotEmpty) + SizedBox(height: spaceBetweenTextFields), + if (model + .patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, width: double.infinity, @@ -444,25 +486,47 @@ class _PrescriptionCheckOutScreenState extends State child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.29, + width: MediaQuery.of(context) + .size + .width * + 0.29, child: TextField( - decoration: textFieldSelectorDecoration( - model.patientAssessmentList[0].icdCode10ID.toString(), - indication != null ? indication['name'] : null, - false), + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + indication != null + ? indication[ + 'name'] + : null, + false), enabled: true, readOnly: true, ), ), Container( - width: MediaQuery.of(context).size.width * 0.65, + width: MediaQuery.of(context) + .size + .width * + 0.65, color: Colors.white, child: TextField( maxLines: 5, - decoration: textFieldSelectorDecoration( - model.patientAssessmentList[0].asciiDesc.toString(), - indication != null ? indication['name'] : null, - false), + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .asciiDesc + .toString(), + indication != null + ? indication[ + 'name'] + : null, + false), enabled: true, readOnly: true, ), @@ -470,15 +534,17 @@ class _PrescriptionCheckOutScreenState extends State ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model), + onTap: () => + selectDate(context, widget.model), child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context) + .date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -491,12 +557,14 @@ class _PrescriptionCheckOutScreenState extends State ), ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( element: duration, elementError: durationError, - hintText: TranslationBase.of(context).duration, - elementList: model.medicationDurationList, + hintText: TranslationBase.of(context) + .duration, + elementList: + model.medicationDurationList, keyName: 'nameEn', keyId: 'id', okFunction: (selectedValue) { @@ -505,12 +573,16 @@ class _PrescriptionCheckOutScreenState extends State if (_selectedMedication != null && duration != null && frequency != null && - strengthController.text != null) { + strengthController.text != + null) { model.getBoxQuantity( - freq: frequency['parameterCode'], + freq: + frequency['parameterCode'], duration: duration['id'], - itemCode: _selectedMedication.itemId, - strength: double.parse(strengthController.text), + itemCode: + _selectedMedication.itemId, + strength: double.parse( + strengthController.text), ); box = model.boxQuintity; @@ -519,19 +591,24 @@ class _PrescriptionCheckOutScreenState extends State }); }, ), - SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), + SizedBox(height: spaceBetweenTextFields), + SizedBox(height: spaceBetweenTextFields), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), child: Stack( children: [ TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of(context).instruction, + hintText: + TranslationBase.of(context) + .instruction, controller: instructionController, //keyboardType: TextInputType.number, ), @@ -545,22 +622,26 @@ class _PrescriptionCheckOutScreenState extends State size: 35, ), onPressed: () { - initSpeechState().then((value) => {onVoiceText()}); + initSpeechState().then( + (value) => + {onVoiceText()}); }, ), ), ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - color: Color(0xff359846), - title: TranslationBase.of(context).addMedication, + color: AppGlobal.appGreenColor, + title: TranslationBase.of(context) + .addMedication, fontWeight: FontWeight.w600, onPressed: () async { if (route != null && @@ -569,59 +650,101 @@ class _PrescriptionCheckOutScreenState extends State frequency != null && units != null && selectedDate != null && - strengthController.text != "") { - // if (_selectedMedication.isNarcotic == true) { - // DrAppToastMsg.showErrorToast(TranslationBase.of(context) - // .narcoticMedicineCanOnlyBePrescribedFromVida); - // Navigator.pop(context); - // return; - // } - - if (double.parse(strengthController.text) > 1000.0) { - DrAppToastMsg.showErrorToast("1000 is the MAX for the strength"); + strengthController.text != + "") { + if (double.parse( + strengthController + .text) > + 1000.0) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).thousandIsTheMAXForTheStrength,); return; } - if (double.parse(strengthController.text) < 0.0) { - DrAppToastMsg.showErrorToast("strength can't be zero"); + if (double.parse( + strengthController + .text) < + 0.0) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).strengthCanNotBeZero,); return; } - - if (formKey.currentState.validate()) { + if (formKey.currentState + .validate()) { Navigator.pop(context); - // openDrugToDrug(model); { postPrescription( - icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID.isEmpty + icdCode: model + .patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .isEmpty ? "test" - : model.patientAssessmentList[0].icdCode10ID.toString() + : model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() : "test", - // icdCode: model - // .patientAssessmentList - // .map((value) => value - // .icdCode10ID - // .trim()) - // .toList() - // .join(' '), - dose: strengthController.text, - doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'].toString() - : units['parameterCode'].toString(), + dose: strengthController + .text, + doseUnit: model + .itemMedicineListUnit + .length == + 1 + ? model + .itemMedicineListUnit[ + 0][ + 'parameterCode'] + .toString() + : units['parameterCode'] + .toString(), patient: widget.patient, - doseTimeIn: doseTime['id'].toString(), + doseTimeIn: + doseTime['id'] + .toString(), model: widget.model, - duration: duration['id'].toString(), - frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'].toString() - : frequency['parameterCode'].toString(), - route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'].toString() - : route['parameterCode'].toString(), - drugId: (widget.groupProcedures.aliasN - .replaceAll("item code ;", "")), - strength: strengthController.text, - indication: indicationController.text, - instruction: instructionController.text, + duration: duration['id'] + .toString(), + frequency: model + .itemMedicineList + .length == + 1 + ? model + .itemMedicineList[ + 0][ + 'parameterCode'] + .toString() + : frequency[ + 'parameterCode'] + .toString(), + route: model.itemMedicineListRoute + .length == + 1 + ? model + .itemMedicineListRoute[ + 0][ + 'parameterCode'] + .toString() + : route['parameterCode'] + .toString(), + drugId: (widget + .groupProcedures + .aliasN + .replaceAll( + "item code ;", + "")), + strength: + strengthController + .text, + indication: + indicationController + .text, + instruction: + instructionController + .text, doseTime: selectedDate, ); } @@ -629,32 +752,52 @@ class _PrescriptionCheckOutScreenState extends State } else { setState(() { if (duration == null) { - durationError = TranslationBase.of(context).fieldRequired; + durationError = + TranslationBase.of( + context) + .fieldRequired; } else { durationError = null; } if (doseTime == null) { - doseTimeError = TranslationBase.of(context).fieldRequired; + doseTimeError = + TranslationBase.of( + context) + .fieldRequired; } else { doseTimeError = null; } if (route == null) { - routeError = TranslationBase.of(context).fieldRequired; + routeError = + TranslationBase.of( + context) + .fieldRequired; } else { routeError = null; } if (frequency == null) { - frequencyError = TranslationBase.of(context).fieldRequired; + frequencyError = + TranslationBase.of( + context) + .fieldRequired; } else { frequencyError = null; } if (units == null) { - unitError = TranslationBase.of(context).fieldRequired; + unitError = + TranslationBase.of( + context) + .fieldRequired; } else { unitError = null; } - if (strengthController.text == "") { - strengthError = TranslationBase.of(context).fieldRequired; + if (strengthController + .text == + "") { + strengthError = + TranslationBase.of( + context) + .fieldRequired; } else { strengthError = null; } @@ -704,7 +847,10 @@ class _PrescriptionCheckOutScreenState extends State } } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, + /// TODO Elham* Use it from the textfeild utils + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart deleted file mode 100644 index 623cee90..00000000 --- a/lib/screens/prescription/prescription_details_page.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class PrescriptionDetailsPage extends StatelessWidget { - final PrescriptionReport prescriptionReport; - - PrescriptionDetailsPage({Key key, this.prescriptionReport}); - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - prescriptionReport.imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: AppText( - prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), - ), - ), - ) - ], - ), - ), - Container( - color: Colors.white, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - child: Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - outside: BorderSide(width: 0.5)), - children: [ - TableRow( - children: [ - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).route, - fontSize: 14, - ))), - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).frequency, - fontSize: 14, - ))), - Container( - color: Colors.white, - width: double.infinity, - padding: EdgeInsets.symmetric(horizontal: 4), - child: Center( - child: AppText( - "${TranslationBase.of(context).dailyDoses}", - fontSize: 14, - ))), - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).duration, - fontSize: 14, - ))), - ], - ), - TableRow( - children: [ - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: - Center(child: Text(prescriptionReport.routeN))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: Center( - child: - Text(prescriptionReport.frequencyN ?? ''))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: Center( - child: Text( - '${prescriptionReport.doseDailyQuantity}'))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: - Center(child: Text('${prescriptionReport.days}'))) - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - width: double.infinity, - color: Colors.white, - padding: EdgeInsets.all(5), - child: Center( - child: Column( - children: [ - AppText(TranslationBase.of(context).notes), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[300], - ), - SizedBox( - height: 5, - ), - AppText(prescriptionReport.remarks ?? ''), - ], - ), - ), - ) - ], - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart deleted file mode 100644 index 84f38748..00000000 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ /dev/null @@ -1,213 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/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:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class PrescriptionItemsInPatientPage extends StatelessWidget { - final GetMedicationForInPatientModel prescriptions; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final DateTime startOn; - final DateTime stopOn; - final int prescriptionIndex; - - PrescriptionItemsInPatientPage( - {Key key, - this.prescriptions, - this.patient, - this.patientType, - this.arrivalType, - this.stopOn, - this.startOn, - this.prescriptionIndex}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) async { - if (model.medicationForInPatient.length == 0) { - await model.getMedicationForInPatient(patient); - } - }, - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - backgroundColor: Colors.grey[100], - baseViewModel: model, - appBar: PatientProfileAppBar(patient), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18, right: 18), - child: AppText( - prescriptions.pHRItemDescription, - bold: true, - ), - ), - SizedBox( - height: 12, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 18, - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).direction, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + prescriptions.directionDescription.toString() ?? '')), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - AppText(" " + prescriptions.routeDescription.toString() ?? ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).refill, - color: Colors.grey, - ), - Expanded(child: AppText(" " + prescriptions.refillDescription.toString() ?? '')), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).startDate, - color: Colors.grey, - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).stopDate, - color: Colors.grey, - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM', - color: Colors.grey, - ), - AppText(" " + prescriptions.uomDescription.toString() ?? ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + prescriptions.dose.toString() ?? ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).status, - color: Colors.grey, - ), - AppText(" " + prescriptions.statusDescription.toString() ?? ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).processed, - color: Colors.grey, - ), - AppText(" " + prescriptions.doctorName.toString() ?? ''), - ], - ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).num, - // color: Colors.grey, - // ), - // AppText(" " + prescriptions.dose.toString() ?? ''), - // ], - // ), - SizedBox( - height: 12, - ), - AppText(prescriptions.comments ?? ''), - ], - ), - ) - ], - ) - ], - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart deleted file mode 100644 index b97343c4..00000000 --- a/lib/screens/prescription/prescription_items_page.dart +++ /dev/null @@ -1,244 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/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/dialogs/ShowImageDialog.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class PrescriptionItemsPage extends StatelessWidget { - final Prescriptions prescriptions; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => - model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - backgroundColor: Colors.grey[100], - baseViewModel: model, - appBar: PatientProfileAppBar( - patient, - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, - isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - isAppointmentHeader: true, - ), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - - if (!prescriptions.isInOutPatient) - ...List.generate( - model.prescriptionReportList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), - SizedBox(height: 12,), - Row( - children: [ - SizedBox(width: 18,), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(width: 0.5,color: Colors.grey) - ), - height: 55, - width: 55, - child: InkWell( - onTap: (){ - showDialog( - context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, - fit: BoxFit.cover, - ), - ), - ), - ), - SizedBox(width: 10,), - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), - ], - ), - SizedBox(height: 12,), - AppText(model.prescriptionReportList[index].remarks ?? ''), - ], - ),) - - - ], - ) - ], - ), - ), - )) - - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18,right: 18), - child: AppText(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), - SizedBox(height: 12,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(width: 18,), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all(width: 0.5,color: Colors.grey) - ), - height: 55, - width: 55, - child: InkWell( - onTap: (){ - showDialog( - context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - ) - ); - }, - child: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - - ), - ), - Positioned( - top: 10, - right: 10, - child: Icon(EvaIcons.search,color: Colors.grey,size: 35,)) - ], - ), - ), - ), - SizedBox(width: 10,), - Expanded(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).frequency,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).duration,color: Colors.grey,), - AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), - ], - ), - SizedBox(height: 12,), - AppText(model.prescriptionReportEnhList[index].remarks?? ''), - ], - ),) - - - ], - ) - ], - ), - ), - ), - ), - - - - ], - ), - ), - ), - ), - ); - } -} - - - diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index c63ccd1e..95b70182 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -43,10 +43,12 @@ class _PrescriptionTextFiledState extends State { ListSelectDialog dialog = ListSelectDialog( list: widget.elementList, attributeName: '${widget.keyName}', - attributeValueId: - widget.elementList.length == 1 ? widget.elementList[0]['${widget.keyId}'] : '${widget.keyId}', + attributeValueId: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyId}'].toString() + : '${widget.keyId}', okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) => widget.okFunction(selectedValue), + okFunction: (selectedValue) => + widget.okFunction(selectedValue), ); showDialog( barrierDismissible: false, @@ -65,7 +67,8 @@ class _PrescriptionTextFiledState extends State { ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, - validationError: widget.elementList.length != 1 ? widget.elementError : null, + validationError: + widget.elementList.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart deleted file mode 100644 index c91ce9c9..00000000 --- a/lib/screens/prescription/prescription_warnings.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.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/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -void prescriptionWarning(context) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Container( - height: 600, - child: Column( - children: [ - ...List.generate( - 5, - (index) => Container( - child: ExpansionTile( - title: AppText('Prescription warning and alerts(0)'), - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - 'DOSESCREENINGRESULTFORETCETC', - color: Color(0XFFB8382C), - ) - ], - ) - ], - ), - ), - ), - SizedBox( - height: 10.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: - Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Remarks', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox( - height: 95.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'CONTINUE', - onPressed: () { - Navigator.pop(context); - authorizationForm(context); - }, - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - color: Colors.white, - title: 'remove', - fontColor: Colors.red, - onPressed: () { - Navigator.pop(context); - prescriptionWarning(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} - -void authorizationForm(context) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: 500, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Prescription authorization'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 30.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Auth ID', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Password', - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - obscureText: true, - ), - ), - SizedBox( - height: 190.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'CONTINUE', - onPressed: () { - Navigator.pop(context); - authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} diff --git a/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart b/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart new file mode 100644 index 00000000..70fa1765 --- /dev/null +++ b/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart @@ -0,0 +1,157 @@ +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../../../widgets/shared/dialogs/ShowImageDialog.dart'; + + +class PrescriptionItemsWidget extends StatelessWidget { + final String itemDescription; + final String route; + final String frequency; + final dynamic dailyDoses; + final String imageSRCUrl; + final String remarks; + final int days; + final PrescriptionViewModel prescriptionViewModel; + + + + PrescriptionItemsWidget( + {this.itemDescription, + this.route, + this.frequency, + this.dailyDoses, + this.imageSRCUrl, + this.remarks, + this.days, this.prescriptionViewModel, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + ...List.generate( + // TODO Elham* List.generate to list.builder + prescriptionViewModel.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + prescriptionViewModel.prescriptionReportEnhList[index].itemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + width: 0.5, color: Colors.grey)), + height: 55, + width: 55, + child: InkWell( + onTap: () { + showDialog( + context: context, + builder: (ctx) => ShowImageDialog( + imageUrl: prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl, + )); + }, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + ), + ), + Positioned( + top: 10, + right: 10, + child: Icon( + EvaIcons.search, + color: Colors.grey, + size: 35, + )) + ], + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of(context).route + ' : ', + value: " " + prescriptionViewModel.prescriptionReportEnhList[index].route ?? '', + labelSize: 13, + valueSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).frequency + ' : ', + value: " " + prescriptionViewModel.prescriptionReportEnhList[index].frequency ?? '', + labelSize: 13, + valueSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).dailyDoses + ' : ', + value: " " + prescriptionViewModel.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? '', + labelSize: 13, + valueSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).duration + ' : ', + value: " " + prescriptionViewModel.prescriptionReportList[index].days.toString() ?? '', + labelSize: 13, + valueSize: 13, + ), + SizedBox( + height: 12, + ), + CustomRow( + label: '', + value: prescriptionViewModel.prescriptionReportList[index].remarks ?? '', + valueSize: 14, + ), + ], + ), + ) + ], + ) + ], + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/screens/prescription/prescriptions_items/prescription_items_in_patient.dart b/lib/screens/prescription/prescriptions_items/prescription_items_in_patient.dart new file mode 100644 index 00000000..cc21e1e3 --- /dev/null +++ b/lib/screens/prescription/prescriptions_items/prescription_items_in_patient.dart @@ -0,0 +1,187 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/user-guid/CusomRow.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionItemsInPatientPage extends StatelessWidget { + final GetMedicationForInPatientModel prescriptions; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final DateTime startOn; + final DateTime stopOn; + final int prescriptionIndex; + + PrescriptionItemsInPatientPage( + {Key key, + this.prescriptions, + this.patient, + this.patientType, + this.arrivalType, + this.stopOn, + this.startOn, + this.prescriptionIndex}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) async { + if (model.medicationForInPatient.length == 0) { + await model.getMedicationForInPatient(patient); + } + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + backgroundColor: Colors.grey[100], + baseViewModel: model, + appBar: PatientProfileAppBar(patient), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + prescriptions.pHRItemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of(context).direction + ' :', + value: " " + prescriptions.directionDescription.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).route + ' :', + value: " " + prescriptions.routeDescription ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).refill + ' :', + value: " " + prescriptions.refillDescription ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).startDate + ' :', + value: " " + AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic) ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).stopDate + ' :', + value: " " + AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic) ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: 'UOM' + ' :', + value: " " + prescriptions.uomDescription.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).dailyDoses, + value: " " + prescriptions.dose.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).status, + value: " " + prescriptions.statusDescription.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).processed, + value: " " + prescriptions.doctorName.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + SizedBox( + height: 12, + ), + CustomRow( + label: '', + value: prescriptions.comments ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + ], + ), + ) + ], + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_items/prescription_items_out_patient.dart b/lib/screens/prescription/prescriptions_items/prescription_items_out_patient.dart new file mode 100644 index 00000000..e49fb5e2 --- /dev/null +++ b/lib/screens/prescription/prescriptions_items/prescription_items_out_patient.dart @@ -0,0 +1,74 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/preacription_items_widget.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/dialogs/ShowImageDialog.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionItemsPage extends StatelessWidget { + final Prescriptions prescriptions; + final PatiantInformtion patient; + final String arrivalType; + + PrescriptionItemsPage( + {Key key, + this.prescriptions, + this.patient, + this.arrivalType}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPrescriptionReport( + prescriptions: prescriptions, patient: patient), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + backgroundColor: Colors.grey[100], + baseViewModel: model, + appBar: PatientProfileAppBar( + patient, + clinic: prescriptions.clinicDescription, + branch: prescriptions.name, + isPrescriptions: true, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + prescriptions.appointmentDate), + doctorName: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + isAppointmentHeader: true, + ), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.prescriptionReportEnhList.length, + itemBuilder: (context, index) => PrescriptionItemsWidget( + frequency: model.prescriptionReportEnhList[index].frequency, + itemDescription: model.prescriptionReportEnhList[index].itemDescription, + days: model.prescriptionReportEnhList[index].days, + route: model.prescriptionReportEnhList[index].route, + dailyDoses: model.prescriptionReportEnhList[index].doseDailyQuantity, + imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl, + remarks: model.prescriptionReportEnhList[index].remarks, + prescriptionViewModel: model, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart deleted file mode 100644 index d61ac08d..00000000 --- a/lib/screens/prescription/prescriptions_page.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; -import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; -import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/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/doctor_card.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.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'; - -class PrescriptionsPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; - bool isFromLiveCare = routeArgs['isFromLiveCare']; - bool isSelectInpatient = routeArgs['isSelectInpatient']; - return BaseView( - onModelReady: (model) => patient.admissionNo == null - ? model.getPrescriptions(patient, patientType: patientType) - : model.getMedicationForInPatient(patient), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - body: patient.admissionNo == null - ? FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), - children: [ - SizedBox( - height: 12, - ), - if (model.prescriptionsList.isNotEmpty && - patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: - TranslationBase.of(context).prescriptions, - ), - ], - ), - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: - TranslationBase.of(context).prescriptions, - ), - ], - ), - ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || - (isFromLiveCare && patient.appointmentNo != null)) - AddNewOrder( - onTap: () { - Navigator.push( - context, - SlideUpPageRoute( - widget: BaseAddProcedureTabPage( - patient: patient, - prescriptionModel: model, - procedureType: ProcedureType.PRESCRIPTION, - ), - settingRoute: 'AddProcedureTabPage'), - ); - }, - label: TranslationBase.of(context) - .applyForNewPrescriptionsOrder, - ), - ...List.generate( - model.prescriptionsList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: - model.prescriptionsList[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), - ), - ), - child: DoctorCard( - doctorName: - model.prescriptionsList[index].doctorName, - profileUrl: model - .prescriptionsList[index].doctorImageURL, - branch: model.prescriptionsList[index].name, - clinic: model.prescriptionsList[index] - .clinicDescription, - isPrescriptions: true, - appointmentDate: - AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index] - .appointmentDate, - ), - ))), - if (model.prescriptionsList.isEmpty && - patient.patientStatusType != 43) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noPrescriptionsFound), - ) - ], - ), - ) - ], - ), - ) - : NetworkBaseView( - baseViewModel: model, - child: FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: model.medicationForInPatient.length, - itemBuilder: (context, index) { - //model.medicationForInPatient.length, - return InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: - PrescriptionItemsInPatientPage( - prescriptionIndex: index, - prescriptions: - model.medicationForInPatient[ - index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - startOn: AppDateUtils - .getDateTimeFromServerFormat( - model - .medicationForInPatient[ - index] - .startDatetime, - ), - stopOn: AppDateUtils - .getDateTimeFromServerFormat( - model - .medicationForInPatient[ - index] - .stopDatetime, - ), - ), - ), - ), - child: InPatientDoctorCard( - doctorName: model - .medicationForInPatient[index] - .pHRItemDescription, - profileUrl: 'sss', - branch: 'hamza', - clinic: 'basheer', - isPrescriptions: true, - appointmentDate: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .prescriptionDatetime, - ), - createdBy: model - .medicationForInPatient[index] - .doctorName - .toString(), - )); - }), - if (model.medicationForInPatient.length == 0) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noPrescriptionsFound), - ) - ], - ), - ) - ], - ), - ), - ))); - } -} diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart deleted file mode 100644 index 01ba6a91..00000000 --- a/lib/screens/prescription/update_prescription_form.dart +++ /dev/null @@ -1,1059 +0,0 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; - -import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.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/dialogs/dailog-list-select.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class UpdatePrescriptionForm extends StatefulWidget { - final String drugName; - final String doseStreangth; - final int drugId; - final String remarks; - final PatiantInformtion patient; - final String duration; - final String route; - final String dose; - final String doseUnit; - final String enteredRemarks; - final String startDate; - final String frequency; - final String drugNameGeneric; - final String uom; - final int box; - - final PrescriptionViewModel model; - - UpdatePrescriptionForm( - {this.drugName, - this.doseStreangth, - this.drugId, - this.remarks, - this.patient, - this.duration, - this.route, - this.dose, - this.startDate, - this.doseUnit, - this.enteredRemarks, - this.frequency, - this.model, - this.drugNameGeneric, - this.uom, - this.box}); - @override - _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); -} - -class _UpdatePrescriptionFormState extends State { - TextEditingController strengthController = TextEditingController(); - TextEditingController remarksController = TextEditingController(); - int testNum = 0; - int strengthChar; - PatiantInformtion patient; - dynamic route; - dynamic doseTime; - dynamic frequencyUpdate; - dynamic updatedDuration; - dynamic units; - GetMedicationResponseModel newSelectedMedication; - GlobalKey key = - new GlobalKey>(); - List indicationList; - dynamic indication; - DateTime selectedDate; - @override - void initState() { - super.initState(); - strengthController.text = widget.doseStreangth; - remarksController.text = widget.remarks; - indicationList = List(); - - dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; - dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; - dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; - dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; - dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; - dynamic indication7 = {"id": 551, "name": "Asterixis"}; - dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; - dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; - dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; - - indicationList.add(indication1); - indicationList.add(indication2); - indicationList.add(indication3); - indicationList.add(indication4); - indicationList.add(indication5); - indicationList.add(indication6); - indicationList.add(indication7); - indicationList.add(indication8); - indicationList.add(indication9); - indicationList.add(indication10); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { - return BaseView( - onModelReady: (model) async { - await model.getMedicationList(); - await model.getMedicationStrength(); - await model.getMedicationDuration(); - await model.getMedicationRoute(); - await model.getMedicationFrequency(); - await model.getMedicationDoseTime(); - await model.getItem(itemID: widget.drugId); - //await model.getMedicationIndications(); - route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); - doseTime = - model.getLookupById(model.medicationDoseTimeList, widget.dose); - updatedDuration = model.getLookupById( - model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); - frequencyUpdate = model.getLookupById( - model.medicationFrequencyList, widget.frequency); - }, - builder: - (BuildContext context, MedicineViewModel model, Widget child) => - NetworkBaseView( - baseViewModel: model, - child: GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: DraggableScrollableSheet( - initialChildSize: 0.98, - maxChildSize: 0.99, - minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.5, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Column( - children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // setState(() { - // newSelectedMedication = null; - // }); - // } - // : null, - // child: newSelectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // decoration: - // textFieldSelectorDecoration( - // widget.drugNameGeneric, - // newSelectedMedication != null - // ? newSelectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => newSelectedMedication = - // item), - // key: key, - // suggestions: - // model.allMedicationList, - // itemBuilder: (context, - // suggestion) => - // new Padding( - // child: AppText(suggestion - // .description + - // '/' + - // suggestion.genericName), - // padding: - // EdgeInsets.all(8.0)), - // itemSorter: (a, b) => 1, - // itemFilter: (suggestion, input) => - // suggestion.genericName - // .toLowerCase() - // .startsWith( - // input.toLowerCase()) || - // suggestion.description - // .toLowerCase() - // .startsWith( - // input.toLowerCase()) || - // suggestion.keywords - // .toLowerCase() - // .startsWith( - // input.toLowerCase()), - // ) - // : TextField( - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // newSelectedMedication != null - // ? newSelectedMedication - // .description + - // ('${newSelectedMedication.genericName}') - // : null, - // true, - // ), - // enabled: false, - // ), - // ), - // ), - // SizedBox( - // height: 12, - // ), - Container( - height: - MediaQuery.of(context).size.height * - 0.060, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.4900, - height: MediaQuery.of(context) - .size - .height * - 0.55, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), - // WhitelistingTextInputFormatter - // .digitsOnly - ], - - hintText: widget.doseStreangth, - fontSize: 15.0, - controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( - decimal: true, - ), - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - "Only 5 Digits allowed for strength"); - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, - child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units[ - 'description'] - : null, - true), - enabled: false, - ), - ), - ), - ], - ), - ), - SizedBox( - height: 12, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.itemMedicineListRoute != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, - attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'Route', - route != null - ? route['description'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDoseTimeList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationFrequencyList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate[ - 'nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDurationList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration[ - 'nameEn'] - .toString() - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: model.patientAssessmentList - .isNotEmpty - ? screenSize.height * 0.070 - : 0.0, - width: model.patientAssessmentList - .isNotEmpty - ? double.infinity - : 0.0, - child: model.patientAssessmentList - .isNotEmpty - ? Row( - children: [ - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, - child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() - : '', - indication != null - ? indication[ - 'name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.61, - child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - maxLines: 3, - decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .asciiDesc - .toString() - : '', - indication != null - ? indication[ - 'name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - ], - ) - : null), - SizedBox( - height: 12.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - AppDateUtils.getDateFormatted( - DateTime.parse( - widget.startDate)), - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - // duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - "UOM", - widget.uom != null - ? widget.uom - : null, - true), - // enabled: false, - readOnly: true, - ), - ), - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - // duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'Box Quantity', - widget.box != null - ? "Box Quantity: " + - widget.box.toString() - : null, - true), - // enabled: false, - readOnly: true, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - controller: remarksController, - maxLines: 7, - minLines: 4, - ), - ), - SizedBox( - height: 10.0, - ), - SizedBox( - height: - MediaQuery.of(context).size.height * - 0.08, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription' - .toUpperCase(), - onPressed: () { - if (double.parse( - strengthController.text) > - 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); - return; - } - if (double.parse( - strengthController - .text) == - 0.0) { - DrAppToastMsg.showErrorToast( - "strength can't be zero"); - return; - } - if (strengthController - .text.length > - 4) { - DrAppToastMsg.showErrorToast( - "strength can't be more then 4 digits "); - return; - } - // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) - updatePrescription( - newStartDate: selectedDate, - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : widget - .doseStreangth, - newUnit: units != null - ? units['parameterCode'] - .toString() - : widget.doseUnit, - doseUnit: widget.doseUnit, - doseStreangth: - widget.doseStreangth, - duration: widget.duration, - startDate: widget.startDate, - doseId: widget.dose, - frequencyId: widget.frequency, - routeId: widget.route, - patient: widget.patient, - model: widget.model, - newDuration: - updatedDuration != null - ? updatedDuration['id'] - .toString() - : widget.duration, - drugId: widget.drugId, - remarks: remarksController - .text, - route: route != null - ? route['parameterCode'] - .toString() - : widget.route, - frequency: - frequencyUpdate != null - ? frequencyUpdate[ - 'id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'] - .toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); - Navigator.pop(context); - }, - ), - ], - ), - ), - ], - ), - ], - ), - ), - )), - ); - }), - ), - ), - ); - }); - } - - selectDate(BuildContext context, PrescriptionViewModel model) async { - Helpers.hideKeyboard(context); - DateTime selectedDate; - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now(), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - this.selectedDate = picked; - }); - } - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - updatePrescription( - {PrescriptionViewModel model, - int drugId, - String newDrugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - DateTime newStartDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { - //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = - new PostPrescriptionReqModel(); - List sss = List(); - - updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; - updatePrescriptionReqModel.clinicID = patient.clinicId; - updatePrescriptionReqModel.episodeID = patient.episodeNo; - updatePrescriptionReqModel.patientMRN = patient.patientMRN; - - sss.add(PrescriptionRequestModel( - covered: true, - dose: newDoseStreangth.isNotEmpty - ? double.parse(newDoseStreangth) - : double.parse(doseStreangth), - //frequency.isNotEmpty ? int.parse(dose) : 1, - itemId: drugId, - doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), - route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty - ? int.parse(frequency) - : int.parse(frequencyId), - remarks: remarks.isEmpty ? enteredRemarks : remarks, - approvalRequired: true, - icdcode10Id: "test2", - doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty - ? int.parse(newDuration) - : int.parse(duration), - doseStartDate: - newStartDate != null ? newStartDate.toIso8601String() : startDate)); - updatePrescriptionReqModel.prescriptionRequestModel = sss; - //postProcedureReqModel.procedures = controlsProcedure; - - await model.updatePrescription( - updatePrescriptionReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('Medication has been updated'); - } - } -} - -void updatePrescriptionForm( - {context, - String drugName, - String drugNameGeneric, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String uom, - int box, - String startDate}) { - TextEditingController remarksController = TextEditingController(); - TextEditingController doseController = TextEditingController(); - TextEditingController frequencyController = TextEditingController(); - TextEditingController routeController = TextEditingController(); - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext context) { - return UpdatePrescriptionForm( - box: box, - uom: uom, - drugName: drugName, - patient: patient, - doseStreangth: doseStreangth, - remarks: remarks, - drugId: drugId, - enteredRemarks: enteredRemarks, - duration: duration, - dose: dose, - doseUnit: doseUnit, - frequency: frequency, - route: rouat, - startDate: startDate, - model: model, - drugNameGeneric: drugNameGeneric, - ); - }); -} diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 06e56f03..b0593b06 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -2,11 +2,8 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -63,26 +60,33 @@ class _ExpansionProcedureState extends State { Radius.circular(5.0), )), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Row( - children: [ + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Icon( Icons.folder, size: 20, - color: Color(0xff575757), + color: AppGlobal.appTextColor, ), Expanded( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), child: AppText( widget.isProcedure == true - ? "Procedures for " + widget.procedureTempleteModel.templateName - : "Prescription for " + widget.procedureTempleteModel.templateName, + ? "Procedures for " + + widget.procedureTempleteModel.templateName + : "Prescription for " + + widget.procedureTempleteModel.templateName, + letterSpacing: -0.72, fontSize: 16.0, - variant: "bodyText", - bold: true, - color: Color(0xff575757)), + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600, + ), + ), ), ], @@ -91,9 +95,11 @@ class _ExpansionProcedureState extends State { width: 25, height: 25, child: Icon( - _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.grey[800], - size: 22, + _isShowMore + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: AppGlobal.appTextColor, + size: 28, ), ) ], @@ -113,7 +119,8 @@ class _ExpansionProcedureState extends State { )), duration: Duration(milliseconds: 7000), child: Column( - children: widget.procedureTempleteModel.procedureTemplate.map((itemProcedure) { + children: widget.procedureTempleteModel.procedureTemplate + .map((itemProcedure) { return InkWell( onTap: () { if (widget.isProcedure) { @@ -137,17 +144,23 @@ class _ExpansionProcedureState extends State { Row( children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 11), + padding: const EdgeInsets.symmetric( + horizontal: 11), child: widget.isProcedure ? Checkbox( - value: widget.isEntityFavListSelected(itemProcedure), + value: widget.isEntityFavListSelected( + itemProcedure), activeColor: Color(0xffD02127), onChanged: (bool newValue) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { - widget.removeFavProcedure(itemProcedure); + if (widget + .isEntityFavListSelected( + itemProcedure)) { + widget.removeFavProcedure( + itemProcedure); } else { - widget.addFavProcedure(itemProcedure); + widget.addFavProcedure( + itemProcedure); } }); }) @@ -160,9 +173,13 @@ class _ExpansionProcedureState extends State { })), Expanded( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), child: AppText(itemProcedure.procedureName, - fontSize: 14.0, variant: "bodyText", bold: true, color: Color(0xff575757)), + fontSize: 14.0, + variant: "bodyText", + bold: true, + color: Color(0xff575757)), ), ), ], diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 82bb649c..53283065 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -1,15 +1,19 @@ //import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + class ProcedureCard extends StatelessWidget { final Function onTap; @@ -19,6 +23,7 @@ class ProcedureCard extends StatelessWidget { final PatiantInformtion patient; final int doctorID; final bool isInpatient; + const ProcedureCard({ Key key, this.onTap, @@ -55,13 +60,15 @@ class ProcedureCard extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: entityList.orderType == 0 ? Colors.black : Colors.red[500], + color: + entityList.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( child: Container( padding: EdgeInsets.only( - left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), + left: projectViewModel.isArabic ? 0 : 15, + right: projectViewModel.isArabic ? 15 : 0), child: InkWell( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -74,15 +81,20 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.orderType == 0 ? 'Routine' : 'Urgent', - color: entityList.orderType == 0 ? Colors.black : Colors.red[800], + entityList.orderType == 0 + ? 'Routine' + : 'Urgent', + color: entityList.orderType == 0 + ? Colors.black + : AppGlobal.appRedColor, fontWeight: FontWeight.w600, ), SizedBox( height: 5, ), AppText( - entityList.procedureName, + Helpers.convertToTitleCase( + entityList.procedureName), bold: true, fontSize: 14, ), @@ -97,13 +109,18 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertISOStringToDateTime( + entityList.createdOn), + isMonthShort: true, + isArabic: projectViewModel.isArabic, + )}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.createdOn))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -139,18 +156,21 @@ class ProcedureCard extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + margin: EdgeInsets.only( + left: 0, top: 25, right: 0, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: ClipRRect( borderRadius: BorderRadius.circular(20.0), - child: Image.network( - 'assets/images/male_avatar.png', + child: Image.asset( + 'assets/images/dr_avatar.png', height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { return Text('No Image'); }, ))), @@ -158,12 +178,14 @@ class ProcedureCard extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), + margin: EdgeInsets.only( + left: 10, top: 25, right: 10, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.doctorName, + Helpers.convertToTitleCase( + entityList.doctorName), fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -171,7 +193,8 @@ class ProcedureCard extends StatelessWidget { ), if (entityList.clinicDescription != null) AppText( - entityList.clinicDescription, + Helpers.convertToTitleCase( + entityList.clinicDescription), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.4 * SizeConfig.textMultiplier, @@ -190,11 +213,14 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList.remarks.toString() ?? '', + entityList.remarks!= null?Helpers.convertToTitleCase( + entityList.remarks.toString()) : + '', fontSize: 12, ), ), - if ((entityList.categoryID == 2 || entityList.categoryID == 4) && + if ((entityList.categoryID == 2 || + entityList.categoryID == 4) && doctorID == entityList.doctorID && !isInpatient) InkWell( diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 7f4e49b2..85261de2 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart'; @@ -11,22 +11,21 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'ProcedureType.dart'; class AddFavouriteProcedure extends StatefulWidget { - final ProcedureViewModel model; + final ProcedureViewModel previousProcedureViewModel; final PrescriptionViewModel prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; AddFavouriteProcedure({ Key key, - this.model, + this.previousProcedureViewModel, this.prescriptionModel, this.patient, @required this.procedureType, @@ -47,109 +46,99 @@ class _AddFavouriteProcedureState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: false, - baseViewModel: model, - body: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - (model.templateList.length != 0) - ? Expanded( - child: EntityListCheckboxSearchFavProceduresWidget( - isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), - model: model, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - isEntityFavListSelected: (master) => isEntityListSelected(master), - groupProcedures: groupProcedures, - selectProcedures: (selectedProcedure) { - setState(() { - groupProcedures = selectedProcedure; - }); - }, - ), - ) - : Container( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 50.0), - child: AppText('You Don\'t have favorite prescription'), - ), - ), - ], - ), - bottomSheet: Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.procedureType.getAddButtonTitle(context) ?? - TranslationBase.of(context).addSelectedProcedures, - color: Color(0xff359846), - disabled: model.templateList.length == 0 ? true : false, - fontWeight: FontWeight.w700, - onPressed: () { - if (widget.procedureType == ProcedureType.PRESCRIPTION) { - if (groupProcedures == null) { - DrAppToastMsg.showErrorToast( - 'Please Select item ', - ); - return; - } + builder: (BuildContext context, ProcedureViewModel model_, + Widget child) => + AppScaffold( + isShowAppBar: false, + baseViewModel: model, + body: Column(children: [ + (widget.previousProcedureViewModel.templateList.length != 0) + ? Expanded( + child: EntityListCheckboxSearchFavProceduresWidget( + isProcedure: !(widget.procedureType == + ProcedureType.PRESCRIPTION), + model: widget.previousProcedureViewModel, + removeFavProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addFavProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + isEntityFavListSelected: (master) => + isEntityListSelected(master), + groupProcedures: groupProcedures, + selectProcedures: (selectedProcedure) { + setState(() { + groupProcedures = selectedProcedure; + }); + }, + ), + ) + : ErrorMessage( + error: TranslationBase.of(context) + .youDoNotHaveFavoritePrescription, + ), + ]), + bottomSheet: BottomSheetDialogButton( + label: widget.procedureType.getAddButtonTitle(context) ?? + TranslationBase.of(context).addSelectedProcedures, + onTap: () async { + if (widget.procedureType == ProcedureType.PRESCRIPTION) { + if (groupProcedures == null) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseSelectItem, + ); + return; + } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.prescriptionModel, - groupProcedures: groupProcedures, - ), - settings: RouteSettings(name: 'PrescriptionCheckOutScreen')), - ); - } else { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).fillTheMandatoryProcedureDetails, + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PrescriptionCheckOutScreen( + patient: widget.patient, + model: widget.prescriptionModel, + groupProcedures: groupProcedures, + ), + settings: RouteSettings( + name: 'PrescriptionCheckOutScreen')), + ); + } else { + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProcedureCheckOutScreen( + items: entityList, + model: model, + patient: widget.patient, + addButtonTitle: widget.procedureType + .getAddButtonTitle(context), + toolbarTitle: widget.procedureType + .getToolbarLabel(context), + ), + settings: + RouteSettings(name: 'ProcedureCheckOutScreen')), ); - return; } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ProcedureCheckOutScreen( - items: entityList, - model: model, - patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), - ), - settings: RouteSettings(name: 'ProcedureCheckOutScreen')), - ); - } - }, - ), - ], - ), - ), - ), + })), ); } bool isEntityListSelected(ProcedureTempleteDetailsModel masterKey) { Iterable history = entityList.where( - (element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName); + (element) => + masterKey.templateID == element.templateID && + masterKey.procedureName == element.procedureName); if (history.length > 0) { return true; } diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index e0b7374f..609c6808 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; import 'ProcedureType.dart'; import 'entity_list_checkbox_search_widget.dart'; @@ -183,7 +184,7 @@ class _AddProcedurePageState extends State { AppButton( title: procedureType.getAddButtonTitle(context), fontWeight: FontWeight.w700, - color: Color(0xff359846), + color: AppGlobal.appGreenColor, onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index e9ab695b..921b90b4 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -1,15 +1,15 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription.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/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; - +import 'package:provider/provider.dart'; +import '../../core/viewModel/project_view_model.dart'; +import '../../util/tab_helper.dart'; import 'ProcedureType.dart'; import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; @@ -68,172 +68,115 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) async { + await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); + }, builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.25, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle(title: procedureType.getToolbarLabel(context),), + body: NetworkBaseView( + baseViewModel: model, + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + + procedureType + .getFavouriteTabName(context), + isFirst: true,context: context + ), + tabWidget( + screenSize, + _activeTab == 1, + procedureType.getAllLabelName(context), + isLast: true,context: context + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - procedureType.getToolbarLabel(context), - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, + AddFavouriteProcedure( + previousProcedureViewModel: model, + prescriptionModel: + widget.prescriptionModel, + patient: patient, + procedureType: procedureType, ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), - child: Container( - height: - MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - procedureType - .getFavouriteTabName(context), - ), - tabWidget( - screenSize, - _activeTab == 1, - procedureType.getAllLabelName(context), - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavouriteProcedure( - model: this.model, - prescriptionModel: - widget.prescriptionModel, - patient: patient, - procedureType: procedureType, - ), - if (widget.procedureType == - ProcedureType.PRESCRIPTION) - PrescriptionFormWidget( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel - .prescriptionList) - else - AddProcedurePage( - model: this.model, - patient: patient, - procedureType: procedureType, - ), - ], - ), - ), - ], - ), + if (widget.procedureType == + ProcedureType.PRESCRIPTION) + AddPrescription( + widget.prescriptionModel, + widget.patient, + widget.prescriptionModel.prescriptionList, + ) + else + AddProcedurePage( + model: this.model, + patient: patient, + procedureType: procedureType, ), - ), ], ), ), - ); - }), + ], + ), + ) ), ), ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget( + Size screenSize, + bool isActive, + String title, { + int counter = -1, + bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + context, + }) { + ProjectViewModel projectViewModel = Provider.of(context); + return Center( child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), + height: TabHelper.getTabHeight(context), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: isActive, + isFirst: isFirst, + isMiddle: isMiddle, + isLast: isLast, + projectViewModel: projectViewModel), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), + + TabHelper.getTabText(title: title, isActive: isActive), if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), - fontWeight: FontWeight.w700, - ), - ), - ), - ), + TabHelper.getTabCounter(isActive: isActive, counter: counter) ], ), ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 725bb007..7038fbc9 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -9,6 +9,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; + class EntityListCheckboxSearchWidget extends StatefulWidget { final ProcedureViewModel model; final Function addSelectedHistories; @@ -59,6 +61,7 @@ class _EntityListCheckboxSearchWidgetState } TextEditingController remarksController = TextEditingController(); + @override Widget build(BuildContext context) { return Container( @@ -228,7 +231,7 @@ class _EntityListCheckboxSearchWidgetState : Center( child: Container( child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), + color: AppGlobal.appRedColor), ), ) ], diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 8d4f93ed..1aa73c25 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -1,16 +1,14 @@ -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import 'package:flutter/services.dart'; +import '../../config/config.dart'; +import '../../widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { @@ -53,7 +51,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { _EntityListCheckboxSearchFavProceduresWidgetState(); } -class _EntityListCheckboxSearchFavProceduresWidgetState extends State { +class _EntityListCheckboxSearchFavProceduresWidgetState + extends State { int selectedType = 0; int typeUrgent; int typeRegular; @@ -76,60 +75,71 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items; final ProcedureViewModel model; @@ -23,10 +24,15 @@ class ProcedureCheckOutScreen extends StatefulWidget { final String toolbarTitle; ProcedureCheckOutScreen( - {this.items, this.model, this.patient, @required this.addButtonTitle, @required this.toolbarTitle}); + {this.items, + this.model, + this.patient, + @required this.addButtonTitle, + @required this.toolbarTitle}); @override - _ProcedureCheckOutScreenState createState() => _ProcedureCheckOutScreenState(); + _ProcedureCheckOutScreenState createState() => + _ProcedureCheckOutScreenState(); } class _ProcedureCheckOutScreenState extends State { @@ -37,7 +43,8 @@ class _ProcedureCheckOutScreenState extends State { @override Widget build(BuildContext context) { return BaseView( - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: false, body: SingleChildScrollView( @@ -82,8 +89,10 @@ class _ProcedureCheckOutScreenState extends State { widget.items.length, (index) => Container( margin: EdgeInsets.only(bottom: 15.0), - decoration: - BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10.0))), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(10.0))), child: ExpansionTile( initiallyExpanded: true, title: Row( @@ -96,7 +105,9 @@ class _ProcedureCheckOutScreenState extends State { SizedBox( width: 6.0, ), - Expanded(child: AppText(widget.items[index].procedureName)), + Expanded( + child: AppText( + widget.items[index].procedureName)), ], ), children: [ @@ -109,9 +120,11 @@ class _ProcedureCheckOutScreenState extends State { Row( children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 11), + padding: const EdgeInsets.symmetric( + horizontal: 11), child: AppText( - TranslationBase.of(context).orderType, + TranslationBase.of(context) + .orderType, fontWeight: FontWeight.w700, color: Color(0xff2B353E), ), @@ -123,11 +136,14 @@ class _ProcedureCheckOutScreenState extends State { Radio( activeColor: Color(0xFFD02127), value: 0, - groupValue: widget.items[index].selectedType, + groupValue: + widget.items[index].selectedType, onChanged: (value) { - widget.items[index].selectedType = 0; + widget.items[index].selectedType = + 0; setState(() { - widget.items[index].type = value.toString(); + widget.items[index].type = + value.toString(); }); }, ), @@ -138,12 +154,15 @@ class _ProcedureCheckOutScreenState extends State { ), Radio( activeColor: Color(0xFFD02127), - groupValue: widget.items[index].selectedType, + groupValue: + widget.items[index].selectedType, value: 1, onChanged: (value) { - widget.items[index].selectedType = 1; + widget.items[index].selectedType = + 1; setState(() { - widget.items[index].type = value.toString(); + widget.items[index].type = + value.toString(); }); }, ), @@ -162,7 +181,8 @@ class _ProcedureCheckOutScreenState extends State { height: 2.0, ), Padding( - padding: EdgeInsets.symmetric(horizontal: 12, vertical: 15.0), + padding: EdgeInsets.symmetric( + horizontal: 12, vertical: 15.0), child: TextFields( hintText: TranslationBase.of(context).remarks, controller: remarksController, @@ -194,8 +214,9 @@ class _ProcedureCheckOutScreenState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, - color: Color(0xff359846), + title: widget.addButtonTitle ?? + TranslationBase.of(context).addSelectedProcedures, + color: AppGlobal.appGreenColor, fontWeight: FontWeight.w700, onPressed: () async { List entityList = List(); @@ -215,7 +236,9 @@ class _ProcedureCheckOutScreenState extends State { ); Navigator.pop(context); await model.preparePostProcedure( - entityList: entityList, patient: widget.patient, remarks: remarksController.text); + entityList: entityList, + patient: widget.patient, + remarks: remarksController.text); Navigator.pop(context); Navigator.pop(context); }, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 79fb961c..8f8c8967 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -2,18 +2,19 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/material.dart'; +import '../../widgets/shared/errors/error_message.dart'; import 'ProcedureCard.dart'; import 'ProcedureType.dart'; import 'base_add_procedure_tab_page.dart'; @@ -36,9 +37,12 @@ class ProcedureScreen extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( + onModelReady: (model) => model.getProcedure( + mrn: patient.patientId, + patientType: patientType, + appointmentNo: patient.appointmentNo), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, @@ -54,7 +58,8 @@ class ProcedureScreen extends StatelessWidget { SizedBox( height: 12, ), - if (model.procedureList.length == 0 && patient.patientStatusType != 43) + if (model.procedureList.length == 0 && + patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -74,7 +79,8 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -94,7 +100,8 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if ((patient.patientStatusType != null && patient.patientStatusType == 43) || + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) InkWell( onTap: () { @@ -154,21 +161,32 @@ class ProcedureScreen extends StatelessWidget { ...List.generate( model.procedureList[0].rowcount, (index) => ProcedureCard( - categoryID: model.procedureList[0].entityList[index].categoryID, + categoryID: + model.procedureList[0].entityList[index].categoryID, entityList: model.procedureList[0].entityList[index], onTap: () { - if (model.procedureList[0].entityList[index].categoryID == 2 || + if (model.procedureList[0].entityList[index].categoryID == + 2 || model.procedureList[0].entityList[index].categoryID == 4) updateProcedureForm(context, model: model, patient: patient, - remarks: model.procedureList[0].entityList[index].remarks, - orderType: model.procedureList[0].entityList[index].orderType.toString(), - orderNo: model.procedureList[0].entityList[index].orderNo, - procedureName: model.procedureList[0].entityList[index].procedureName, - categoreId: model.procedureList[0].entityList[index].categoryID.toString(), - procedureId: model.procedureList[0].entityList[index].procedureId, - limetNo: model.procedureList[0].entityList[index].lineItemNo); + remarks: model + .procedureList[0].entityList[index].remarks, + orderType: model + .procedureList[0].entityList[index].orderType + .toString(), + orderNo: model + .procedureList[0].entityList[index].orderNo, + procedureName: model.procedureList[0] + .entityList[index].procedureName, + categoreId: model + .procedureList[0].entityList[index].categoryID + .toString(), + procedureId: model.procedureList[0] + .entityList[index].procedureId, + limetNo: model.procedureList[0].entityList[index] + .lineItemNo); // } else // Helpers.showErrorToast( // 'You Cant Update This Procedure'); @@ -178,22 +196,12 @@ class ProcedureScreen extends StatelessWidget { ), ), if (model.state == ViewState.ErrorLocal || - (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) + (model.procedureList.isNotEmpty && + model.procedureList[0].entityList.isEmpty)) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '), - ) - ], - ), - ), + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )), ], ), ), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index a11ac875..a7e0d22f 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -69,12 +69,14 @@ class UpdateProcedureWidget extends StatefulWidget { this.categoryId, this.orderNo, this.limetNo}); + @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } class _UpdateProcedureWidgetState extends State { int selectedType = 0; + setSelectedType(int val) { setState(() { selectedType = val; @@ -88,6 +90,7 @@ class _UpdateProcedureWidgetState extends State { List entityList = List(); dynamic selectedCategory; + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -244,7 +247,7 @@ class _UpdateProcedureWidgetState extends State { children: [ AppText(TranslationBase.of(context).orderType), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, value: 0, groupValue: selectedType, onChanged: (value) { @@ -253,7 +256,7 @@ class _UpdateProcedureWidgetState extends State { ), Text('routine'), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, groupValue: selectedType, value: 1, onChanged: (value) { @@ -294,7 +297,7 @@ class _UpdateProcedureWidgetState extends State { //alignment: WrapAlignment.center, children: [ AppButton( - color: Color(0xff359846), + color: AppGlobal.appGreenColor, title: TranslationBase.of(context) .updateProcedure .toUpperCase(), diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index c06a8722..468df8df 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -1,9 +1,8 @@ -import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/patient_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/util/dr_app_toast_msg.dart'; @@ -32,7 +31,8 @@ class _QrReaderScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader, + appBarTitle: + TranslationBase.of(context).qr + TranslationBase.of(context).reader, body: Center( child: Container( margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), @@ -50,7 +50,9 @@ class _QrReaderScreenState extends State { height: 7, ), AppText(TranslationBase.of(context).scanQrCode, - fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center), + fontSize: 14, + fontWeight: FontWeight.w400, + textAlign: TextAlign.center), SizedBox( height: 15, ), @@ -82,15 +84,21 @@ class _QrReaderScreenState extends State { } _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { - var result = await BarcodeScanner.scan(); + var result = (await BarcodeScanner.scan()).rawContent; if (result != "") { List listOfParams = result.split(','); int patientID = 0; if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); - PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( - patientID: patientID, clinicID: 0, doctorID: 0, projectID: int.parse(listOfParams[0])); + PatientSearchRequestModel patientSearchRequestModel = + PatientSearchRequestModel( + patientID: patientID, + clinicID: 0, + doctorID: 0, + projectID: int.parse(listOfParams[0])); - await model.getInPatientList(patientSearchRequestModel, isMyInpatient: false).then((d) { + await model + .getInPatientList(patientSearchRequestModel, isMyInpatient: false) + .then((d) { if (model.state != ViewState.ErrorLocal) { if (model.inPatientList.isEmpty) DrAppToastMsg.showErrorToast('No patient'); diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index db8a0140..f52d1dbf 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -19,11 +19,13 @@ import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { ProjectViewModel projectsProvider; + @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => {model.getRescheduleLeave(), model.getCoveringDoctors()}, + onModelReady: (model) => + {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -48,7 +50,8 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), ), Column( - children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { + children: model.getReschduleLeave + .map((GetRescheduleLeavesResponse item) { return Padding( padding: const EdgeInsets.all(8.0), child: RoundedContainer( @@ -76,55 +79,77 @@ class AddRescheduleLeavScreen extends StatelessWidget { child: Wrap( children: [ Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - padding: EdgeInsets.all(3), - margin: EdgeInsets.only(top: 10), - child: AppText( - item.statusDescription, - fontWeight: FontWeight.bold, - color: item.status == 10 - ? Colors.red[800] - : item.status == 2 - ? HexColor('#CC9B14') - : item.status == 9 - ? AppGlobal.appGreenColor - : Colors.red, - fontSize: 14, - ), - ), - Padding( - padding: EdgeInsets.only(top: 10), - child: AppText( - AppDateUtils.convertStringToDateFormat( - item.createdOn, 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - )) - ]), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + padding: EdgeInsets.all(3), + margin: + EdgeInsets.only(top: 10), + child: AppText( + item.statusDescription, + fontWeight: FontWeight.bold, + color: item.status == 10 + ? Colors.red[800] + : item.status == 2 + ? HexColor( + '#CC9B14') + : item.status == 9 + ? AppGlobal + .appGreenColor + : Colors.red, + fontSize: 14, + ), + ), + Padding( + padding: EdgeInsets.only( + top: 10), + child: AppText( + AppDateUtils + .convertStringToDateFormat( + item.createdOn, + 'yyyy-MM-dd HH:mm'), + fontWeight: + FontWeight.bold, + )) + ]), SizedBox( height: 5, ), Container( child: AppText( item.requisitionType == 1 - ? TranslationBase.of(context).offTime + ? TranslationBase.of(context) + .offTime : item.requisitionType == 2 - ? TranslationBase.of(context).holiday + ? TranslationBase.of( + context) + .holiday : item.requisitionType == 3 - ? TranslationBase.of(context).changeOfSchedule - : TranslationBase.of(context).newSchedule, + ? TranslationBase.of( + context) + .changeOfSchedule + : TranslationBase.of( + context) + .newSchedule, fontWeight: FontWeight.bold, )), SizedBox( height: 5, ), Row(children: [ - AppText(TranslationBase.of(context).startDate), + AppText(TranslationBase.of(context) + .startDate), AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeFrom, 'yyyy-MM-dd HH:mm'), + AppDateUtils + .convertStringToDateFormat( + item.dateTimeFrom, + 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) @@ -140,10 +165,14 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), Row( children: [ - AppText(TranslationBase.of(context).endDate), AppText( - AppDateUtils.convertStringToDateFormat( - item.dateTimeTo, 'yyyy-MM-dd HH:mm'), + TranslationBase.of(context) + .endDate), + AppText( + AppDateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), fontWeight: FontWeight.bold, ) ], @@ -155,10 +184,13 @@ class AddRescheduleLeavScreen extends StatelessWidget { model.coveringDoctors.length > 0 ? Row(children: [ AppText( - TranslationBase.of(context).coveringDoctor, + TranslationBase.of(context) + .coveringDoctor, ), AppText( - getDoctor(model.coveringDoctors, item.coveringDoctorId), + getDoctor( + model.coveringDoctors, + item.coveringDoctorId), fontWeight: FontWeight.bold, ) ]) @@ -168,18 +200,31 @@ class AddRescheduleLeavScreen extends StatelessWidget { // .reasons, // fontWeight: FontWeight.bold, // ), - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: EdgeInsets.only(bottom: 5), - child: AppText(getReasons(model.allReasons, item.reasonId))), - (item.status == 2) - ? IconButton( - icon: Image.asset('assets/images/edit.png'), - // color: AppGlobal.appGreenColor, //Colors.black, - onPressed: () => {openLeave(context, true, extendedData: item)}, - ) - : SizedBox(), - ]), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 5), + child: AppText(getReasons( + model.allReasons, + item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + // color: AppGlobal.appGreenColor, //Colors.black, + onPressed: () => { + openLeave( + context, true, + extendedData: + item) + }, + ) + : SizedBox(), + ]), ], ), SizedBox( diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 925d0bb7..2c9430d3 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -28,7 +28,9 @@ Helpers helpers = Helpers(); class RescheduleLeaveScreen extends StatefulWidget { final isUpdate; final updateData; + RescheduleLeaveScreen(this.isUpdate, this.updateData); + @override _RescheduleLeaveScreen createState() => _RescheduleLeaveScreen(); } @@ -52,6 +54,7 @@ class _RescheduleLeaveScreen extends State { String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); + void _presentDatePicker(id) { var date = new DateTime.now(); var initialDate = id == 'fromDate' @@ -99,7 +102,9 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; + offTime = widget.updateData != null + ? widget.updateData.requisitionType.toString() + : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -127,136 +132,25 @@ class _RescheduleLeaveScreen extends State { widthFactor: 0.9, child: ListView( children: [ - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // width: double.infinity, - // child: Padding( - // padding: EdgeInsets.only( - // top: SizeConfig.widthMultiplier * 0.9, - // bottom: - // SizeConfig.widthMultiplier * 0.9, - // right: SizeConfig.widthMultiplier * 3, - // left: SizeConfig.widthMultiplier * 3), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // // add Expanded to have your dropdown button fill remaining space - // child: - // DropdownButtonHideUnderline( - // child: new IgnorePointer( - // ignoring: true, - // child: DropdownButton( - // focusColor: - // Colors.grey, - // isExpanded: true, - // dropdownColor: - // Colors.grey, - // value: getClinicName( - // model) ?? - // "", - // iconSize: 0, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext - // context) { - // return model - // .getClinicNameList() - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize - // .max, - // children: < - // Widget>[ - // AppText( - // item, - // fontSize: - // SizeConfig.textMultiplier * - // 2.1, - // color: Colors - // .grey[ - // 500], - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: - // (newValue) => - // {}, - // items: model - // .getClinicNameList() - // .map((item) { - // return DropdownMenuItem( - // value: item - // .toString(), - // child: Text( - // item, - // textAlign: - // TextAlign - // .end, - // ), - // ); - // }).toList(), - // ))), - // ), - // ], - // ) - // ], - // ), - // )), - - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // padding: EdgeInsets.all(5), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // new IgnorePointer( - // ignoring: true, - // child: AppTextFormField( - // readOnly: true, - // hintText: profile != null - // ? profile['DoctorName'] - // : "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS)) - // ], - // ), - // ), - Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -264,22 +158,35 @@ class _RescheduleLeaveScreen extends State { model2.allOffTime.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButtonHideUnderline( + child: + DropdownButton( // focusColor: Colors.grey, isExpanded: true, - value: offTime == null ? model2.allOffTime[0]['code'] : offTime, + value: offTime == null + ? model2.allOffTime[0] + ['code'] + : offTime, iconSize: 40, elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allOffTime.map((item) { + selectedItemBuilder: + (BuildContext + context) { + return model2.allOffTime + .map((item) { return Row( - mainAxisSize: MainAxisSize.max, + mainAxisSize: + MainAxisSize + .max, children: [ AppText( - item['description'], + item[ + 'description'], - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig + .textMultiplier * + 2.1, // color: // Colors.grey, ), @@ -293,21 +200,29 @@ class _RescheduleLeaveScreen extends State { }); if (offTime == '1') { model2.getReasons(18); - } else if (offTime == '2') { + } else if (offTime == + '2') { model2.getReasons(19); - } else if (offTime == '3' || offTime == '5') { - model2.getReasons(102); + } else if (offTime == + '3' || + offTime == '5') { + model2 + .getReasons(102); setState(() { offTime = newValue; }); } }, - items: model2.allOffTime.map((item) { - return DropdownMenuItem( - value: item['code'].toString(), + items: model2.allOffTime + .map((item) { + return DropdownMenuItem< + String>( + value: item['code'] + .toString(), child: Text( item['description'], - textAlign: TextAlign.end, + textAlign: + TextAlign.end, ), ); }).toList(), @@ -325,24 +240,37 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of(context).fromDate, + hintText: TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, + prefix: IconButton( + icon: Icon(Icons + .calendar_today)), + textInputType: + TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker('fromDate'); + _presentDatePicker( + 'fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (val) => fromDate = val, - onSaved: (val) => fromDate = val, + onChanged: (val) => + fromDate = val, + onSaved: (val) => + fromDate = val, ) ], )), @@ -352,24 +280,37 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all( + Radius.circular( + 6.0)), + border: Border.all( + width: 1.0, + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: TranslationBase.of(context).fromTime, - type: DateTimePickerType.time, + timeHintText: + TranslationBase.of( + context) + .fromTime, + type: DateTimePickerType + .time, controller: _controller4, - onChanged: (val) => fromTime = val, + onChanged: (val) => + fromTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => fromTime = val, + onSaved: (val) => + fromTime = val, ) ], ), @@ -379,24 +320,37 @@ class _RescheduleLeaveScreen extends State { child: Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all( + Radius.circular( + 6.0)), + border: Border.all( + width: 1.0, + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: TranslationBase.of(context).toTime, - type: DateTimePickerType.time, + timeHintText: + TranslationBase.of( + context) + .toTime, + type: DateTimePickerType + .time, controller: _controller5, - onChanged: (val) => toTime = val, + onChanged: (val) => + toTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => toTime = val, + onSaved: (val) => + toTime = val, ) ], ), @@ -411,21 +365,34 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of(context).fromDate, + hintText: + TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, + prefix: IconButton( + icon: Icon(Icons + .calendar_today)), + textInputType: + TextInputType.number, readOnly: true, - controller: _toDateController, + controller: + _toDateController, onTap: () { - _presentDatePicker('fromDate'); + _presentDatePicker( + 'fromDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -438,21 +405,34 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of(context).toDate, + hintText: + TranslationBase + .of(context) + .toDate, readOnly: true, borderColor: Colors.white, - prefix: IconButton(icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController2, + prefix: IconButton( + icon: Icon(Icons + .calendar_today)), + textInputType: + TextInputType.number, + controller: + _toDateController2, onTap: () { - _presentDatePicker('toDate'); + _presentDatePicker( + 'toDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -467,17 +447,22 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -485,23 +470,39 @@ class _RescheduleLeaveScreen extends State { model2.allReasons.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButtonHideUnderline( + child: + DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: model2.allReasons[0]['id'].toString() ?? "", + value: model2 + .allReasons[0] + ['id'] + .toString() ?? + "", iconSize: 40, elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allReasons.map((item) { + selectedItemBuilder: + (BuildContext + context) { + return model2.allReasons + .map((item) { return Row( - mainAxisSize: MainAxisSize.max, + mainAxisSize: + MainAxisSize + .max, children: [ AppText( - projectsProvider.isArabic - ? item['nameAr'] - : item['nameEn'], - fontSize: SizeConfig.textMultiplier * 2.1, + projectsProvider + .isArabic + ? item[ + 'nameAr'] + : item[ + 'nameEn'], + fontSize: SizeConfig + .textMultiplier * + 2.1, // color: // Colors.grey, ), @@ -514,12 +515,20 @@ class _RescheduleLeaveScreen extends State { reason = newValue; }) }, - items: model2.allReasons.map((item) { - return DropdownMenuItem( - value: item['id'].toString(), + items: model2.allReasons + .map((item) { + return DropdownMenuItem< + String>( + value: item['id'] + .toString(), child: Text( - projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], - textAlign: TextAlign.end, + projectsProvider + .isArabic + ? item['nameAr'] + : item[ + 'nameEn'], + textAlign: + TextAlign.end, ), ); }).toList(), @@ -535,17 +544,22 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -556,35 +570,56 @@ class _RescheduleLeaveScreen extends State { child: DropdownSearch( mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: InputDecoration( - contentPadding: EdgeInsets.all(0), border: InputBorder.none), + dropdownSearchDecoration: + InputDecoration( + contentPadding: + EdgeInsets + .all(0), + border: + InputBorder + .none), //maxHeight: 300, - items: model2.coveringDoctors.map((item) { - return projectsProvider.isArabic - ? item['doctorNameN'] - : item['doctorName']; + items: model2 + .coveringDoctors + .map((item) { + return projectsProvider + .isArabic + ? item[ + 'doctorNameN'] + : item[ + 'doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { - model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorName'] == item) - doctorID = newVal['DoctorID'] - }); + model2.coveringDoctors + .forEach( + (newVal) => { + if (newVal[ + 'doctorName'] == + item) + doctorID = + newVal['DoctorID'] + }); }, - selectedItem: getSelectedDoctor(model2), + selectedItem: + getSelectedDoctor( + model2), showSearchBox: true, - searchBoxDecoration: InputDecoration( - border: OutlineInputBorder(), - contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), - labelText: "Search Doctor", - ), popupTitle: Container( height: 50, - decoration: BoxDecoration( - color: Theme.of(context).primaryColorDark, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), + decoration: + BoxDecoration( + color: Theme.of( + context) + .primaryColorDark, + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular( + 20), + topRight: + Radius.circular( + 20), ), ), child: Center( @@ -592,80 +627,28 @@ class _RescheduleLeaveScreen extends State { '', style: TextStyle( fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, + fontWeight: + FontWeight + .bold, + color: + Colors.white, ), ), ), ), - popupShape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), + popupShape: + RoundedRectangleBorder( + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular( + 24), + topRight: + Radius.circular( + 24), ), ), ), - // DropdownButtonHideUnderline( - // child: DropdownButton( - // focusColor: Colors.grey, - // isExpanded: true, - // value: doctorID == null - // ? model2 - // .coveringDoctors[0] - // ['doctorID'] - // .toString() - // : doctorID, - // iconSize: 40, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return model2 - // .coveringDoctors - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // AppText( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // fontSize: SizeConfig - // .textMultiplier * - // 2.1, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) => { - // setState(() { - // doctorID = newValue; - // }) - // }, - // items: model2 - // .coveringDoctors - // .map((item) { - // return DropdownMenuItem< - // String>( - // value: item['doctorID'] - // .toString(), - // child: Text( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // textAlign: - // TextAlign.start, - // ), - // ); - // }).toList(), - // )), ) : SizedBox(), ], @@ -675,14 +658,17 @@ class _RescheduleLeaveScreen extends State { )), SizedBox(height: SizeConfig.screenHeight * .3), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context).updateReschedule - : TranslationBase.of(context).addReschedule, + ? TranslationBase.of(context) + .updateReschedule + : TranslationBase.of(context) + .addReschedule, color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { @@ -692,7 +678,9 @@ class _RescheduleLeaveScreen extends State { addRecheduleLeave(model2); } } else { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .onlyOfftimeHoliday); } }, ), @@ -725,13 +713,16 @@ class _RescheduleLeaveScreen extends State { final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); this.offTime = widget.updateData.requisitionType.toString(); - _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + _toDateController.text = + dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = + df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = this.toTime.substring(0, this.toTime.length - 3); - _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _toDateController2.text = + dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _controller5.text = toTime; _controller4.text = fromTime; toDate = _toDateController2.text; @@ -744,7 +735,8 @@ class _RescheduleLeaveScreen extends State { getClinicName(model) { var clinicID = this.profile['ClinicID'] ?? 1; - var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); + var clinicInfo = + model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } @@ -754,10 +746,16 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format( - DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); - toDate = df - .format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); + fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + + 'T' + + fromTime + + ':' + + DateTime.now().second.toString())); + toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + + 'T' + + toTime + + ':' + + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -772,7 +770,8 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": + doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -795,7 +794,8 @@ class _RescheduleLeaveScreen extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') + builder: (context) => AddRescheduleLeavScreen(), + settings: RouteSettings(name: 'AddRescheduleLeaveScreen') // MyReferredPatient(), ), ); @@ -810,13 +810,21 @@ class _RescheduleLeaveScreen extends State { dynamic fromDates = fromDate; dynamic toDates = toDate; if (offTime == '1') { - fromDate = - df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); - toDate = - df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); + fromDate = df.format(DateTime.parse(_toDateController.text)) + + 'T' + + fromTime + + ':' + + DateTime.now().second.toString(); + toDate = df.format(DateTime.parse(_toDateController2.text)) + + 'T' + + toTime + + ':' + + DateTime.now().second.toString(); } else { - fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); - toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); + fromDate = df.format( + fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); + toDate = + df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); } Map request = { @@ -829,7 +837,8 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": + doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ { @@ -867,7 +876,8 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} + if (newVal['doctorID'].toString() == doctorID) + {doctorName = newVal['doctorName']} }); return doctorName; } diff --git a/lib/util/NotificationPermissionUtils.dart b/lib/util/NotificationPermissionUtils.dart index 8950fae3..aec7b0aa 100644 --- a/lib/util/NotificationPermissionUtils.dart +++ b/lib/util/NotificationPermissionUtils.dart @@ -4,39 +4,50 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; - class AppPermissionsUtils { - - static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { - + static requestVideoCallPermission( + {BuildContext context, String type, Function onTapGrant}) async { var cameraPermission = Permission.camera; var microphonePermission = Permission.microphone; PermissionStatus permissionCameraStatus = await cameraPermission.status; - PermissionStatus permissionMicrophoneStatus = await microphonePermission.status; + PermissionStatus permissionMicrophoneStatus = + await microphonePermission.status; - if (permissionCameraStatus.isPermanentlyDenied || permissionMicrophoneStatus.isPermanentlyDenied) { - await _showPermissionDialog(context, type,onTapGrant); - } else if (!permissionCameraStatus.isGranted || !permissionMicrophoneStatus.isGranted) { + if (permissionCameraStatus.isPermanentlyDenied || + permissionMicrophoneStatus.isPermanentlyDenied) { + await _showPermissionDialog(context, type, onTapGrant); + } else if (!permissionCameraStatus.isGranted || + !permissionMicrophoneStatus.isGranted) { permissionCameraStatus = await cameraPermission.request(); permissionMicrophoneStatus = await microphonePermission.request(); - if (permissionCameraStatus.isDenied || permissionMicrophoneStatus.isDenied) - await _showPermissionDialog(context, type,onTapGrant); + if (permissionCameraStatus.isDenied || + permissionMicrophoneStatus.isDenied) + await _showPermissionDialog(context, type, onTapGrant); else - onTapGrant(); - } else if (permissionCameraStatus.isDenied || permissionMicrophoneStatus.isDenied) - await _showPermissionDialog(context, type,onTapGrant); + onTapGrant(); + } else if (permissionCameraStatus.isDenied || + permissionMicrophoneStatus.isDenied) + await _showPermissionDialog(context, type, onTapGrant); else onTapGrant(); } - static _showPermissionDialog(BuildContext context, String type,Function onTapGrant) async { + static _showPermissionDialog( + BuildContext context, String type, Function onTapGrant) async { Navigator.push( - context, SlideUpPageRoute(widget: AskPermissionDialog(type: type,onTapGrant: onTapGrant,))); + context, + SlideUpPageRoute( + widget: AskPermissionDialog( + type: type, + onTapGrant: onTapGrant, + ))); } static Future isVideoCallPermissionGranted() async { PermissionStatus permissionCameraStatus = await Permission.camera.status; - PermissionStatus permissionMicrophoneStatus = await Permission.microphone.status; - return permissionCameraStatus.isGranted && permissionMicrophoneStatus.isGranted; + PermissionStatus permissionMicrophoneStatus = + await Permission.microphone.status; + return permissionCameraStatus.isGranted && + permissionMicrophoneStatus.isGranted; } } diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index 0239bf57..b9f99bee 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -1,28 +1,41 @@ - import 'dart:convert'; import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -class VideoChannel{ +class VideoChannel { /// channel name static const _channel = const MethodChannel("Dr.cloudSolution/videoCall"); - static openVideoCallScreen({kApiKey, kSessionId, kToken, callDuration, warningDuration,int vcId,String tokenID, - String generalId,int doctorId, String patientName, bool isRecording = false, Function() onCallEnd , - Function(SessionStatusModel sessionStatusModel) onCallNotRespond ,Function(String error) onFailure, VoidCallback onCallConnected, VoidCallback onCallDisconnected}) async { - onCallConnected = onCallConnected ?? (){}; - onCallDisconnected = onCallDisconnected ?? (){}; + static openVideoCallScreen( + {kApiKey, + kSessionId, + kToken, + callDuration, + warningDuration, + int vcId, + String tokenID, + String generalId, + int doctorId, + String patientName, + bool isRecording = false, + Function() onCallEnd, + Function(SessionStatusModel sessionStatusModel) onCallNotRespond, + Function(String error) onFailure, + VoidCallback onCallConnected, + VoidCallback onCallDisconnected}) async { + onCallConnected = onCallConnected ?? () {}; + onCallDisconnected = onCallDisconnected ?? () {}; var result; try { _channel.setMethodCallHandler((call) { - if(call.method == 'onCallConnected'){ + if (call.method == 'onCallConnected') { onCallConnected(); } - if(call.method == 'onCallDisconnected'){ + if (call.method == 'onCallDisconnected') { onCallDisconnected(); } return true as dynamic; @@ -39,24 +52,22 @@ class VideoChannel{ "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, - "DoctorId": doctorId , - "patientName": patientName, - "isRecording": isRecording, + "DoctorId": doctorId, + "patientName": patientName, + "isRecording": isRecording, }, ); - if(result['callResponse'] == 'CallEnd') { + if (result['callResponse'] == 'CallEnd') { onCallEnd(); - } - else { - SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson(Platform.isIOS ?result['sessionStatus'] :json.decode(result['sessionStatus'])); + } else { + SessionStatusModel sessionStatusModel = SessionStatusModel.fromJson( + Platform.isIOS + ? result['sessionStatus'] + : json.decode(result['sessionStatus'])); onCallNotRespond(sessionStatusModel); } - } catch (e) { onFailure(e.toString()); } - } - - -} \ No newline at end of file +} diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index a10a18e3..b9d9e060 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -24,10 +24,14 @@ class AppDateUtils { return convertDateToFormat(dateTime, dateFormat); } - static String convertToServerFormat(String date, String dateFormat){ + static String convertToServerFormat(String date, String dateFormat) { return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/'; } + static String convertDateToServerFormat(DateTime date) { + return '/Date(${date.millisecondsSinceEpoch})/'; + } + static convertDateFromServerFormat(String str, dateFormat) { var date = getDateTimeFromServerFormat(str); @@ -301,7 +305,7 @@ class AppDateUtils { /// get data formatted like 26 Apr 2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime, - {bool isArabic = false, bool isMonthShort = false}) { + {bool isArabic = false, bool isMonthShort = true}) { if (dateTime != null) return dateTime.day.toString() + " " + diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index bac296bf..decbe080 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -81,10 +81,10 @@ class DrAppSharedPreferances { return prefs.getInt(key); } - getObj(String key) async{ + getObj(String key) async { final SharedPreferences prefs = await _prefs; var string = prefs.getString(key); - if (string == null ){ + if (string == null) { return null; } return json.decode(string); @@ -92,8 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - var vvas= await prefs.clear(); - var asd; + var vvas = await prefs.clear(); + var asd; } remove(String key) async { diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index 76950ae5..c8604534 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -1,79 +1,25 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; +import 'package:fluttertoast/fluttertoast.dart'; class DrAppToastMsg { - void showLongToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, - toastLength: Toast.LENGTH_LONG, - ); - } - static void showSuccesToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, + Fluttertoast.showToast( + msg: msg, toastLength: Toast.LENGTH_SHORT, - backgroundColor: AppGlobal.appGreenColor, - icon: ICON.SUCCESS, - fontSize: 16, - imageSize: 35, - textColor: Colors.white); + gravity: ToastGravity.TOP, + // timeInSecForIosWeb: timeInSeconds, + backgroundColor: Colors.green, + textColor: Colors.white, + fontSize: 16); } static void showErrorToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, + Fluttertoast.showToast( + msg: msg, toastLength: Toast.LENGTH_SHORT, - toastGravity: ToastGravity.TOP, + gravity: ToastGravity.TOP, backgroundColor: Colors.red, - icon: ICON.CLOSE, - fontSize: 16, - imageSize: 35, - timeInSeconds: 912, - textColor: Colors.white); - } - - static void showShortToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, - toastLength: Toast.LENGTH_SHORT, - icon: ICON.INFO, - timeInSeconds: 1); - } - - static void showTopShortToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, - toastLength: Toast.LENGTH_SHORT, - toastGravity: ToastGravity.TOP, - icon: ICON.WARNING, - timeInSeconds: 1); - } - - static void showCenterShortToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, - toastLength: Toast.LENGTH_SHORT, - toastGravity: ToastGravity.CENTER, - icon: ICON.WARNING, - timeInSeconds: 1); - } - - static void showCenterShortLoadingToast(msg) { - FlutterFlexibleToast.showToast( - message: msg, - toastLength: Toast.LENGTH_LONG, - toastGravity: ToastGravity.BOTTOM, - icon: ICON.LOADING, - radius: 20, - elevation: 10, textColor: Colors.white, - - timeInSeconds: 2); - } - - static void cancelToast(msg) { - FlutterFlexibleToast.cancel(); + fontSize: 16); } } diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index da353ad0..0d170be7 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -14,9 +14,8 @@ extension Truncate on String { return length <= max ? this : '${substring(0, max - suffix.length)}$suffix'; - } catch (e){ + } catch (e) { return this; } } } - diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 42816f9f..a69ff3e0 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,12 +1,10 @@ import 'package:connectivity/connectivity.dart'; 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/hospitals/get_hospitals_response_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/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; -import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -15,7 +13,6 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; -import 'package:intl/intl.dart'; import '../UpdatePage.dart'; import '../config/size_config.dart'; @@ -330,100 +327,7 @@ class Helpers { return kpi; } - static getBoxTabsBoxDecoration( - {bool isFirst = false, - bool isMiddle = false, - bool isLast = false, - bool isActive = false, - double radius = 6.0, ProjectViewModel projectViewModel}) { - return BoxDecoration( - color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic?Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0):Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0), - - - topLeft: projectViewModel.isArabic? Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0):Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0), - bottomRight: projectViewModel.isArabic? Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0): Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0), - bottomLeft:projectViewModel.isArabic? Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0): Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0)), - ); - } - - static getBgTabColor() { - return Color(0xFFEAEAEA); - } - - static getTabText({ - String title, - bool isActive = false, - }) { - return AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.8, - color: isActive ? Colors.white : AppGlobal.appTextColor, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - ); - } - - static getTabHeight(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return screenSize.height * 0.07; - } - static getTabCounter({bool isActive: false, int counter}) { - return Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : AppGlobal.appRedColor, - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : AppGlobal.appRedColor, - fontWeight: FontWeight.w700, - ), - ), - ), - ); - } static String convertToTitleCase(String text) { if (text == null) { diff --git a/lib/util/tab_helper.dart b/lib/util/tab_helper.dart new file mode 100644 index 00000000..c4a023d4 --- /dev/null +++ b/lib/util/tab_helper.dart @@ -0,0 +1,113 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +import '../config/config.dart'; +import '../config/size_config.dart'; +import '../core/viewModel/project_view_model.dart'; +import '../widgets/shared/app_texts_widget.dart'; + +class TabHelper { + + static getBoxTabsBoxDecoration( + {bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + bool isActive = false, + double radius = 6.0, + ProjectViewModel projectViewModel}) { + return BoxDecoration( + color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic + ? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + topLeft: projectViewModel.isArabic + ? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0)), + ); + } + + static getBgTabColor() { + return Color(0xFFEAEAEA); + } + + static getTabText({ + String title, + bool isActive = false, + }) { + return AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.8, + color: isActive ? Colors.white : AppGlobal.appTextColor, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ); + } + + static getTabHeight(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return screenSize.height * 0.07; + } + + static getTabCounter({bool isActive: false, int counter}) { + return Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : AppGlobal.appRedColor, + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : AppGlobal.appRedColor, + fontWeight: FontWeight.w700, + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 0c25bca7e..e433df63 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -13,13 +13,11 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; - String get areYouSureYouWantTo => - localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; String get language => localizedValues['language'][locale.languageCode]; @@ -37,58 +35,49 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule'][locale.languageCode]; + String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; String get verify => localizedValues['verify'][locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor'][locale.languageCode]; + String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic'][locale.languageCode]; + String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; String get frequency => localizedValues['frequency'][locale.languageCode]; String get priority => localizedValues['priority'][locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime'][locale.languageCode]; + String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions'][locale.languageCode]; + String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String get searchPatient => - localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => - localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name'][locale.languageCode]; + String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; + + String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; + + String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; String get patient => localizedValues['patient'][locale.languageCode]; + String get patients => localizedValues['patients'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics'][locale.languageCode]; + String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine'][locale.languageCode]; + String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; @@ -105,50 +94,47 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => - localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll'][locale.languageCode]; + String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; + + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; - String get patientServices => - localizedValues['patientServices'][locale.languageCode]; + String get patientServices => localizedValues['patientServices'][locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => - localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; - String get referPatient => - localizedValues['referPatient'][locale.languageCode]; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + + String get referPatient => localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient'][locale.languageCode]; + String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get referredOn => localizedValues['referredOn'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; - String get firstNameInAr => - localizedValues['firstNameInAr'][locale.languageCode]; + + String get firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; String get middleName => localizedValues['middleName'][locale.languageCode]; - String get middleNameInAr => - localizedValues['middleNameInAr'][locale.languageCode]; + + String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; String get lastName => localizedValues['lastName'][locale.languageCode]; - String get lastNameInAr => - localizedValues['lastNameInAr'][locale.languageCode]; + + String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; @@ -158,23 +144,19 @@ class TranslationBase { String get search => localizedValues['search'][locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String get itemsInSearch => - localizedValues['itemsInSearch'][locale.languageCode]; + String get medicineSearchResult => localizedValues['medicineSearchResult'][locale.languageCode]; String get qr => localizedValues['qr'][locale.languageCode]; String get reader => localizedValues['reader'][locale.languageCode]; - String get startScanning => - localizedValues['startScanning'][locale.languageCode]; + String get startScanning => localizedValues['startScanning'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; @@ -186,21 +168,17 @@ class TranslationBase { String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect'][locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect'][locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage'][locale.languageCode]; + String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile'][locale.languageCode]; + String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; @@ -216,18 +194,15 @@ class TranslationBase { String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; + String get prescription => localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -235,34 +210,30 @@ class TranslationBase { String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign'][locale.languageCode]; + String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders'][locale.languageCode]; + String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient'][locale.languageCode]; + String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; - String get operationReports => - localizedValues['operationReports'][locale.languageCode]; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; + + String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get reports => localizedValues['reports'][locale.languageCode]; + String get operation => localizedValues['operation'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode]; @@ -271,14 +242,13 @@ class TranslationBase { String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote'][locale.languageCode]; + String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String get generalResult => - localizedValues['generalResult'][locale.languageCode]; + String get generalResult => localizedValues['generalResult'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; @@ -288,30 +258,23 @@ class TranslationBase { String get enterId => localizedValues['enterId'][locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword'][locale.languageCode]; + String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject'][locale.languageCode]; + String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; String get home => localizedValues['home'][locale.languageCode]; @@ -327,23 +290,19 @@ class TranslationBase { String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose'][locale.languageCode]; + String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; String get choose => localizedValues['choose'][locale.languageCode]; - String get verification => - localizedValues['verification'][locale.languageCode]; + String get verification => localizedValues['verification'][locale.languageCode]; String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!'][locale.languageCode]; + String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; String get verify1 => localizedValues['verify1'][locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA'][locale.languageCode]; + String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; String get loginCode => localizedValues['loginCode'][locale.languageCode]; @@ -361,10 +320,14 @@ class TranslationBase { String get age => localizedValues['age'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; + String get occupation => localizedValues['occupation'][locale.languageCode]; + String get healthID => localizedValues['healthID'][locale.languageCode]; + String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; @@ -426,6 +389,7 @@ class TranslationBase { String get myOutPatient => localizedValues['myOutPatient'][locale.languageCode]; + String get myOutPatient_2lines => localizedValues['myOutPatient_2lines'][locale.languageCode]; @@ -558,11 +522,17 @@ class TranslationBase { String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get pharmacyIntervention => + localizedValues['pharmacy-intervention'][locale.languageCode]; + String get add => localizedValues['add'][locale.languageCode]; + String get addSickLeaverequest => localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => localizedValues['extendSickLeaveRequest'][locale.languageCode]; + String get approved => localizedValues['approved'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode]; @@ -587,6 +557,7 @@ class TranslationBase { localizedValues['no-priscription-listed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; + String get finish => localizedValues['finish'][locale.languageCode]; String get previous => localizedValues['previous'][locale.languageCode]; @@ -604,6 +575,7 @@ class TranslationBase { String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; @@ -662,6 +634,7 @@ class TranslationBase { String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; + String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; String get addMedication => @@ -697,12 +670,17 @@ class TranslationBase { String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; + String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; + String get bmiObeseExtreme => localizedValues['bmiObeseExtreme'][locale.languageCode]; @@ -786,6 +764,7 @@ class TranslationBase { String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => localizedValues['isSickLeaveRequired'][locale.languageCode]; @@ -825,6 +804,7 @@ class TranslationBase { String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlans => localizedValues['postPlans'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; @@ -871,6 +851,14 @@ class TranslationBase { String get medications => localizedValues['medications'][locale.languageCode]; + String get medication => localizedValues['medication'][locale.languageCode]; + + String get doctorComments => localizedValues['doctorComments'][locale.languageCode]; + + String get statusDescription => localizedValues['statusDescription'][locale.languageCode]; + + String get createdByName => localizedValues['createdByName'][locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; String get chiefComplaints => @@ -969,6 +957,7 @@ class TranslationBase { String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifyWith => localizedValues['verify-with'][locale.languageCode]; String get verifyWhatsApp => @@ -1007,6 +996,7 @@ class TranslationBase { String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; String get normal => localizedValues['normal'][locale.languageCode]; + String get notExamined => localizedValues['notExamined'][locale.languageCode]; String get abnormal => localizedValues['abnormal'][locale.languageCode]; @@ -1061,6 +1051,7 @@ class TranslationBase { String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; + String get addProcedures => localizedValues['addProcedures'][locale.languageCode]; @@ -1085,6 +1076,8 @@ class TranslationBase { String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String get riskScore => localizedValues['riskScore'][locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get currentMedications => @@ -1118,6 +1111,7 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get ICDName => localizedValues['ICDName'][locale.languageCode]; String get referralStatus => @@ -1125,36 +1119,54 @@ class TranslationBase { String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + String get offTime => localizedValues['offTime'][locale.languageCode]; String get icd => localizedValues['icd'][locale.languageCode]; + String get days => localizedValues['days'][locale.languageCode]; + String get hr => localizedValues['hr'][locale.languageCode]; + String get min => localizedValues['min'][locale.languageCode]; + String get months => localizedValues['months'][locale.languageCode]; + String get years => localizedValues['years'][locale.languageCode]; + String get referralStatusHold => localizedValues['referralStatusHold'][locale.languageCode]; + String get referralStatusActive => localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; + String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; + String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; @@ -1163,28 +1175,41 @@ class TranslationBase { String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => localizedValues['complications'][locale.languageCode]; + String get floor => localizedValues['floor'][locale.languageCode]; + String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; + String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; + String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; + String get noClinic => localizedValues['no-clinic'][locale.languageCode]; String get otherStatistic => @@ -1192,299 +1217,514 @@ class TranslationBase { String get patientsreferral => localizedValues['ptientsreferral'][locale.languageCode]; + String get myPatientsReferral => localizedValues['myPatientsReferral'][locale.languageCode]; + String get arrivalpatient => localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => localizedValues['searchmedicinepatient'][locale.languageCode]; + String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; + String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; + String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get labResults => localizedValues['labResults'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; + String get reschedule => localizedValues['reschedule'][locale.languageCode]; + String get leaves => localizedValues['leaves'][locale.languageCode]; + String get openRad => localizedValues['open-rad'][locale.languageCode]; String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get companyName => localizedValues['companyName'][locale.languageCode]; + String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get notes => localizedValues['notes'][locale.languageCode]; + String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; + String get searchWithOther => localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => localizedValues['applyForReschedule'][locale.languageCode]; String get startDate => localizedValues['startDate'][locale.languageCode]; + String get endDate => localizedValues['endDate'][locale.languageCode]; String get addReschedule => localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; + String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; + String get accepted => localizedValues['accepted'][locale.languageCode]; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get unReplied => localizedValues['unReplied'][locale.languageCode]; + String get replied => localizedValues['replied'][locale.languageCode]; + String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; + String get searchHere => localizedValues['searchHere'][locale.languageCode]; + String get remove => localizedValues['remove'][locale.languageCode]; + String get inProgress => localizedValues['inProgress'][locale.languageCode]; + String get completed => localizedValues['Completed'][locale.languageCode]; + String get locked => localizedValues['Locked'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; + String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; + String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; + String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; + String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; + String get enterCredentials => localizedValues['enter_credentials'][locale.languageCode]; + String get patpatientIDMobilenationalientID => localizedValues['patientIDMobilenational'][locale.languageCode]; String get updateNow => localizedValues['updateNow'][locale.languageCode]; + String get updateTheApp => localizedValues['updateTheApp'][locale.languageCode]; + String get admissionDate => localizedValues['admission-date'][locale.languageCode]; + String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; + String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; + String get replayBefore => localizedValues['replayBefore'][locale.languageCode]; + String get trySaying => localizedValues["try-saying"][locale.languageCode]; + String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; + String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get pleaseEnterProcedure => localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get atLeastThreeCharacters => localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get procedure => localizedValues["procedure"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get processed => localizedValues["processed"][locale.languageCode]; + String get direction => localizedValues["direction"][locale.languageCode]; + String get refill => localizedValues["refill"][locale.languageCode]; + String get medicationHasBeenAdded => localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get narcoticMedicineCanOnlyBePrescribedFromVida => localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] [locale.languageCode]; + String get only5DigitsAllowedForStrength => localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + String get unit => localizedValues["unit"][locale.languageCode]; + String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get applyForRadiologyOrder => localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get addRadiologyOrder => localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => localizedValues["newRadiologyOrder"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get examType => localizedValues["examType"][locale.languageCode]; + String get health => localizedValues["health"][locale.languageCode]; + String get summary => localizedValues["summary"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => localizedValues["noMedicalFileFound"][locale.languageCode]; + String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get approvals22 => localizedValues["approvals22"][locale.languageCode]; + String get severe => localizedValues["severe"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get discharged => localizedValues["discharged"][locale.languageCode]; + String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; + String get notePending => localizedValues["notePending"][locale.languageCode]; + String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => localizedValues["order"][locale.languageCode]; + String get sheet => localizedValues["sheet"][locale.languageCode]; + String get medical => localizedValues["medical"][locale.languageCode]; + String get report => localizedValues["report"][locale.languageCode]; + String get discharge => localizedValues["discharge"][locale.languageCode]; + String get none => localizedValues["none"][locale.languageCode]; + String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get clearText => localizedValues["clearText"][locale.languageCode]; + String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; + String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; + String get comments => localizedValues['comments'][locale.languageCode]; + String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; + String get endCall => localizedValues['endCall'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode]; + String get admin => localizedValues['admin'][locale.languageCode]; + String get instructions => localizedValues['instructions'][locale.languageCode]; + String get sendLC => localizedValues['sendLC'][locale.languageCode]; + String get endLC => localizedValues['endLC'][locale.languageCode]; + String get consultation => localizedValues['consultation'][locale.languageCode]; + String get resume => localizedValues['resume'][locale.languageCode]; + String get theCall => localizedValues['theCall'][locale.languageCode]; + String get createNewMedicalReport => localizedValues['createNewMedicalReport'][locale.languageCode]; + String get historyPhysicalFinding => localizedValues['historyPhysicalFinding'][locale.languageCode]; + String get laboratoryPhysicalData => localizedValues['laboratoryPhysicalData'][locale.languageCode]; + String get impressionRecommendation => localizedValues['impressionRecommendation'][locale.languageCode]; + String get onHold => localizedValues['onHold'][locale.languageCode]; + String get verified => localizedValues['verified'][locale.languageCode]; + String get favoriteTemplates => localizedValues['favoriteTemplates'][locale.languageCode]; + String get allProcedures => localizedValues['allProcedures'][locale.languageCode]; + String get allRadiology => localizedValues['allRadiology'][locale.languageCode]; + String get allLab => localizedValues['allLab'][locale.languageCode]; + String get allPrescription => localizedValues['allPrescription'][locale.languageCode]; + String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; + String get edit => localizedValues['edit'][locale.languageCode]; + String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; + String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; + String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get roomNo => localizedValues['roomNo'][locale.languageCode]; + String get seeMore => localizedValues['seeMore'][locale.languageCode]; + String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; + String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; + String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; + String get underProcess => localizedValues['underProcess'][locale.languageCode]; + String get textResponse => localizedValues['textResponse'][locale.languageCode]; + String get special => localizedValues['special'][locale.languageCode]; + String get requestType => localizedValues['requestType'][locale.languageCode]; + String get allClinic => localizedValues['allClinic'][locale.languageCode]; + String get notReplied => localizedValues['notReplied'][locale.languageCode]; + String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; + String get operationTimeStart => localizedValues['operationTimeStart'][locale.languageCode]; + String get operationDate => localizedValues['operationDate'][locale.languageCode]; + String get reservation => localizedValues['reservation'][locale.languageCode]; + String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; + String get bloodTransfusedDetail => localizedValues['bloodTransfusedDetail'][locale.languageCode]; + String get circulatingNurse => localizedValues['circulatingNurse'][locale.languageCode]; + String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; + String get otherSpecimen => localizedValues['otherSpecimen'][locale.languageCode]; + String get microbiologySpecimen => localizedValues['microbiologySpecimen'][locale.languageCode]; + String get histopathSpecimen => localizedValues['histopathSpecimen'][locale.languageCode]; + String get bloodLossDetail => localizedValues['bloodLossDetail'][locale.languageCode]; + String get complicationDetails1 => localizedValues['complicationDetails1'][locale.languageCode]; + String get postOperationInstruction => localizedValues['postOperationInstruction'][locale.languageCode]; + String get surgeryProcedure => localizedValues['surgeryProcedure'][locale.languageCode]; + String get finding => localizedValues['finding'][locale.languageCode]; + String get preOperationDiagnosis => localizedValues['preOperationDiagnosis'][locale.languageCode]; + String get postOperationDiagnosis => localizedValues['postOperationDiagnosis'][locale.languageCode]; + String get surgeon => localizedValues['surgeon'][locale.languageCode]; + String get assistant => localizedValues['assistant'][locale.languageCode]; + String get askForIdentification => localizedValues['askForIdentification'][locale.languageCode]; + String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; + String get calender => localizedValues['calender'][locale.languageCode]; + String get gregorian => localizedValues['gregorian'][locale.languageCode]; + String get hijri => localizedValues['hijri'][locale.languageCode]; + String get birthdate => localizedValues['birthdate'][locale.languageCode]; + String get activation => localizedValues['activation'][locale.languageCode]; + String get confirmation => localizedValues['confirmation'][locale.languageCode]; + String get diabetic => localizedValues['diabetic'][locale.languageCode]; + + String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + + String get intervention => localizedValues['intervention'][locale.languageCode]; + String get chart => localizedValues['chart'][locale.languageCode]; - String get investigation => - localizedValues['investigation'][locale.languageCode]; - String get conditionOnDischarge => - localizedValues['conditionOnDischarge'][locale.languageCode]; - String get planedProcedure => - localizedValues['planedProcedure'][locale.languageCode]; + String get investigation => localizedValues['investigation'][locale.languageCode]; + + String get conditionOnDischarge => localizedValues['conditionOnDischarge'][locale.languageCode]; + + String get planedProcedure => localizedValues['planedProcedure'][locale.languageCode]; + String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; + + String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode]; + + String get pharmacology => localizedValues['pharmacology'][locale.languageCode]; + + String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; + + String get youDoNotHaveFavoritePrescription => localizedValues['youDoNotHaveFavoritePrescription'][locale.languageCode]; + + String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; + + String get searchFavoriteTemplate => localizedValues['searchFavoriteTemplate'][locale.languageCode]; + + String get sorryNoMatch => localizedValues['sorryNoMatch'][locale.languageCode]; + + String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength'][locale.languageCode]; + + String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero'][locale.languageCode]; + + String get old => localizedValues['old'][locale.languageCode]; + + String get orderTypeDescription => localizedValues['orderTypeDescription'][locale.languageCode]; + + String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; + + String get selectCondition => localizedValues['selectCondition'][locale.languageCode]; + + String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully'][locale.languageCode]; + + String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces'][locale.languageCode]; + + String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/method_type_card.dart b/lib/widgets/auth/method_type_card.dart index 9839d0ad..acc5eba1 100644 --- a/lib/widgets/auth/method_type_card.dart +++ b/lib/widgets/auth/method_type_card.dart @@ -72,10 +72,11 @@ import 'package:hexcolor/hexcolor.dart'; class MethodTypeCard extends StatelessWidget { const MethodTypeCard({ Key key, - this.assetPath, - this.onTap, - this.label, - this.height = 20, this.isSvg = true, + this.assetPath, + this.onTap, + this.label, + this.height = 20, + this.isSvg = true, }) : super(key: key); final String assetPath; final GestureTapCallback onTap; @@ -83,10 +84,14 @@ class MethodTypeCard extends StatelessWidget { final double height; final bool isSvg; - @override Widget build(BuildContext context) { - double cardHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort? 22 : SizeConfig.isHeightLarge?25:20); + double cardHeight = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 22 + : SizeConfig.isHeightLarge + ? 25 + : 20); return InkWell( onTap: onTap, child: Container( @@ -106,19 +111,23 @@ class MethodTypeCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - isSvg?SvgPicture.asset(assetPath, width: SizeConfig.widthMultiplier* (14), - height: cardHeight * 0.20): Image.asset( - assetPath, - width: SizeConfig.widthMultiplier* (12), - height: cardHeight * 0.35, - // height: , - ), + isSvg + ? SvgPicture.asset(assetPath, + width: SizeConfig.widthMultiplier * (14), + height: cardHeight * 0.20) + : Image.asset( + assetPath, + width: SizeConfig.widthMultiplier * (12), + height: cardHeight * 0.35, + // height: , + ), SizedBox( height: height, ), AppText( label, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()* (SizeConfig.isHeightVeryShort?3:3.7), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isHeightVeryShort ? 3 : 3.7), color: AppGlobal.appTextColor, fontWeight: FontWeight.w600, letterSpacing: -0.48, @@ -130,4 +139,3 @@ class MethodTypeCard extends StatelessWidget { ); } } - diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 4e99d316..6c1227c0 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class SMSOTP { final AuthMethodTypes type; @@ -47,6 +46,7 @@ class SMSOTP { ProjectViewModel projectProvider; String displayTime = ''; bool isClosed = false; + displayDialog(BuildContext context) async { double dialogWidth = MediaQuery.of(context).size.width * 0.90; double dialogInputWidth = (dialogWidth / 4) - @@ -137,7 +137,8 @@ class SMSOTP { fontSize: SizeConfig .getTextMultiplierBasedOnWidth( width: dialogWidth) * - 3.5, //14, + 3.5, + //14, maxLines: 2, )), Form( diff --git a/lib/widgets/auth/verification_methods_list.dart b/lib/widgets/auth/verification_methods_list.dart index 97fbb42b..061bf468 100644 --- a/lib/widgets/auth/verification_methods_list.dart +++ b/lib/widgets/auth/verification_methods_list.dart @@ -40,18 +40,16 @@ class _VerificationMethodsListState extends State { assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', onTap: () => {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, - label: TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifyWhatsApp, + label: TranslationBase.of(context).verifyWith + + TranslationBase.of(context).verifyWhatsApp, ); break; case AuthMethodTypes.SMS: return MethodTypeCard( assetPath: "assets/images/svgs/verification/verify-sms.svg", onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, - label:TranslationBase - .of(context) - .verifyWith+ TranslationBase.of(context).verifySMS, + label: TranslationBase.of(context).verifyWith + + TranslationBase.of(context).verifySMS, ); break; case AuthMethodTypes.Fingerprint: @@ -60,13 +58,11 @@ class _VerificationMethodsListState extends State { onTap: () async { if (await widget.authenticationViewModel .checkIfBiometricAvailable(BiometricType.fingerprint)) { - widget.authenticateUser(AuthMethodTypes.Fingerprint, true); } }, - label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFingerprint, + label: TranslationBase.of(context).verifyWith + + TranslationBase.of(context).verifyFingerprint, ); break; case AuthMethodTypes.FaceID: @@ -78,9 +74,8 @@ class _VerificationMethodsListState extends State { widget.authenticateUser(AuthMethodTypes.FaceID, true); } }, - label: TranslationBase - .of(context) - .verifyWith+TranslationBase.of(context).verifyFaceID, + label: TranslationBase.of(context).verifyWith + + TranslationBase.of(context).verifyFaceID, ); break; diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart index aa532306..08b7ff93 100644 --- a/lib/widgets/charts/app_bar_chart.dart +++ b/lib/widgets/charts/app_bar_chart.dart @@ -23,20 +23,19 @@ class AppBarChart extends StatelessWidget { /// (typically bar charts). primaryMeasureAxis: new charts.NumericAxisSpec( renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, + // Display the measure axis labels below the gridline. + // + // 'Before' & 'after' follow the axis value direction. + // Vertical axes draw 'before' below & 'after' above the tick. + // Horizontal axes draw 'before' left & 'after' right the tick. + labelAnchor: charts.TickLabelAnchor.before, - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), + // Left justify the text in the axis. + // + // Note: outside means that the secondary measure axis would right + // justify. + labelJustification: charts.TickLabelJustification.outside, + )), ), ); } diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 670284a1..d8757c80 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -42,7 +42,7 @@ class AppTimeSeriesChart extends StatelessWidget { charts.RangeAnnotation( [ charts.RangeAnnotationSegment(startDate, endDate, - charts.RangeAnnotationAxisType.domain ), + charts.RangeAnnotationAxisType.domain), ], ), ], diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart index 4a6e90cd..4b4c96da 100644 --- a/lib/widgets/dashboard/activity_button.dart +++ b/lib/widgets/dashboard/activity_button.dart @@ -10,18 +10,27 @@ class GetActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort?16:SizeConfig.isHeightShort?14:SizeConfig.isHeightLarge?15:13); + double width = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightShort + ? 14 + : SizeConfig.isHeightLarge + ? 15 + : 13); return Container( width: width, - padding: EdgeInsets.symmetric(horizontal: SizeConfig.heightMultiplier * .4, vertical: SizeConfig.heightMultiplier * .2), - margin: EdgeInsets.all(SizeConfig.widthMultiplier *1), + padding: EdgeInsets.symmetric( + horizontal: SizeConfig.heightMultiplier * .4, + vertical: SizeConfig.heightMultiplier * .2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 1), decoration: BoxDecoration( color: Colors.white, border: Border.all(width: 1.5, color: Color(0xFFEFEFEF)), borderRadius: BorderRadius.circular(15), ), child: Padding( - padding: const EdgeInsets.fromLTRB(8,8, 8, 4), + padding: const EdgeInsets.fromLTRB(8, 8, 8, 4), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -29,21 +38,27 @@ class GetActivityCard extends StatelessWidget { children: [ AppText( value.value.toString(), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* 25, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth(width: width) * 25, fontWeight: FontWeight.bold, color: AppGlobal.appTextColor, - letterSpacing: -0.93, + letterSpacing: -0.93, ), AppText( value.kPIParameter, textOverflow: TextOverflow.clip, fontHeight: 1.4, - - fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width)* (SizeConfig.isHeightVeryShort?8: SizeConfig.isHeightShort?8: 9.3), + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + (SizeConfig.isHeightVeryShort + ? 8 + : SizeConfig.isHeightShort + ? 8 + : 9.3), color: AppGlobal.appTextColor, textAlign: TextAlign.start, fontWeight: FontWeight.w600, - letterSpacing: -0.33, + letterSpacing: -0.33, ), ], ), diff --git a/lib/widgets/dashboard/dashboard_item_icons_texts.dart b/lib/widgets/dashboard/dashboard_item_icons_texts.dart index 740ebb66..607c4b20 100644 --- a/lib/widgets/dashboard/dashboard_item_icons_texts.dart +++ b/lib/widgets/dashboard/dashboard_item_icons_texts.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; @@ -17,6 +16,7 @@ class DashboardItemIconText extends StatefulWidget { final Color valueFontColor; final double valueFontSize; final Color iconColor; + // OWNER : Ibrahim albitar // DATE : 05-04-2020 // DESCRIPTION : Custom widget for dashboard items has texts and icons widgets @@ -30,6 +30,7 @@ class DashboardItemIconText extends StatefulWidget { this.titleFontColor = Colors.white, this.iconColor = Colors.white, this.borderColor = Colors.white}); + @override _DashboardItemTextsState createState() => _DashboardItemTextsState(); } diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index 659e4562..e1ce6cb8 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -27,6 +27,7 @@ class DashboardItemTexts extends StatefulWidget { class _DashboardItemTextsState extends State { ProjectViewModel projectsProvider; + @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index 6769c568..a2693ca7 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,4 +1,3 @@ - import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; @@ -16,6 +15,7 @@ class GaugeChart extends StatelessWidget { animate: false, ); } + @override Widget build(BuildContext context) { return new charts.PieChart(seriesList, @@ -50,5 +50,6 @@ class GaugeSegment { final String segment; final int size; final charts.Color color; + GaugeSegment(this.segment, this.size, this.color); } diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index 6b3d87d5..3c433917 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/screens/home/label.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -12,28 +12,32 @@ class GetOutPatientStack extends StatelessWidget { @override Widget build(BuildContext context) { - - double barHeight = - SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightLarge?20:17); - value.summaryoptions.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + double barHeight = SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightLarge + ? 20 + : 17); + value.summaryoptions + .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); value.summaryoptions .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); var list = new List(); - value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))}); + value.summaryoptions.forEach((result) => { + list.add(getStack( + result, value.summaryoptions.first.value, context, barHeight)) + }); return Container( margin: EdgeInsets.only(bottom: 20, top: 10, left: 5, right: 5), decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20), bottomLeft: Radius.circular(20), - bottomRight: Radius.circular(20) - ), + bottomRight: Radius.circular(20)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.5), @@ -44,43 +48,41 @@ class GetOutPatientStack extends StatelessWidget { ], ), child: Padding( - padding: const EdgeInsets.all(5.0), - child:Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), - child: Label( - firstLine: Helpers.getLabelFromKPI(value.kPIName), - secondLine: Helpers.getNameFromKPI(value.kPIName), - color: Color(0xFF2B353E), - firstLineFontSize: - SizeConfig.getHeightMultiplier(height: barHeight) * - (SizeConfig.isHeightVeryShort - ? 10 - : SizeConfig.isHeightShort - ? 10 - : 8.5), - secondLineFontSize: - SizeConfig.getHeightMultiplier(height: barHeight) * - (SizeConfig.isHeightVeryShort - ? 15 - : SizeConfig.isHeightShort - ? 15 - : 14.5), + padding: const EdgeInsets.all(5.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5), + child: Label( + firstLine: Helpers.getLabelFromKPI(value.kPIName), + secondLine: Helpers.getNameFromKPI(value.kPIName), + color: Color(0xFF2B353E), + firstLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 10 + : 8.5), + secondLineFontSize: + SizeConfig.getHeightMultiplier(height: barHeight) * + (SizeConfig.isHeightVeryShort + ? 15 + : SizeConfig.isHeightShort + ? 15 + : 14.5), + ), ), - ), - Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) - ], - ) - - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: list) + ], + )), ); } - - getStack(Summaryoptions value, max, context, barHeight) { return Expanded( child: Container( @@ -88,8 +90,10 @@ class GetOutPatientStack extends StatelessWidget { decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, - end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. - colors: [Color(0x8FF5F6FA), Colors.red[100]], // red to yellow + end: Alignment(0.0, 1.0), + // 10% of the width, so there are ten blinds. + colors: [Color(0x8FF5F6FA), Colors.red[100]], + // red to yellow tileMode: TileMode.mirror, // repeats the gradient over the canvas ), borderRadius: BorderRadius.circular(4), @@ -119,34 +123,33 @@ class GetOutPatientStack extends StatelessWidget { child: Center( child: Align( child: FittedBox( - child: Row( - children: [ - AppText( - value.kPIParameter, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w500, - letterSpacing: -0.3, - ), - AppText( - ' (' + value.value.toString() + ') ', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, - textAlign: TextAlign.center, - color: Color(0xFF2B353E), - letterSpacing: -0.3, - fontWeight: FontWeight.bold, - ), - ], + child: Row( + children: [ + AppText( + value.kPIParameter, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w500, + letterSpacing: -0.3, + ), + AppText( + ' (' + value.value.toString() + ') ', + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + textAlign: TextAlign.center, + color: Color(0xFF2B353E), + letterSpacing: -0.3, + fontWeight: FontWeight.bold, ), - )), + ], + ), + )), ), )) ]), ), ); } - } - - diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart index 820dcd37..b9ac83f5 100644 --- a/lib/widgets/dashboard/row_count.dart +++ b/lib/widgets/dashboard/row_count.dart @@ -9,13 +9,14 @@ class RowCounts extends StatelessWidget { final Color c; final double height; - RowCounts(this.name, this.count, this.c, {this.height}); + @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(top:SizeConfig.getHeightMultiplier(height:height )* 0.2 , bottom: SizeConfig.getHeightMultiplier(height:height )* 0.2), - + padding: EdgeInsets.only( + top: SizeConfig.getHeightMultiplier(height: height) * 0.2, + bottom: SizeConfig.getHeightMultiplier(height: height) * 0.2), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -29,16 +30,19 @@ class RowCounts extends StatelessWidget { name, color: AppGlobal.appTextColor, fontWeight: FontWeight.w400, - textAlign: TextAlign.start, // from TextAlign.center + textAlign: TextAlign.start, + // from TextAlign.center fontSize: 14, letterSpacing: -0.84, textOverflow: TextOverflow.ellipsis, ), - SizedBox(width: 4,), + SizedBox( + width: 4, + ), AppText( - count.toString(), - color: AppGlobal.appTextColor, + count.toString(), + color: AppGlobal.appTextColor, textAlign: TextAlign.center, fontSize: 14, letterSpacing: -0.84, diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart index 7e5c2c70..e564399f 100644 --- a/lib/widgets/dashboard/swiper_rounded_pagination.dart +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -2,7 +2,9 @@ import 'package:flutter/material.dart'; class SwiperRoundedPagination extends StatelessWidget { final active; + SwiperRoundedPagination(this.active); + @override Widget build(BuildContext context) { return active == true diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index a35fa279..6ed049ad 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + /// Flexible container widget /// [widthFactor] If non-null, the fraction of the incoming width given to the child. /// If non-null, the child is given a tight width constraint that is the max diff --git a/lib/widgets/dialog/AskPermissionDialog.dart b/lib/widgets/dialog/AskPermissionDialog.dart index 58718373..9bcea574 100644 --- a/lib/widgets/dialog/AskPermissionDialog.dart +++ b/lib/widgets/dialog/AskPermissionDialog.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index c4343a4b..3862826d 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -1,12 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { final List labResult; @@ -146,7 +144,8 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: AppText('${result.resultValue}', + child: AppText( + '${result.resultValue}', color: Colors.grey[800]), ), height: 60), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 453cff30..9544967b 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; @@ -431,7 +431,7 @@ class _MyReferralPatientWidgetState extends State { width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), child: AppButton( - title : TranslationBase.of(context).replay, + title: TranslationBase.of(context).replay, onPressed: () async { final form = _formKey.currentState; if (form.validate()) { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 5c21f9ad..afc79d2a 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,13 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { @@ -21,98 +22,126 @@ class MyScheduleWidget extends StatelessWidget { List workingHours = Helpers.getWorkingHours( workingHoursTable.workingHours, ); - return Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - AppText( - projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , - fontSize: 16, - fontFamily: 'Poppins', - // fontSize: 18 - ), - AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', - fontSize: 14, - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - // fontSize: 18 - ), - ], - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.55, - child: CardWithBgWidget( - bgColor: AppDateUtils.isToday(workingHoursTable.date) - ? AppGlobal.appGreenColor - : Colors.transparent, - // hasBorder: false, - widget: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (AppDateUtils.isToday(workingHoursTable.date)) - AppText( - "Today", - fontSize: 1.8 * SizeConfig.textMultiplier, - fontFamily: 'Poppins', - color: AppGlobal.appGreenColor, - // fontSize: 18 - ), - SizedBox( - height: 10, + return Container( + color: HexColor("#EFEFEF"), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + SizedBox( + height: 10, + ), + Padding( + padding: const EdgeInsets.only(left: 21), + child: AppText( + projectViewModel.isArabic + ? AppDateUtils.getWeekDayArabic( + workingHoursTable.date.weekday) + : AppDateUtils.getWeekDay(workingHoursTable.date.weekday), + fontSize: MediaQuery.of(context).size.width*0.032, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + letterSpacing: -0.52, + color: AppGlobal.scheduleTextColor, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: workingHours.map((work) { - return Container( - margin: EdgeInsets.only(bottom:workingHours.length>1? 15:0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - if(workingHoursTable.clinicName!=null) - AppText( - workingHoursTable.clinicName??"", - fontSize: 15, - fontWeight: FontWeight.w700, - ), - Container( - width: MediaQuery.of(context).size.width*0.55, - child: AppText( - '${work.from} - ${work.to}', - fontSize: 15, - fontWeight: FontWeight.w300, - ), - ), - if(workingHoursTable.projectName!=null) - AppText( - workingHoursTable.projectName??"", - fontSize: 15, - fontWeight: FontWeight.w700, - ), - ], - ), - ); - }).toList(), + ), + Padding( + padding: const EdgeInsets.only(left: 19), + child: AppText( + ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + fontSize: MediaQuery.of(context).size.width*0.051, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + letterSpacing: -0.72, + color: AppGlobal.scheduleTextColor, ), - ], + ), + ], + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.70, + // height: MediaQuery.of(context).size.height * 0.16, + child: CardWithBgWidget( + padding: 12, + marginLeft: 8, + marginSymmetric: 7, + hasBorder: false, + bgColor: AppDateUtils.isToday(workingHoursTable.date) + ? AppGlobal.appGreenColor + : Colors.transparent, + widget: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (AppDateUtils.isToday(workingHoursTable.date)) + AppText( + "Today", + fontSize: 1.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: AppGlobal.appGreenColor, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: workingHours.map((work) { + return Container( + margin: EdgeInsets.only( + bottom: workingHours.length > 1 ? 15 : 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + if (workingHoursTable.clinicName != null) + Container( + width: MediaQuery.of(context).size.width * 0.65, + child: AppText( + Helpers + .convertToTitleCase( + workingHoursTable.clinicName ?? ""), + fontSize: MediaQuery.of(context).size.width*0.04, + fontWeight: FontWeight.w700, + letterSpacing: -0.64, + color: AppGlobal.scheduleTextColor, + ), + ), + // AppText( + Container( + child: AppText( + '${work.from} - ${work.to}', + fontSize: MediaQuery.of(context).size.width*0.03, + fontWeight: FontWeight.w300, + letterSpacing: -0.4, + ), + ), + SizedBox( + height: 12, + ), + if (workingHoursTable.projectName != null) + AppText( + workingHoursTable.projectName ?? "", + fontSize: MediaQuery.of(context).size.width*0.04, + fontWeight: FontWeight.w700, + letterSpacing: -0.64, + color: AppGlobal.scheduleTextColor, + ), + ], + ), + ); + }).toList(), + ), + ], + ), ), ), ), - ), - ], + ], + ), ); } } diff --git a/lib/widgets/home/home_item.dart b/lib/widgets/home/home_item.dart index 0de07d7b..55175fab 100644 --- a/lib/widgets/home/home_item.dart +++ b/lib/widgets/home/home_item.dart @@ -7,6 +7,7 @@ class HomeItem extends StatelessWidget { final String link; HomeItem(this.id, this.title, this.image, this.link); + @override Widget build(BuildContext context) { return InkWell( diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index f4f78c08..8db9b036 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -1,35 +1,34 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; import '../shared/rounded_container_widget.dart'; -/* - *@author: ibrahim albitar - *@Date:28/4/2020 - *@param: - *@return: - *@desc: - */ - class MedicineItemWidget extends StatefulWidget { final String label; final Color backgroundColor; final bool showBorder; + final bool showArrow; + final bool showPrice; final Color borderColor; final String url; + final String price; MedicineItemWidget( {@required this.label, this.backgroundColor = Colors.white, - this.showBorder = false, + this.showBorder = true, this.borderColor = Colors.white, - this.url}); + this.url, + this.showArrow = true, this.showPrice = false, this.price}); + @override _MedicineItemWidgetState createState() => _MedicineItemWidgetState(); } @@ -37,43 +36,72 @@ class MedicineItemWidget extends StatefulWidget { class _MedicineItemWidgetState extends State { @override Widget build(BuildContext context) { - return new RoundedContainer( - height: SizeConfig.heightMultiplier * 8, - child: Padding( - padding: const EdgeInsets.all(5.0), + return CardWithBgWidget( + // height: SizeConfig.heightMultiplier * 12.9, + bgColor: Colors.transparent, + hasBorder: false, + widget: Padding( + padding: const EdgeInsets.symmetric( + vertical: 4, + ), child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.start, children: [ if (widget.url != null) - Container( - height: 39, - width: 39, - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7)), + ClipRRect( + borderRadius: BorderRadius.circular(20.0), child: Image.network( widget.url, - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, + height: 25, + width: 30, + errorBuilder: (BuildContext context, Object exception, + StackTrace stackTrace) { + return Text(''); + }, + )), + Expanded( + child: Center( + child: Padding( + padding: EdgeInsets.all(2.5), + child: Align( + alignment: Alignment.centerLeft, + child: Column( + crossAxisAlignment:CrossAxisAlignment.start, + children: [ + AppText( + Helpers.convertToTitleCase(widget.label ?? ''), + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + if(widget.showPrice) + AppText( + Helpers.convertToTitleCase(widget.price ?? ''), + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + ], + ), ), ), ), - Expanded( - child: Padding( - padding: EdgeInsets.all(5), - child: Align( - alignment: Alignment.centerLeft, - child: AppText(widget.label)))), - Icon(EvaIcons.eye) + ), + if(widget.showArrow) + Icon(EvaIcons.arrowForward) ], ), ), - backgroundColor: widget.backgroundColor, - showBorder: widget.showBorder, - borderColor: widget.borderColor, - margin: EdgeInsets.all(4), - raduis: 10, + // backgroundColor: widget.backgroundColor, + // showBorder: widget.showBorder, + // borderColor: widget.borderColor, + // // margin: 4.0, + // // margin: EdgeInsets.all(4), + // raduis: 10, ); } diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart index c903bd7b..3f8f973d 100644 --- a/lib/widgets/patients/clinic_list_dropdwon.dart +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -7,10 +7,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ClinicList extends StatelessWidget { - ProjectViewModel projectsProvider; final int clinicId; - final Function (int value) onClinicChange; + final Function(int value) onClinicChange; ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); @@ -20,80 +19,57 @@ class ClinicList extends StatelessWidget { projectsProvider = Provider.of(context); return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 + child: projectsProvider.doctorClinicsList.length > 0 ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider.doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return projectsProvider.doctorClinicsList.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig.textMultiplier * 2.1, + color: Colors.black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + onClinicChange(newValue); + }, + items: projectsProvider.doctorClinicsList.map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: TextAlign.end, + ), + value: item.clinicID, ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), + }).toList(), + )), + ), + ), + ], ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), + ) + : AppText(TranslationBase.of(context).noClinic), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart deleted file mode 100644 index d2a68acd..00000000 --- a/lib/widgets/patients/dynamic_elements.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -class DynamicElements extends StatefulWidget { - final PatientModel _patientSearchFormValues; - final bool isFormSubmitted; - DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); - @override - _DynamicElementsState createState() => _DynamicElementsState(); -} - -class _DynamicElementsState extends State { - TextEditingController _toDateController = new TextEditingController(); - TextEditingController _fromDateController = new TextEditingController(); - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - print(id); - var selectedDate = DateFormat.yMd().format(pickedDate); - - if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _fromDateController.text = selectedDate; - } else { - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - return LayoutBuilder( - builder: (ctx, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, - onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = - _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - )), - SizedBox( - height: 5, - ), - if (widget._patientSearchFormValues.From == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6.0))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - readOnly: true, - borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - )), - if (widget._patientSearchFormValues.To == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 0e077895..3487c4fa 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,14 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; +import '../../util/helpers.dart'; class PatientReferralItemWidget extends StatelessWidget { final String referralStatus; @@ -52,7 +49,6 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), @@ -61,7 +57,8 @@ class PatientReferralItemWidget extends StatelessWidget { Container( child: CardWithBgWidget( bgColor: referralStatusCode == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor + //Color(0xffc4aa54) : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 @@ -82,11 +79,11 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 10.0, - letterSpacing: -0.4, + fontSize: 12.0, + letterSpacing: -0.48, fontWeight: FontWeight.w600, color: referralStatusCode == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 @@ -95,28 +92,42 @@ class PatientReferralItemWidget extends StatelessWidget { ? Colors.red[700] : Colors.red[900], ), - AppText( - referredDate, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - fontSize: 12.0, - color: Color(0XFF28353E), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + referredDate ?? "", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + fontSize: 12.0, + color: Color(0XFF28353E), + ), + AppText( + referredTime ?? "", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 12.0, + color: Color(0XFF575757), + letterSpacing: -0.48, + ), + ], ) ], ), + SizedBox( + height: 7, + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: AppText( - patientName, - fontSize: 16.0, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - letterSpacing: -0.64, - ), + AppText( + Helpers.convertToTitleCase(patientName ?? ""), + fontSize: 16.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + letterSpacing: -0.64, ), SizedBox( width: 0, @@ -128,100 +139,72 @@ class PatientReferralItemWidget extends StatelessWidget { ) : Icon(DoctorApp.female_1, color: Color(0xffF0448D)), - SizedBox( - width: 4, - ), - AppText( - referredTime, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 12.0, - color: Color(0XFF575757), - letterSpacing: 0.48, - ) ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - CustomRow( - label: - TranslationBase.of(context).fileNumber, - value: patientID, - ), - ], + CustomRow( + label: TranslationBase.of(context).fileNumber, + value: patientID, ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomRow( - label: isSameBranch - ? TranslationBase.of(context) - .referredFrom - : TranslationBase.of(context).refClinic, - value: !isReferralClinic - ? isSameBranch - ? TranslationBase.of(context) - .sameBranch - : TranslationBase.of(context) - .otherBranch - : " " + referralClinic, - ), - ], + CustomRow( + label: isSameBranch + ? TranslationBase.of(context).referredFrom + : TranslationBase.of(context).refClinic, + value: !isReferralClinic + ? isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context) + .otherBranch + : " " + Helpers.convertToTitleCase(referralClinic ?? ""), ), ], ), ), - Row( - children: [ - AppText( - nationality != null ? nationality : "", - fontWeight: FontWeight.w600, - color: Color(0xFF2E303A), - fontSize: 10.0, - letterSpacing: -0.4, - ), - nationalityFlag != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - nationalityFlag, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text(''); - }, - )) - : SizedBox() - ], + Padding( + padding: const EdgeInsets.only(right: 0.1), + child: Row( + children: [ + AppText( + nationality != null ? nationality : "", + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: 10.0, + letterSpacing: -0.4, + ), + nationalityFlag != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + nationalityFlag, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text(''); + }, + ) + ) + : SizedBox() + ], + ), ) ], ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomRow( - label: TranslationBase.of(context).remarks + " : ", - value: remark ?? "", - ), - ], + CustomRow( + label: TranslationBase.of(context).remarks + " : ", + value: remark ?? "", ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 3, right: 0, top: 0.1), child: Image.asset( isReferral ? 'assets/images/patient/ic_ref_arrow_up.png' @@ -232,8 +215,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), Container( margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + left: 0, top: 18, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 1.0), child: Container( width: 40, height: 40, @@ -242,8 +225,8 @@ class PatientReferralItemWidget extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( doctorAvatar, - height: 25, - width: 30, + height: 28, + width: 28, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { @@ -264,12 +247,12 @@ class PatientReferralItemWidget extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + left: 10, top: 17, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName ?? "", + Helpers.convertToTitleCase(referralDoctorName ?? ""), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 14.0, @@ -278,7 +261,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), if (clinicDescription != null) AppText( - clinicDescription, + Helpers.convertToTitleCase(clinicDescription ?? "") + , fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 10.0, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 49d2eb7a..4ea7f789 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -1,8 +1,8 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -11,11 +11,10 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; -import '../../../util/extenstions.dart'; +import '../../../util/extenstions.dart'; import 'ShowTimer.dart'; class PatientCard extends StatelessWidget { @@ -209,30 +208,30 @@ class PatientCard extends StatelessWidget { ) : patientInfo.arrivedOn != null ? Container( - padding: EdgeInsets.only(right: 9), - - child: AppText( - "${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - ) + padding: EdgeInsets.only(right: 9), + child: AppText( + "${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, + ), + ) : (patientInfo.appointmentDate != null && patientInfo .appointmentDate.isNotEmpty) ? Container( - padding: EdgeInsets.only(right: 9), - child: AppText( - " ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 11, - letterSpacing: -0.64, - ), - ) + padding: + EdgeInsets.only(right: 9), + child: AppText( + " ${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 11, + letterSpacing: -0.64, + ), + ) : SizedBox() ], )) @@ -318,8 +317,8 @@ class PatientCard extends StatelessWidget { patientInfo.nationality != null || patientInfo.nationalityId != null ? Container( - padding: EdgeInsets.only( - right: 7, top: 5), + padding: EdgeInsets.only( + right: 7, top: 5), child: ClipRRect( borderRadius: BorderRadius.circular(20.0), @@ -556,9 +555,7 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.only( - left: 9, - right: 9, - bottom: 9), + left: 9, right: 9, bottom: 9), child: SvgPicture.asset( 'assets/images/svgs/inpatient.svg', height: 25, diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index b769588b..36064110 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -1,5 +1,4 @@ - -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -7,9 +6,9 @@ import 'package:flutter/material.dart'; class ShowTimer extends StatefulWidget { final PatiantInformtion patientInfo; - const ShowTimer({ - Key key, this.patientInfo, + Key key, + this.patientInfo, }) : super(key: key); @override @@ -17,7 +16,6 @@ class ShowTimer extends StatefulWidget { } class _ShowTimerState extends State { - int remainingTime = 600; String displayTime = ''; @@ -52,7 +50,8 @@ class _ShowTimerState extends State { DateTime now = DateTime.now(); DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); String timer = AppDateUtils.differenceBetweenDateAndCurrent( - liveCareDate, context, isShowSecond: true, isShowDays: false); + liveCareDate, context, + isShowSecond: true, isShowDays: false); return timer; } diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index a3c4492f..13b7f20d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; @@ -71,55 +71,57 @@ class PatientProfileButton extends StatelessWidget { navigator(context, this.route); }, child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - padding: EdgeInsets.fromLTRB(8, 0, 8, 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: isDartIcon - ? Icon( - dartIcon, - size: 30, - color: color ?? Color(0xFF333C45), - ) - : new SvgPicture.asset( - icon, - width: 30, - height: 30, - ), - ) - ], - )), - Container( - alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, - padding: EdgeInsets.symmetric(horizontal: 7), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - !projectsProvider.isArabic ? this.nameLine1 : nameLine2, - color: color ?? AppGlobal.appTextColor, - letterSpacing: -0.33, - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 1.30, + Container( + padding: EdgeInsets.fromLTRB(8, 0, 8, 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: isDartIcon + ? Icon( + dartIcon, + size: 30, + color: color ?? Color(0xFF333C45), + ) + : new SvgPicture.asset( + icon, + width: 30, + height: 30, + ), + ) + ], + )), + Container( + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, + padding: EdgeInsets.symmetric(horizontal: 7), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + !projectsProvider.isArabic ? this.nameLine1 : nameLine2, + color: color ?? AppGlobal.appTextColor, + letterSpacing: -0.33, + fontWeight: FontWeight.w600, + textAlign: TextAlign.left, + fontSize: SizeConfig.textMultiplier * 1.30, + ), + AppText( + !projectsProvider.isArabic ? this.nameLine2 : nameLine1, + color: color ?? Color(0xFF2B353E), + fontWeight: FontWeight.w600, + textAlign: TextAlign.left, + fontHeight: 1.4, + fontSize: SizeConfig.textMultiplier * 1.30, + ), + if (isLoading) DrAppCircularProgressIndeicator() + ], ), - AppText( - !projectsProvider.isArabic ? this.nameLine2 : nameLine1, - color: color ?? Color(0xFF2B353E), - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontHeight: 1.4, - fontSize: SizeConfig.textMultiplier * 1.30, - ), - if (isLoading) DrAppCircularProgressIndeicator() - ], - ), - ), - ]), + ), + ]), ), decoration: BoxDecoration( // border: Border.all(), diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart index e0eb5b12..4068c7e5 100644 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:flutter/material.dart'; import './profile_general_info_content_widget.dart'; diff --git a/lib/widgets/patients/profile/app_bar/header_row.dart b/lib/widgets/patients/profile/app_bar/header_row.dart new file mode 100644 index 00000000..c5a0cd42 --- /dev/null +++ b/lib/widgets/patients/profile/app_bar/header_row.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class HeaderRow extends StatelessWidget { + final String label; + final String value; + final bool isExpanded; + + const HeaderRow({Key key, this.label, this.value, this.isExpanded = false}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + label, + isCopyable: true, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + isExpanded?Expanded(child: AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), ): + AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart similarity index 94% rename from lib/widgets/patients/profile/patient-profile-app-bar.dart rename to lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index 974d3590..60a48403 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -11,7 +11,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'large_avatar.dart'; +import '../large_avatar.dart'; +import 'header_row.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; @@ -342,7 +343,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase.of(context).dr}$doctorName', + Helpers.convertToTitleCase( + '${TranslationBase.of(context).dr}$doctorName'), color: Color(0xFF2E303A), fontWeight: FontWeight.w700, fontSize: SizeConfig @@ -366,9 +368,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { value: branch ?? '', ), if (clinic != null) - HeaderRow( - label: 'Clinic: ', - value: clinic ?? '', + Container( + width: + MediaQuery.of(context).size.width * + 0.51, + child: HeaderRow( + label: 'Clinic: ', + value: Helpers.convertToTitleCase( + clinic) ?? + '', + isExpanded: true), ), if (isMedicalFile && episode != null) HeaderRow( @@ -410,7 +419,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? isInpatient ? (isFromLabResult ? 210 : 200) : isAppointmentHeader - ? 290 + ? 340 : SizeConfig.isHeightVeryShort ? 137 : SizeConfig.isHeightShort @@ -419,35 +428,3 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { (SizeConfig.isWidthLarge ? 25 : 20) : height); } - -class HeaderRow extends StatelessWidget { - final String label; - final String value; - - const HeaderRow({Key key, this.label, this.value}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Row( - children: [ - AppText( - label, - isCopyable: true, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - SizedBox( - width: 1, - ), - AppText( - value, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - isCopyable: true, - ), - ], - ); - } -} diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart similarity index 97% rename from lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart rename to lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 46b8ed7f..bd90d1e4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -3,17 +3,18 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'header_row.dart'; + class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; @@ -307,9 +308,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"), if (patient.admissionDate != null) HeaderRow( - label: "${TranslationBase.of(context).numOfDays}: ", + label: + "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - patient.dischargeDate != null + patient.dischargeDate != null ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) diff --git a/lib/widgets/patients/profile/avatar_gradients.dart b/lib/widgets/patients/profile/avatar_gradients.dart index a6cce98d..f6a634fb 100644 --- a/lib/widgets/patients/profile/avatar_gradients.dart +++ b/lib/widgets/patients/profile/avatar_gradients.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; -class AvatarGradients{ - static List getGradients (String name) { - +class AvatarGradients { + static List getGradients(String name) { int code = (name?.length ?? 0) > 0 ? name.toUpperCase()[0].codeUnits[0] : 1; code += (name?.length ?? 0) > 1 ? name.toUpperCase()[1].codeUnits[0] : 0; @@ -39,4 +38,4 @@ class AvatarGradients{ return colors[code % colors.length]; } -} \ No newline at end of file +} diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index 80f54e12..36227ea5 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -24,14 +24,12 @@ class LargeAvatar extends StatelessWidget { Widget _getAvatar() { if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { return CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, + radius: SizeConfig.imageSizeMultiplier * 12, // radius: (52) child: ClipRRect( - borderRadius:BorderRadius.circular(50), - + borderRadius: BorderRadius.circular(50), child: Image.network( - url, + url, fit: BoxFit.fill, width: 700, ), diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 52af839c..84ea642d 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index 50afbdcf..b0e79268 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/medication.dart'; @@ -66,13 +66,13 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Navigator.push( context, MaterialPageRoute( - builder: (context) => - OutPatientPrescriptionDetailsScreen( - prescriptionResModel: - patientPrescriptionsList[index], - ), - settings: RouteSettings(name: 'OutPatientPrescriptionDetailsScreen') - ), + builder: (context) => + OutPatientPrescriptionDetailsScreen( + prescriptionResModel: + patientPrescriptionsList[index], + ), + settings: RouteSettings( + name: 'OutPatientPrescriptionDetailsScreen')), ); }, child: CardWithBgWidgetNew( diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 0a405d8d..e3891be1 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -1,14 +1,15 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:cached_network_image/cached_network_image.dart'; class ProfileWelcomeWidget extends StatelessWidget { final Widget clinicWidget; final double height; final bool isClinic; - ProfileWelcomeWidget(this.clinicWidget, {this.height = 150, this.isClinic = false}); + ProfileWelcomeWidget(this.clinicWidget, + {this.height = 150, this.isClinic = false}); @override Widget build(BuildContext context) { @@ -34,7 +35,8 @@ class ProfileWelcomeWidget extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(20), child: CachedNetworkImage( - imageUrl: authenticationViewModel.doctorProfile.doctorImageURL, + imageUrl: + authenticationViewModel.doctorProfile.doctorImageURL, fit: BoxFit.fill, width: 75, height: 75, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index fec33a62..abf548ed 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -16,7 +16,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final bool isInpatient; ProfileMedicalInfoWidget( - {Key key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to, + this.isInpatient}); @override Widget build(BuildContext context) { @@ -48,8 +54,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: HEALTH_SUMMARY, - nameLine1: "Health", //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", //TranslationBase.of(context).summaryReport, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, @@ -94,7 +102,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, + route: ORDER_PRESCRIPTION_OLD, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'assets/images/svgs/profile_screen/order prescription.svg'), @@ -178,7 +186,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - nameLine1: "Order", //"Text", + nameLine1: "Order", + //"Text", nameLine2: "Sheet", icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), ], diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index a7ab2412..9de84de2 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -70,6 +70,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).result, icon: 'assets/images/svgs/profile_screen/health summary.svg'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_OLD, + nameLine1: TranslationBase.of(context).patient, + nameLine2:TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', + icon: 'assets/images/svgs/profile_screen/order prescription.svg'), PatientProfileButton( key: key, patient: patient, @@ -96,8 +105,10 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, route: ORDER_NOTE, isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", //TranslationBase.of(context).orders, + nameLine1: "Order", + //"Text", + nameLine2: "Sheet", + //TranslationBase.of(context).orders, icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), PatientProfileButton( key: key, @@ -126,9 +137,11 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { arrivalType: arrivalType, isDisable: true, route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health + nameLine1: "Medical", + //Health //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report + nameLine2: "Report", + //Report //TranslationBase.of(context).summaryReport, icon: 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index a45f7cdc..297b9d75 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -1,10 +1,9 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -26,7 +25,9 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { this.to, this.isInpatient, this.isDischargedPatient}); + TabController _tabController; + void initState() { _tabController = TabController(length: 2); } @@ -72,11 +73,12 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: HEALTH_SUMMARY, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -96,7 +98,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, - icon: 'assets/images/svgs/profile_screen/health summary.svg'), + icon: + 'assets/images/svgs/profile_screen/health summary.svg'), PatientProfileButton( key: key, patient: patient, @@ -111,10 +114,11 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, + route: ORDER_PRESCRIPTION_OLD, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'assets/images/svgs/profile_screen/order prescription.svg'), + icon: + 'assets/images/svgs/profile_screen/order prescription.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -124,7 +128,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, - icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), + icon: + 'assets/images/svgs/profile_screen/Order Procedures.svg'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -134,7 +139,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, - icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), + icon: + 'assets/images/svgs/profile_screen/insurance approval.svg'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -144,46 +150,43 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, - icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + icon: + 'assets/images/svgs/profile_screen/patient sick leave.svg'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, + isDisable: patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'assets/images/svgs/profile_screen/UCAF.svg'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, + isDisable: patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, - icon: 'assets/images/svgs/profile_screen/refer patient.svg'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + icon: + 'assets/images/svgs/profile_screen/refer patient.svg'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, + isDisable: patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, - icon: 'assets/images/svgs/profile_screen/admission req.svg'), + icon: + 'assets/images/svgs/profile_screen/admission req.svg'), if (isInpatient) PatientProfileButton( key: key, @@ -193,7 +196,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, - icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), + icon: + 'assets/images/svgs/profile_screen/Progress notes.svg'), if (isInpatient) PatientProfileButton( key: key, @@ -201,9 +205,11 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - nameLine1: "Order", //"Text", + nameLine1: "Order", + //"Text", nameLine2: "Sheet", - icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), + icon: + 'assets/images/svgs/profile_screen/Progress notes.svg'), ], ), ), diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index b8314b03..718c3081 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -25,9 +25,7 @@ class _VitalSignDetailsWidgetState extends State { decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0) - ), + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), ), margin: EdgeInsets.all(20), @@ -38,7 +36,7 @@ class _VitalSignDetailsWidgetState extends State { children: [ Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0,color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), children: fullData(), ), @@ -48,7 +46,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData(){ + List fullData() { List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -112,5 +110,4 @@ class _VitalSignDetailsWidgetState extends State { }); return tableRow; } - } diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 18d8e778..bc4600b4 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -39,46 +39,49 @@ class NumberTextInputFormatter extends TextInputFormatter { final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - TextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction = TextInputAction.done, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.fillColor, - this.hintColor, - this.hasBorder = true, - this.onTapTextFields, - this.hasLabelText = false, - this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) - : super(key: key); + TextFields({ + Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction = TextInputAction.done, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.fillColor, + this.hintColor, + this.hasBorder = true, + this.onTapTextFields, + this.hasLabelText = false, + this.showLabelText = false, + this.borderRadius = 8.0, + this.borderColor, + this.borderWidth = 1, + }) : super(key: key); final String hintText; final String initialValue; @@ -203,8 +206,7 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { - - widget.borderColor = widget.borderColor?? Colors.grey; + widget.borderColor = widget.borderColor ?? Colors.grey; return (AnimatedContainer( duration: Duration(milliseconds: 300), decoration: widget.bare @@ -225,7 +227,7 @@ class _TextFieldsState extends State { onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, + // autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null @@ -266,7 +268,7 @@ class _TextFieldsState extends State { fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, + // WhitelistingTextInputFormatter.digitsOnly, _mobileFormatter, ] : widget.inputFormatters, @@ -281,7 +283,6 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, - fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), @@ -310,7 +311,8 @@ class _TextFieldsState extends State { width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + ? BorderRadius.circular( + widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( @@ -321,28 +323,35 @@ class _TextFieldsState extends State { .withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), + borderRadius: BorderRadius.circular( + widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + ? BorderSide( + color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + ? BorderRadius.circular( + widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + ? BorderSide( + color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + ? BorderRadius.circular( + widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: widget.borderColor,width: widget.borderWidth) + ? BorderSide( + color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) + ? BorderRadius.circular( + widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), ), diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart deleted file mode 100644 index 848f5265..00000000 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ /dev/null @@ -1,127 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:expandable/expandable.dart'; -import 'package:flutter/material.dart'; - - -/// App Expandable Notifier with animation -/// [headerWidget] widget want to show in the header -/// [bodyWidget] widget want to show in the body -/// [title] the widget title -/// [collapsed] The widget shown in the collapsed state -class AppExpandableNotifier extends StatefulWidget { - final Widget headerWidget; - final Widget bodyWidget; - final String title; - final Widget collapsed; - final bool isExpand; - bool expandFlag = false; - var controller = new ExpandableController(); - AppExpandableNotifier( - {this.headerWidget, - this.bodyWidget, - this.title, - this.collapsed, - this.isExpand = false}); - - _AppExpandableNotifier createState() => _AppExpandableNotifier(); -} - -class _AppExpandableNotifier extends State { - - @override - void initState() { - setState(() { - if (widget.isExpand) { - widget.expandFlag = widget.isExpand; - widget.controller.expanded = true; - } - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - - return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.only(left: 10, right: 10, top: 4), - child: Card( - color: Colors.grey[200], - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: widget.headerWidget, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - hasIcon: false, - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, - ), - header: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: Text( - widget.title ?? TranslationBase.of(context).details, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2, - ), - ), - ), - ), - IconButton( - icon: new Container( - height: 28.0, - width: 30.0, - decoration: new BoxDecoration( - color: Theme.of(context).primaryColor, - shape: BoxShape.circle, - ), - child: new Center( - child: new Icon( - widget.expandFlag - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 30.0, - ), - ), - ), - onPressed: () { - setState(() { - widget.expandFlag = !widget.expandFlag; - widget.controller.expanded = widget.expandFlag; - }); - }), - ]), - collapsed: widget.collapsed ?? Container(), - expanded: widget.bodyWidget, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), - child: Expandable( - controller: widget.controller, - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index 4b6d753b..6f6e27d9 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:progress_hud_v2/progress_hud.dart'; import 'loader/gif_loader_container.dart'; @@ -14,20 +13,19 @@ class AppLoaderWidget extends StatefulWidget { } class _AppLoaderWidgetState extends State { - - @override Widget build(BuildContext context) { return Container( height: MediaQuery.of(context).size.height, - child: Stack( children: [ Container( - color: widget.containerColor??Colors.grey.withOpacity(0.6), + color: widget.containerColor ?? Colors.grey.withOpacity(0.6), ), - Container(child: GifLoaderContainer(), margin: EdgeInsets.only( - bottom: MediaQuery.of(context).size.height * 0.09)) + Container( + child: GifLoaderContainer(), + margin: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height * 0.09)) ], ), ); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index b930c21a..c214a040 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -24,6 +24,7 @@ class AppScaffold extends StatelessWidget { final String subtitle; final bool isHomeIcon; final bool extendBody; + AppScaffold( {this.appBarTitle = '', this.body, @@ -33,7 +34,11 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar}); + this.appBar, + this.subtitle, + this.drawer, + this.extendBody = false, + this.bottomNavigationBar}); @override Widget build(BuildContext context) { @@ -44,7 +49,8 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: backgroundColor ?? Colors.white, + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor + , drawer: drawer, extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, @@ -52,7 +58,8 @@ class AppScaffold extends StatelessWidget { ? appBar ?? AppBar( elevation: 0, - backgroundColor: Colors.white, //HexColor('#515B5D'), + backgroundColor: Colors.white, + //HexColor('#515B5D'), textTheme: TextTheme( headline6: TextStyle( color: Colors.black87, @@ -62,8 +69,11 @@ class AppScaffold extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text(appBarTitle.toUpperCase()), - if(subtitle!=null) - Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + if (subtitle != null) + Text( + subtitle, + style: TextStyle(fontSize: 12, color: Colors.red), + ), ], ), leading: Builder(builder: (BuildContext context) { diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index f612e9e0..006c1499 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -1,9 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index dca59ee0..705260bb 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; @@ -43,8 +42,7 @@ class _BottomNavBarState extends State { color: Colors.white, child: Container( decoration: BoxDecoration( - border: Border.all(color: Color(0XFFEFEFEF), width: 1) - ), + border: Border.all(color: Color(0XFFEFEFEF), width: 1)), child: Padding( padding: EdgeInsets.symmetric(horizontal: 18), child: Row( @@ -70,7 +68,6 @@ class _BottomNavBarState extends State { currentIndex: 1, name: TranslationBase.of(context).mySchedule, dashboardViewModel: widget.dashboardViewModel, - ), BottomNavigationItem( icon: DoctorApp.qr_reader, @@ -81,7 +78,6 @@ class _BottomNavBarState extends State { currentIndex: 2, name: TranslationBase.of(context).qr, dashboardViewModel: widget.dashboardViewModel, - ), BottomNavigationItem( icon: DoctorApp.dr_reply_1, @@ -92,7 +88,6 @@ class _BottomNavBarState extends State { currentIndex: 3, name: TranslationBase.of(context).replay2, dashboardViewModel: widget.dashboardViewModel, - ), ], ), diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 8924d719..6554a8bd 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -2,14 +2,10 @@ import 'package:badges/badges.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; - -import '../../locator.dart'; class BottomNavigationItem extends StatelessWidget { final IconData icon; @@ -81,7 +77,8 @@ class BottomNavigationItem extends StatelessWidget { child: AppText(name ?? "", textAlign: TextAlign.center, fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, + SizeConfig.getTextMultiplierBasedOnWidth() * + 2.5, letterSpacing: -0.24, color: AppGlobal.appTextColor, fontWeight: FontWeight.w600) //#989898, diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index bb43dc8c..395a8cd2 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -13,7 +13,7 @@ class AppButton extends StatefulWidget { final IconData iconData; final Widget icon; final Color color; - final double fontSize; + double fontSize; final double padding; final Color fontColor; final bool loading; @@ -32,8 +32,8 @@ class AppButton extends StatefulWidget { this.iconData, this.icon, this.color, - this.fontSize = 16, - this.padding = 13, + this.fontSize, + this.padding = 8, this.loading = false, this.disabled = false, this.fontColor = Colors.white, @@ -52,9 +52,14 @@ class AppButton extends StatefulWidget { class _AppButtonState extends State { @override Widget build(BuildContext context) { + if (widget.fontSize == null) { + widget.fontSize = SizeConfig.getHeightMultiplier() * + (SizeConfig.isHeightVeryShort ? 2.1 :SizeConfig.isHeightShort?1.8: 1.7); + } return Container( // height: MediaQuery.of(context).size.height * 0.075, - height: widget.height, + height: widget.height?? SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 6 :SizeConfig.isHeightShort?5.5: 5), child: IgnorePointer( ignoring: widget.loading || widget.disabled, child: RawMaterialButton( diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 3c5cc32d..8de17cd1 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'app_buttons_widget.dart'; class ButtonBottomSheet extends StatelessWidget { - final GestureTapCallback onPressed; final String title; final IconData iconData; @@ -21,7 +20,8 @@ class ButtonBottomSheet extends StatelessWidget { final double vPadding; final double hPadding; - ButtonBottomSheet({@required this.onPressed, + ButtonBottomSheet({ + @required this.onPressed, this.title, this.iconData, this.icon, @@ -36,7 +36,8 @@ class ButtonBottomSheet extends StatelessWidget { this.hPadding = 0, this.radius = 8.0, this.hasBorder = false, - this.borderColor,}); + this.borderColor, + }); @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart deleted file mode 100644 index 48c65baf..00000000 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ /dev/null @@ -1,259 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -/// SecondaryButton widget -/// [label] button label -/// [icon] button icon its optional -/// [iconOnly] just show the icon -/// [color] the background color -/// [textColor] the text color -/// [onTap] button function -/// [loading] show the progress indicator -/// [disabled] disabled the button -/// [borderColor] the button border color -/// [noBorderRadius] remove border radius -class SecondaryButton extends StatefulWidget { - SecondaryButton( - {Key key, - this.label = "", - this.icon, - this.iconOnly = false, - this.color, - this.textColor = Colors.white, - this.onTap, - this.loading: false, - this.small = false, - this.disabled = false, - this.borderColor, - this.noBorderRadius = false}) - : super(key: key); - - final String label; - final Widget icon; - final VoidCallback onTap; - final bool loading; - final Color color; - final Color textColor; - final Color borderColor; - final bool small; - final bool iconOnly; - final bool disabled; - final bool noBorderRadius; - - @override - _SecondaryButtonState createState() => _SecondaryButtonState(); -} - -class _SecondaryButtonState extends State - with TickerProviderStateMixin { - double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; - - double _rippleSize = 0.0; - AnimationController _rippleController; - Animation _rippleAnimation; - - @override - void initState() { - if (widget.disabled != null && !widget.disabled) { - setState(() { - _rippleSize = 1.0; - }); - } - _animationController = AnimationController( - vsync: this, - lowerBound: 0.7, - upperBound: 1.0, - duration: Duration(milliseconds: 120)); - _animation = CurvedAnimation( - parent: _animationController, - curve: Curves.easeOutQuad, - reverseCurve: Curves.easeOutQuad); - _animation.addListener(() { - setState(() { - _buttonSize = _animation.value; - }); - }); - - _rippleController = AnimationController( - vsync: this, - lowerBound: 0.0, - upperBound: 1.0, - duration: Duration(seconds: 1)); - _rippleAnimation = CurvedAnimation( - parent: _rippleController, curve: Curves.easeInOutQuint); - _rippleAnimation.addListener(() { - setState(() { - _rippleSize = _rippleAnimation.value; - }); - }); - super.initState(); - } - - @override - void dispose() { - _animationController.dispose(); - _rippleController.dispose(); - super.dispose(); - } - - Widget _buildIcon() { - if (widget.icon != null && (widget.label != null && widget.label != "")) { - return Container(height: 25.0, child: widget.icon); - } else if (widget.icon != null && - (widget.label == null || widget.label == "")) { - return Container(height: 25.0, width: 25, child: widget.icon); - } else { - return Container(); - } - } - - @override - void didUpdateWidget(SecondaryButton oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.disabled != widget.disabled) { - bool d = widget.disabled ?? false; - if (!d) { - _rippleController.forward(); - } else { - if (_rippleSize == 1.0) - _rippleController.reverse(from: 1.0); - else - _rippleController.reverse(); - } - } - } - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return IgnorePointer( - ignoring: widget.loading, - child: GestureDetector( - onTapDown: (TapDownDetails tap) { - _animationController.reverse(from: 1.0); - }, - onTapUp: (TapUpDetails tap) { - _animationController.forward(); - }, - onTapCancel: () { - _animationController.forward(); - }, - onTap: () => { - widget.disabled ? null : widget.onTap(), - }, - // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), - behavior: HitTestBehavior.opaque, - child: Transform.scale( - scale: _buttonSize, - child: Container( - decoration: BoxDecoration( - border: widget.borderColor != null - ? Border.all( - color: widget.borderColor.withOpacity(0.1), width: 2.0) - : null, - borderRadius: BorderRadius.all(Radius.circular(100.0)), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.04), - spreadRadius: -0.0, - offset: Offset(0, 4.0), - blurRadius: 18.0) - ], - ), - child: ClipRRect( - borderRadius: widget.noBorderRadius - ? BorderRadius.all(Radius.circular(0.0)) - : BorderRadius.all(Radius.circular(10.0)), - child: Stack( - children: [ - Positioned( - left: 0, - bottom: 0, - child: Container( - width: MediaQuery.of(context).size.width, - height: 100, - decoration: BoxDecoration( - color: widget.disabled - ? Colors.grey - : widget.color ?? Theme.of(context).buttonColor), - ), - ), - Positioned( - left: -MediaQuery.of(context).size.width * 2.2 / 1.8, - bottom: -MediaQuery.of(context).size.width * 2.2 / 1.8, - child: Transform.scale( - scale: widget.disabled != null ? _rippleSize : 1.0, - child: Container( - width: MediaQuery.of(context).size.width * 2.2, - height: MediaQuery.of(context).size.width * 2.2, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: widget.disabled - ? Colors.grey - : widget.color ?? Theme.of(context).buttonColor, - ), - ), - ), - ), - Container( - padding: widget.iconOnly - ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) - : EdgeInsets.only( - top: widget.small ? 8.0 : 14.0, - bottom: widget.small ? 6.0 : 14.0, - left: 18.0, - right: 18.0), - child: Stack( - children: [ - Positioned( - child: _buildIcon(), - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - widget.loading - ? Padding( - padding: EdgeInsets.all(2.6), - child: SizedBox( - height: 19.0, - width: 19.0, - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[300], - ), - ), - ), - ) - : Padding( - padding: EdgeInsets.only( - bottom: widget.small ? 4.0 : 3.0), - child: Text( - widget.label, - style: TextStyle( - color: widget.textColor, - fontSize: 16, - fontWeight: FontWeight.w700, - fontFamily: 'Poppins'), - ), - ) - ], - ) - ], - ), - ), - ], - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index 00b836bc..333d82e3 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -21,10 +21,10 @@ class CardWithBgWidgetNew extends StatelessWidget { margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), color: HexColor('#FFFFFF'), @@ -33,18 +33,16 @@ class CardWithBgWidgetNew extends StatelessWidget { Center( child: Container( - // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 - // margin: EdgeInsets.only(left: 10), + // padding:EdgeInsets.fromLTRB(0, 10,0, 10), //EdgeInsets.all(10.0),//10 + // margin: EdgeInsets.only(left: 10), child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: widget), - )), + padding: const EdgeInsets.all(8.0), + child: Center(child: widget), + )), ) ], ), ), ); } - - } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index d7513975..9f45c187 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { @@ -31,8 +32,17 @@ class CardWithBgWidget extends StatelessWidget { border: Border.all( color: hasBorder ? Color(0xFF707070) : Colors.transparent, width: hasBorder ? 0.30 : 0), - + boxShadow: [ + BoxShadow( + color: HexColor('#0000000D').withOpacity(0.03), + //color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 5, + offset: Offset(0, 3), // changes position of shadow + ), + ], ), + child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), child: Stack( @@ -47,6 +57,7 @@ class CardWithBgWidget extends StatelessWidget { bottomRight: Radius.circular(10), ), ), + width: 6, ), bottom: 1, @@ -62,7 +73,9 @@ class CardWithBgWidget extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), + ), + width: 5, ), bottom: 1, @@ -71,7 +84,9 @@ class CardWithBgWidget extends StatelessWidget { ), Container( padding: EdgeInsets.all(padding), - margin: EdgeInsets.only(left: !projectProvider.isArabic?marginLeft:0, right:projectProvider.isArabic?marginLeft:0 ), + margin: EdgeInsets.only( + left: !projectProvider.isArabic ? marginLeft : 0, + right: projectProvider.isArabic ? marginLeft : 0), child: widget) ], ), diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart index f4bd354e..cb89d635 100644 --- a/lib/widgets/shared/charts/app_time_series_chart.dart +++ b/lib/widgets/shared/charts/app_time_series_chart.dart @@ -1,8 +1,8 @@ import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:flutter/material.dart'; import '../../../config/size_config.dart'; -import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; import '../../../widgets/shared/rounded_container_widget.dart'; /* diff --git a/lib/widgets/shared/dialogs/ShowImageDialog.dart b/lib/widgets/shared/dialogs/ShowImageDialog.dart index 302366b7..8ef4513f 100644 --- a/lib/widgets/shared/dialogs/ShowImageDialog.dart +++ b/lib/widgets/shared/dialogs/ShowImageDialog.dart @@ -5,6 +5,7 @@ class ShowImageDialog extends StatelessWidget { final String imageUrl; const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); + @override Widget build(BuildContext context) { return SimpleDialog( @@ -12,10 +13,8 @@ class ShowImageDialog extends StatelessWidget { Container( width: 340, height: 340, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12) - ), - child: Image.network( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), + child: Image.network( imageUrl, fit: BoxFit.fill, ), @@ -23,4 +22,4 @@ class ShowImageDialog extends StatelessWidget { ], ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index dfaf9143..aa03320d 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import '../../../config/config.dart'; + class ListSelectDialog extends StatefulWidget { final List list; final String attributeName; @@ -44,7 +46,6 @@ class _ListSelectDialogState extends State { } showAlertDialog(BuildContext context) { - // set up the buttons Widget cancelButton = FlatButton( child: Text(TranslationBase.of(context).cancel), onPressed: () { @@ -56,9 +57,7 @@ class _ListSelectDialogState extends State { Navigator.of(context).pop(); this.widget.okFunction(widget.selectedValue); }); -// set up the AlertDialog AlertDialog alert = AlertDialog( - // title: Text(widget.title), content: createDialogList(), actions: [ cancelButton, @@ -79,7 +78,10 @@ class _ListSelectDialogState extends State { height: MediaQuery.of(context).size.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - widget.hintSearchText ?? TranslationBase.of(context).search, null, false, + widget.hintSearchText ?? + TranslationBase.of(context).search, + null, + false, suffixIcon: Icon( Icons.search, )), @@ -95,12 +97,17 @@ class _ListSelectDialogState extends State { children: [ ...items .map((item) => RadioListTile( - title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId].toString(), + title: Text( + "${item[widget.attributeName].toString()}"), + groupValue: widget + .selectedValue[widget.attributeValueId] + .toString(), value: item[widget.attributeValueId].toString(), - activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId].toString(), + activeColor: AppGlobal.appRedColor, + selected: item[widget.attributeValueId] + .toString() == + widget.selectedValue[widget.attributeValueId] + .toString(), onChanged: (val) { setState(() { widget.selectedValue = item; @@ -127,7 +134,9 @@ class _ListSelectDialogState extends State { if (query.isNotEmpty) { List dummyListData = List(); dummySearchList.forEach((item) { - if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { + if ("${item[widget.attributeName].toString()}" + .toLowerCase() + .contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 7c12b54a..9c407367 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -42,12 +42,22 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), + child: AppText( + TranslationBase.of(context).cancel, + color: Colors.grey, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3.5 : 5), + ), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( - child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), + child: AppText( + this.widget.okText, + color: Colors.grey, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3.5 : 5), + ), onPressed: () { this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); @@ -75,7 +85,6 @@ class _MasterKeyDailogState extends State { title: AppText( '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + (widget.isICD ? '/${item.code}' : ''), - ), groupValue: widget.isICD ? widget.selectedValue.code.toString() diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart index b43557cb..d757edcd 100644 --- a/lib/widgets/shared/divider_with_spaces_around.dart +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -2,9 +2,11 @@ import 'package:flutter/material.dart'; class DividerWithSpacesAround extends StatelessWidget { DividerWithSpacesAround({ - Key key, this.height = 0, + Key key, + this.height = 0, }); - final double height ; + + final double height; @override Widget build(BuildContext context) { diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 5bd12bb8..d4f34326 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -3,11 +3,14 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/size_config.dart'; + class DoctorCard extends StatelessWidget { final String doctorName; final String branch; @@ -32,13 +35,15 @@ class DoctorCard extends StatelessWidget { this.orderNo, this.isPrescriptions = false, this.clinic, - this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); + this.isShowEye = true, + this.isShowTime = true, + this.isNoMargin = false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(!isNoMargin? 10:0), + margin: EdgeInsets.all(!isNoMargin ? 10 : 0), decoration: BoxDecoration( border: Border.all( width: 0.5, @@ -73,7 +78,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions&& isShowTime) + if (!isPrescriptions && isShowTime) AppText( '${AppDateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, @@ -138,41 +143,22 @@ class DoctorCard extends StatelessWidget { ], ), if (clinic != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinic + - ": ", - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: AppText( - clinic, - fontSize: 14, - ), - ) - ], + CustomRow( + label: TranslationBase.of(context).clinic + + ": ", + value: clinic, + valueSize: 13, + labelSize: 13, ), if (branch != null) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontSize: 14, - color: Colors.grey[500], - ), - Expanded( - child: AppText( - branch, - fontSize: 14, - ), - ) - ], - ) + CustomRow( + label: TranslationBase.of(context).branch + + ": ", + value: branch, + valueSize: 13, + labelSize: 13, + ), + ]), ), ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index abb8efcc..dbcd8556 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/config.dart'; + class DoctorCardInsurance extends StatelessWidget { final String doctorName; final String approvalNo; @@ -63,7 +65,7 @@ class DoctorCardInsurance extends StatelessWidget { ), color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127), ), ), @@ -84,7 +86,7 @@ class DoctorCardInsurance extends StatelessWidget { "$approvalStatus", color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127), letterSpacing: -0.4, fontSize: diff --git a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart index 2c476ec8..17b9b5e6 100644 --- a/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart +++ b/lib/widgets/shared/dr_app_circular_progress_Indeicator.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + class DrAppCircularProgressIndeicator extends StatelessWidget { const DrAppCircularProgressIndeicator({ Key key, @@ -11,4 +12,4 @@ class DrAppCircularProgressIndeicator extends StatelessWidget { child: Center(child: const CircularProgressIndicator()), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart index de9fd698..62168c93 100644 --- a/lib/widgets/shared/errors/dr_app_embedded_error.dart +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -20,12 +20,12 @@ class DrAppEmbeddedError extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: AppText( - error, - color: Theme.of(context).errorColor, - textAlign: TextAlign.center, - margin: 10, - ), - ); + child: AppText( + error, + color: Theme.of(context).errorColor, + textAlign: TextAlign.center, + margin: 10, + ), + ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/errors/error_message.dart b/lib/widgets/shared/errors/error_message.dart index 2930ae84..c6a075cb 100644 --- a/lib/widgets/shared/errors/error_message.dart +++ b/lib/widgets/shared/errors/error_message.dart @@ -18,17 +18,23 @@ class ErrorMessage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), SvgPicture.asset('assets/images/svgs/no data.svg'), Center( child: Center( child: Padding( - padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30), - child: Center(child: AppText(error??'' , textAlign: TextAlign.center,)), + padding: const EdgeInsets.only( + top: 12, bottom: 12, right: 20, left: 30), + child: Center( + child: AppText( + error ?? '', + textAlign: TextAlign.center, + )), ), ), ) - ], ), ), diff --git a/lib/widgets/shared/expandable-widget-header-body.dart b/lib/widgets/shared/expandable-widget-header-body.dart index 20d95bcd..e5f06b7a 100644 --- a/lib/widgets/shared/expandable-widget-header-body.dart +++ b/lib/widgets/shared/expandable-widget-header-body.dart @@ -9,7 +9,8 @@ class HeaderBodyExpandableNotifier extends StatefulWidget { bool expandFlag = false; var controller = new ExpandableController(); - HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); + HeaderBodyExpandableNotifier( + {this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); @override _HeaderBodyExpandableNotifierState createState() => @@ -18,12 +19,11 @@ class HeaderBodyExpandableNotifier extends StatefulWidget { class _HeaderBodyExpandableNotifierState extends State { - @override void initState() { super.initState(); - } + @override Widget build(BuildContext context) { setState(() { diff --git a/lib/widgets/shared/expandable_item_widget.dart b/lib/widgets/shared/expandable_item_widget.dart index d369e72a..b03fecf6 100644 --- a/lib/widgets/shared/expandable_item_widget.dart +++ b/lib/widgets/shared/expandable_item_widget.dart @@ -8,84 +8,92 @@ */ import 'package:flutter/material.dart'; -class ExpandableItem extends StatefulWidget{ - - final ListlistItems; +class ExpandableItem extends StatefulWidget { + final List listItems; final String headerTitle; - ExpandableItem(this.headerTitle,this.listItems); + ExpandableItem(this.headerTitle, this.listItems); @override - _ExpandableItemState createState() => _ExpandableItemState(); - + _ExpandableItemState createState() => _ExpandableItemState(); } -class _ExpandableItemState extends State -{ - bool isExpand=false; + +class _ExpandableItemState extends State { + bool isExpand = false; + @override void initState() { super.initState(); - isExpand=false; + isExpand = false; } + @override Widget build(BuildContext context) { - ListlistItem=this.widget.listItems; - return Container( + List listItem = this.widget.listItems; + return Container( child: Padding( - padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0), + padding: (isExpand == true) + ? const EdgeInsets.all(6.0) + : const EdgeInsets.all(8.0), child: Container( - decoration:BoxDecoration( - color: Colors.white, - borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)), - - - - - - ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: (isExpand != true) + ? BorderRadius.all(Radius.circular(50)) + : BorderRadius.all(Radius.circular(25)), + ), child: ExpansionTile( key: PageStorageKey(this.widget.headerTitle), title: Container( width: double.infinity, - - child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)), - - trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black), - onExpansionChanged: (value){ + child: Text( + this.widget.headerTitle, + style: TextStyle( + fontSize: (isExpand != true) ? 18 : 22, + color: Colors.black, + fontWeight: FontWeight.bold), + )), + trailing: (isExpand == true) + ? Icon( + Icons.keyboard_arrow_up, + color: Colors.black, + ) + : Icon(Icons.keyboard_arrow_down, color: Colors.black), + onExpansionChanged: (value) { setState(() { - isExpand=value; + isExpand = value; }); }, children: [ - for(final item in listItem) - Padding( - padding: const EdgeInsets.all(8.0), - child: InkWell( - onTap: (){ - print(Text("Selected Item $item "+this.widget.headerTitle )); - //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); - }, - child: Container( - width: double.infinity, - decoration:BoxDecoration( - color: Colors.white, - - border: Border(top: BorderSide(color: Theme.of(context).dividerColor)) - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text(item,style: TextStyle(color: Colors.black),), - - )), - ), - ) - - + for (final item in listItem) + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + print(Text( + "Selected Item $item " + this.widget.headerTitle)); + //========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle ))); + }, + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + border: Border( + top: BorderSide( + color: Theme.of(context).dividerColor))), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + item, + style: TextStyle(color: Colors.black), + ), + )), + ), + ) ], - ), ), ), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b2c2224b..eb9f2511 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -30,15 +30,14 @@ class _GifLoaderContainerState extends State @override Widget build(BuildContext context) { return Center( - //progress-loading.gif + //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - - controller: controller1, - image: AssetImage( - "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )); + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage( + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart index 264e1a66..1308a671 100644 --- a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart +++ b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart @@ -2,14 +2,12 @@ import 'package:flutter/material.dart'; import 'gif_loader_container.dart'; - class GifLoaderDialogUtils { static showMyDialog(BuildContext context) { showDialog(context: context, builder: (ctx) => GifLoaderContainer()); } static hideDialog(BuildContext context) { - if(Navigator.canPop(context)) - Navigator.of(context).pop(); + if (Navigator.canPop(context)) Navigator.of(context).pop(); } } diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index c61913a4..6370be77 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.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/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; @@ -44,7 +44,6 @@ class _MasterKeyCheckboxSearchWidgetState List items = List(); TextEditingController filteredSearchController = TextEditingController(); - @override void initState() { items.addAll(widget.masterList); @@ -77,7 +76,8 @@ class _MasterKeyCheckboxSearchWidgetState child: ListView( children: [ AppTextFieldCustom( - height: Helpers.getTextFieldHeight(),//MediaQuery.of(context).size.height * 0.070, + height: Helpers.getTextFieldHeight(), + //MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).searchHistory, isTextFieldHasSuffix: true, hasBorder: false, @@ -133,9 +133,10 @@ class _MasterKeyCheckboxSearchWidgetState ? historyInfo.nameAr : historyInfo.nameEn : historyInfo.nameEn, - color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3 : 3.8), letterSpacing: -0.56, ), ), diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index 32232628..2fe52ce7 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -31,7 +31,9 @@ class NetworkBaseView extends StatelessWidget { return AppLoaderWidget(); break; case ViewState.Error: - return ErrorMessage(error: baseViewModel.error ,); + return ErrorMessage( + error: baseViewModel.error, + ); break; } } diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index 3db93f9d..a1f2c9cd 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -17,6 +17,7 @@ class ProfileImageWidget extends StatelessWidget { double width; Color color; double fontsize; + ProfileImageWidget( {this.url, this.name, @@ -32,24 +33,21 @@ class ProfileImageWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: height, - width: width, - child:CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius:BorderRadius.circular(50), - - child: Image.network( - url, - fit: BoxFit.fill, - width: 700, + height: height, + width: width, + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(50), + child: Image.network( + url, + fit: BoxFit.fill, + width: 700, + ), ), - ), - backgroundColor: Colors.transparent, - ) - ), + backgroundColor: Colors.transparent, + )), name == null || des == null ? SizedBox() : SizedBox( diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart index 9c622dd3..25a23140 100644 --- a/lib/widgets/shared/rounded_container_widget.dart +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -53,7 +53,7 @@ class _RoundedContainerState extends State { margin: widget.margin, decoration: widget.showBorder == true ? BoxDecoration( - color: Colors.white/*Theme.of(context).primaryColor*/, + color: Colors.white /*Theme.of(context).primaryColor*/, border: Border.all( color: widget.borderColor, width: widget.borderWidth), borderRadius: widget.customCornerRaduis diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index dad7e2d1..1a2e1bcd 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -7,13 +7,13 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'dart:async'; import 'package:speech_to_text/speech_to_text.dart' as stt; class SpeechToText { final BuildContext context; static var dialog; static stt.SpeechToText speech = stt.SpeechToText(); + SpeechToText({ @required this.context, }); @@ -59,6 +59,7 @@ class _MyStatefulBuilderState extends State { var searchText; static StreamSubscription streamSubscription; static var isClosed = false; + @override void initState() { streamSubscription = event.controller.stream.listen((p) { diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 769cd4f8..6bf15219 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -96,7 +96,7 @@ class _AppTextFieldCustomState extends State { Container( height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 - : MediaQuery.of(context).size.height * 0.098, + : null, //MediaQuery.of(context).size.height * 0.098, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -117,7 +117,7 @@ class _AppTextFieldCustomState extends State { padding: widget.dropDownText == null ? widget.isSearchTextField ? EdgeInsets.only(top: 10) - : EdgeInsets.only(top: 7.5) + : EdgeInsets.only(top: 0.5) : EdgeInsets.only(top: 0), // 8.0 child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -144,8 +144,7 @@ class _AppTextFieldCustomState extends State { height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 - : MediaQuery.of(context).size.height * - 0.045, + : null, child: TextFormField( textAlign: projectViewModel.isArabic ? TextAlign.right @@ -156,8 +155,7 @@ class _AppTextFieldCustomState extends State { .textFieldSelectorDecoration( widget.hintText, null, true), style: TextStyle( - fontSize: - 14.0, //SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier * 1.7, fontFamily: 'Poppins', color: Color(0xFF575757), fontWeight: FontWeight.w400, diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 46fa78d1..823b79aa 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; @@ -19,7 +18,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.inputFormatters, this.searchController, this.onFieldSubmitted, - this.hintText, + this.hintText, this.height, }); final TextEditingController searchController; @@ -35,6 +34,9 @@ class AppTextFieldCustomSearch extends StatelessWidget { final TextInputType inputType; final List inputFormatters; + final double height; + + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -43,6 +45,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { child: Stack( children: [ AppTextFieldCustom( + height: height??0, hintText: hintText ?? TranslationBase.of(context).searchPatientName, isTextFieldHasSuffix: true, @@ -61,7 +64,9 @@ class AppTextFieldCustomSearch extends StatelessWidget { onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) - projectViewModel.isArabic?Positioned(left: 35, top: 5, child: positionedChild):Positioned(right: 35, top: 5, child: positionedChild) + projectViewModel.isArabic + ? Positioned(left: 35, top: 5, child: positionedChild) + : Positioned(right: 35, top: 5, child: positionedChild) ], ), ); diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index cf5f0abf..655c6a9e 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -17,7 +17,7 @@ class AppTextFormField extends FormField { TextInputType textInputType, String hintText, FocusNode focusNode, - TextInputAction textInputAction=TextInputAction.done, + TextInputAction textInputAction = TextInputAction.done, ValueChanged onFieldSubmitted, IconButton prefix, String labelText, @@ -27,7 +27,7 @@ class AppTextFormField extends FormField { : super( onSaved: onSaved, validator: validator, - autovalidate: autovalidate, + // autovalidate: autovalidate, builder: (FormFieldState state) { return Column( children: [ diff --git a/lib/widgets/shared/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/text_fields/auto_complete_text_field.dart index 3b563f3f..a5463854 100644 --- a/lib/widgets/shared/text_fields/auto_complete_text_field.dart +++ b/lib/widgets/shared/text_fields/auto_complete_text_field.dart @@ -13,8 +13,6 @@ class CustomAutoCompleteTextField extends StatelessWidget { this.child, }) : super(key: key); - - @override Widget build(BuildContext context) { return Container( diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 71359604..d249ead0 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -9,10 +9,20 @@ 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 '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { - HtmlRichEditor({ + final String hint; + final String initialText; + final double height; + final BoxDecoration decoration; + final bool darkMode; + final bool showBottomToolbar; + final List toolbar; + final HtmlEditorController controller; + + HtmlRichEditor({ key, this.hint = "Your text here...", this.initialText, @@ -21,15 +31,8 @@ class HtmlRichEditor extends StatefulWidget { this.darkMode = false, this.showBottomToolbar = false, this.toolbar, + this.controller, }) : super(key: key); - final String hint; - final String initialText; - final double height; - final BoxDecoration decoration; - final bool darkMode; - final bool showBottomToolbar; - final List toolbar; - @override _HtmlRichEditorState createState() => _HtmlRichEditorState(); @@ -40,7 +43,6 @@ class _HtmlRichEditorState extends State { stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - @override void initState() { @@ -55,8 +57,6 @@ class _HtmlRichEditorState extends State { super.initState(); } - - @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -64,40 +64,35 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - hint: widget.hint, - height: widget.height, - initialText: widget.initialText, - showBottomToolbar: widget.showBottomToolbar, - darkMode: widget.darkMode, - decoration: widget.decoration ?? - BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.all( - Radius.circular(30.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - toolbar: widget.toolbar ?? - const [ - // Style(), - Font(buttons: [ - FontButtons.bold, - FontButtons.italic, - FontButtons.underline, - ]), - // ColorBar(buttons: [ColorButtons.color]), - Paragraph(buttons: [ - ParagraphButtons.ul, - ParagraphButtons.ol, - ParagraphButtons.paragraph - ]), - // Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]), - // Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help]) - ], - ), + controller: widget.controller, + htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ + StyleButtons(), + FontSettingButtons(), + FontButtons(), + // ColorButtons(), + ListButtons(), + ParagraphButtons(), + // InsertButtons(), + // OtherButtons(), + ]), + htmlEditorOptions: HtmlEditorOptions( + hint: widget.hint, + initialText: widget.initialText, + darkMode: widget.darkMode, + ), + otherOptions: OtherOptions( + height: widget.height, + decoration: widget.decoration ?? + BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.all( + Radius.circular(30.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + )), Positioned( - top: - 50, //MediaQuery.of(context).size.height * 0, + top: 50, //MediaQuery.of(context).size.height * 0, right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, @@ -107,8 +102,7 @@ class _HtmlRichEditorState extends State { icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ], @@ -117,7 +111,6 @@ class _HtmlRichEditorState extends State { ); } - onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; @@ -141,7 +134,7 @@ class _HtmlRichEditorState extends State { } void statusListener(String status) { - recognizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -150,15 +143,15 @@ class _HtmlRichEditorState extends State { ].request(); } - void resultListener(result)async { + void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String txt = await HtmlEditor.getText(); + String txt = await widget.controller.getText(); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - HtmlEditor.setText(txt+recognizedWord); + widget.controller.setText(txt + recognizedWord); }); } else { print(result.finalResult); diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart deleted file mode 100644 index 9917b04f..00000000 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ /dev/null @@ -1,235 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class NumberTextInputFormatter extends TextInputFormatter { - @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { - final int newTextLength = newValue.text.length; - int selectionIndex = newValue.selection.end; - int usedSubstringIndex = 0; - final StringBuffer newText = StringBuffer(); - if (newTextLength >= 1) { - newText.write('('); - if (newValue.selection.end >= 1) selectionIndex++; - } - if (newTextLength >= 4) { - newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); - if (newValue.selection.end >= 3) selectionIndex += 2; - } - if (newTextLength >= 7) { - newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); - if (newValue.selection.end >= 6) selectionIndex++; - } - if (newTextLength >= 11) { - newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); - if (newValue.selection.end >= 10) selectionIndex++; - } - // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); - return TextEditingValue( - text: newText.toString(), - selection: TextSelection.collapsed(offset: selectionIndex), - ); - } -} - -final _mobileFormatter = NumberTextInputFormatter(); - -class NewTextFields extends StatefulWidget { - NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 15.0, - this.fontWeight = FontWeight.w500, - this.autoValidate = false, - this.hintColor, - this.isEnabled = true}) - : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; - @override - _NewTextFieldsState createState() => _NewTextFieldsState(); -} - -class _NewTextFieldsState extends State { - final FocusNode _focusNode = FocusNode(); - bool focus = false; - bool view = false; - - @override - void initState() { - super.initState(); - _focusNode.addListener(() { - setState(() { - focus = _focusNode.hasFocus; - }); - }); - } - - @override - void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - _focusNode.dispose(); - super.dispose(); - } - - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { - _focusNode.unfocus(); - return true; - } else { - return false; - } - } - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), - color: Colors.white), - child: Container( - margin: EdgeInsets.only(top: 8), - padding: EdgeInsets.only(top: 8), - - - child: TextFormField( - enabled: widget.isEnabled, - initialValue: widget.initialValue, - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) - : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type == "password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), - inputFormatters: widget.keyboardType == TextInputType.phone - ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] - : widget.inputFormatters, - decoration: InputDecoration( - labelText: widget.hintText, - labelStyle: - TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(8.0)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 21875e4d..006e0fa4 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -12,6 +12,7 @@ class CustomRow extends StatelessWidget { this.valueSize, this.width, this.isCopyable = true, + this.isExpanded = true, }) : super(key: key); final String label; @@ -20,6 +21,7 @@ class CustomRow extends StatelessWidget { final double valueSize; final double width; final bool isCopyable; + final bool isExpanded; @override Widget build(BuildContext context) { @@ -38,6 +40,7 @@ class CustomRow extends StatelessWidget { width: 1, ), Expanded( + flex: isExpanded ? 1 : 0, child: AppText( value, fontSize: diff --git a/lib/widgets/shared/user-guid/custom_validation_error.dart b/lib/widgets/shared/user-guid/custom_validation_error.dart index fd1f2125..43464f04 100644 --- a/lib/widgets/shared/user-guid/custom_validation_error.dart +++ b/lib/widgets/shared/user-guid/custom_validation_error.dart @@ -1,21 +1,19 @@ - import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; // ignore: must_be_immutable class CustomValidationError extends StatelessWidget { - String error; + String error; + CustomValidationError({ - Key key, this.error, + Key key, + this.error, }) : super(key: key); @override Widget build(BuildContext context) { - if(error == null ) - error = TranslationBase - .of(context) - .emptyMessage; + if (error == null) error = TranslationBase.of(context).emptyMessage; return Column( children: [ SizedBox( @@ -23,11 +21,13 @@ class CustomValidationError extends StatelessWidget { ), Container( margin: EdgeInsets.symmetric(horizontal: 3), - child: AppText(error, color: Theme - .of(context) - .errorColor, fontSize: 14,), + child: AppText( + error, + color: Theme.of(context).errorColor, + fontSize: 14, + ), ), ], ); } -} \ No newline at end of file +} diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 7cd3826c..0265d815 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -4,30 +4,27 @@ import 'package:flutter/material.dart'; /// [page] class FadePage extends PageRouteBuilder { final Widget page; + FadePage({this.page}) - : super( - opaque: false, - settings: RouteSettings(name: page.runtimeType.toString()), - fullscreenDialog: true, - barrierDismissible: true, - barrierColor: Colors.black.withOpacity(0.8), - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionDuration: Duration(milliseconds: 300), - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) { - return FadeTransition( - opacity: animation, - child: child - ); - } - ); -} \ No newline at end of file + : super( + opaque: false, + settings: RouteSettings(name: page.runtimeType.toString()), + fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition(opacity: animation, child: child); + }); +} diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index ee0b7473..b83e2386 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -11,7 +11,11 @@ class SlideUpPageRoute extends PageRouteBuilder { final bool opaque; final String settingRoute; - SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) + SlideUpPageRoute( + {this.widget, + this.fullscreenDialog = false, + this.opaque = true, + this.settingRoute}) : super( pageBuilder: ( BuildContext context, @@ -24,17 +28,22 @@ class SlideUpPageRoute extends PageRouteBuilder { opaque: opaque, barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierDismissible: true, - settings: RouteSettings(name: settingRoute ?? widget.runtimeType.toString()), + settings: RouteSettings( + name: settingRoute ?? widget.runtimeType.toString()), transitionDuration: Duration(milliseconds: 800), - transitionsBuilder: - ((BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { + transitionsBuilder: ((BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child) { var begin = Offset(0.0, 1.0); var end = Offset.zero; var curve = Curves.easeInOutQuint; - var tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + var tween = + Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); - return SlideTransition(position: animation.drive(tween), child: child); + return SlideTransition( + position: animation.drive(tween), child: child); }), ); } diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 00000000..59acfac9 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1431 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "22.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.2" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + autocomplete_textfield: + dependency: "direct main" + description: + name: autocomplete_textfield + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.3" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + barcode_scan2: + dependency: "direct main" + description: + name: barcode_scan2 + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.0" + bazel_worker: + dependency: transitive + description: + name: bazel_worker + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.3" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.6" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.10" + build_modules: + dependency: transitive + description: + name: build_modules + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.5" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.10" + build_web_compilers: + dependency: "direct dev" + description: + name: build_web_compilers + url: "https://pub.dartlang.org" + source: hosted + version: "2.16.5" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.4" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + chewie: + dependency: transitive + description: + name: chewie + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + chewie_audio: + dependency: transitive + description: + name: chewie_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + connectivity: + dependency: "direct main" + description: + name: connectivity + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" + connectivity_for_web: + dependency: transitive + description: + name: connectivity_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0+1" + connectivity_macos: + dependency: transitive + description: + name: connectivity_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+2" + connectivity_platform_interface: + dependency: transitive + description: + name: connectivity_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.1" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.14" + date_time_picker: + dependency: "direct main" + description: + name: date_time_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + device_info: + dependency: "direct main" + description: + name: device_info + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + dropdown_search: + dependency: "direct main" + description: + name: dropdown_search + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + equatable: + dependency: transitive + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + file_picker: + dependency: "direct main" + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.2" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "8.3.4" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0+1" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.12.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.4" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "10.0.9" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.6" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.7" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + url: "https://pub.dartlang.org" + source: hosted + version: "0.36.4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "3.3.0" + flutter_colorpicker: + dependency: "direct main" + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_datetime_picker: + dependency: "direct main" + description: + name: flutter_datetime_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + flutter_device_type: + dependency: "direct main" + description: + name: flutter_device_type + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + flutter_gifimage: + dependency: "direct main" + description: + name: flutter_gifimage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + flutter_inappwebview: + dependency: transitive + description: + name: flutter_inappwebview + url: "https://pub.dartlang.org" + source: hosted + version: "5.3.2" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.23.0+1" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + fluttertoast: + dependency: "direct main" + description: + name: fluttertoast + url: "https://pub.dartlang.org" + source: hosted + version: "8.0.8" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "9.2.0" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + hexcolor: + dependency: "direct main" + description: + name: hexcolor + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.0" + html_editor_enhanced: + dependency: "direct main" + description: + name: html_editor_enhanced + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0+1-dev.1" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.4" + http_interceptor: + dependency: "direct main" + description: + name: http_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + local_auth: + dependency: "direct main" + description: + name: local_auth + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.10" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + maps_launcher: + dependency: "direct main" + description: + name: maps_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + numberpicker: + dependency: transitive + description: + name: numberpicker + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + numerus: + dependency: transitive + description: + name: numerus + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.1+1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + percent_indicator: + dependency: "direct main" + description: + name: percent_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "3.4.0" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "8.3.0" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8" + quiver: + dependency: "direct main" + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1+1" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.27.3" + scratch_space: + dependency: transitive + description: + name: scratch_space + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.10" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.4+1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.10" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + speech_to_text: + dependency: "direct main" + description: + path: speech_to_text + relative: true + source: path + version: "0.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + sticky_headers: + dependency: "direct main" + description: + name: sticky_headers + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.8" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.20" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.18" + video_player_android: + dependency: transitive + description: + name: video_player_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.17" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.18" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.2" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.6" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.0" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.7.1" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.11" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "5.3.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.15.0 <3.0.0" + flutter: ">=2.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1e5125de..dfc76868 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,101 +11,111 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.2+2 +version: 4.3.5+1 + environment: - sdk: ">=2.8.0 <3.0.0" + sdk: ">=2.7.0 <3.0.0" #dependency_overrides: # intl: 0.17.0-nullsafety.2 +#dependency_overrides: +# intl: 0.17.0-nullsafety.2 dependencies: flutter: sdk: flutter - hexcolor: ^1.0.1 + hexcolor: ^2.0.4 flutter_localizations: sdk: flutter - flutter_device_type: ^0.2.0 - intl: ^0.16.0 - http: ^0.12.0+4 - provider: ^4.0.5+1 - shared_preferences: ^0.5.6+3 - imei_plugin: ^1.1.6 - flutter_flexible_toast: ^0.1.4 - local_auth: ^0.6.1+3 - http_interceptor: ^0.2.0 - progress_hud_v2: ^2.0.0 - connectivity: ^0.4.8+2 - maps_launcher: ^1.2.0 - url_launcher: ^5.4.5 - charts_flutter: ^0.9.0 + flutter_device_type: ^0.4.0 + intl: ^0.17.0 + http: ^0.13.0 + provider: ^6.0.1 + shared_preferences: ^2.0.6 + # imei_plugin: ^1.2.0 + # flutter_flexible_toast: ^0.1.4 + fluttertoast: ^8.0.8 + local_auth: ^1.1.6 + http_interceptor: ^0.4.1 + + connectivity: ^3.0.6 + maps_launcher: ^2.0.0 + url_launcher: ^6.0.6 + charts_flutter: ^0.12.0 flutter_swiper: ^1.1.6 #Icons - eva_icons_flutter: ^2.0.0 - font_awesome_flutter: ^8.11.0 - dropdown_search: ^0.4.8 - flutter_staggered_grid_view: ^0.3.2 + eva_icons_flutter: ^3.0.0 + font_awesome_flutter: ^9.0.0 + dropdown_search: ^2.0.1 + flutter_staggered_grid_view: ^0.4.0 - expandable: ^4.1.4 + expandable: ^5.0.1 # Qr code Scanner - barcode_scan_fix: ^1.0.2 + barcode_scan2: ^4.1.4 # permissions - permission_handler: ^5.0.0+hotfix.3 - device_info: ^0.4.2+4 + permission_handler: ^8.0.1 + device_info: ^2.0.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.3 # SVG - flutter_svg: ^0.18.1 - percent_indicator: ^2.1.1 + #flutter_svg: ^1.0.0 + percent_indicator: ^3.0.1 #Dependency Injection - get_it: ^4.0.2 + get_it: ^7.1.3 #chart - fl_chart: ^0.12.1 + fl_chart: ^0.36.1 # Firebase - firebase_messaging: ^7.0.3 - firebase_analytics: 6.3.0 + firebase_messaging: ^10.0.1 + firebase_analytics : ^8.3.4 #GIF image flutter_gifimage: ^1.0.1 #Autocomplete TextField autocomplete_textfield: ^1.7.3 - date_time_picker: ^1.1.1 + date_time_picker: ^2.0.0 # Html - html: ^0.14.0+4 + html: ^0.15.0 # Flutter Html View - flutter_html: 1.0.2 - sticky_headers: "^0.1.8" + flutter_html: ^2.1.0 + sticky_headers: ^0.2.0 + file_picker: ^3.0.2+2 #speech to text speech_to_text: path: speech_to_text - quiver: ^2.1.5 + quiver: ^3.0.0 + flutter_colorpicker: ^0.5.0 # Html Editor Enhanced - html_editor_enhanced: ^1.3.0 + html_editor_enhanced: ^2.1.1 #Network Image - cached_network_image: ^2.5.0 + cached_network_image: ^3.1.0+1 # Badges - badges: ^1.1.4 + badges: ^2.0.1 - # Hijri -# hijri: ^2.0.3 - hijri_picker: ^2.0.0 + # Hijri + # hijri: ^2.0.3 + hijri_picker: ^3.0.0 + flutter_datetime_picker: ^1.5.1 + + # flutter_math_fork: ^0.6.0 +# flutter_math_fork: ^0.6.0 @@ -152,20 +162,20 @@ flutter: - family: Poppins fonts: - - asset: assets/fonts/Poppins/Poppins-Regular.ttf - weight: 400 - - asset: assets/fonts/Poppins/Poppins-Medium.ttf - weight: 500 - - asset: assets/fonts/Poppins/Poppins-SemiBold.ttf - weight: 600 - - asset: assets/fonts/Poppins/Poppins-Bold.ttf - weight: 700 - - asset: assets/fonts/Poppins/Poppins-Bold.ttf - weight: 800 - - asset: assets/fonts/Poppins/Poppins-Bold.ttf - weight: 900 - - + - asset: assets/fonts/Poppins/Poppins-Regular.ttf + weight: 400 + - asset: assets/fonts/Poppins/Poppins-Medium.ttf + weight: 500 + - asset: assets/fonts/Poppins/Poppins-SemiBold.ttf + weight: 600 + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 700 + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 800 + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 900 + + # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf