Compare commits

..

No commits in common. 'development-3.3_voipCall' and 'development' have entirely different histories.

@ -26,11 +26,11 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33
compileSdkVersion 30
signingConfigs {
release {
storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor_app_key')
storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key')
storePassword 'Hmgdoctor1234'
keyAlias 'hmgdoctor'
keyPassword 'Hmgdoctor1234'
@ -49,7 +49,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.hmg.hmgDr"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

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

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

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

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

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

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

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

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

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

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

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

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

@ -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-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

@ -1,8 +0,0 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 8929">
<circle id="Ellipse 149" cx="12" cy="12" r="12" transform="matrix(-1 0 0 1 24 0)" fill="white"/>
<g id="back (1)">
<path id="Chevron_Right" d="M16.8096 11.9647L10.965 17.8073C10.9041 17.8683 10.8319 17.9167 10.7523 17.9498C10.6727 17.9829 10.5874 17.9999 10.5012 18C10.415 18.0001 10.3297 17.9832 10.2501 17.9503C10.1704 17.9174 10.098 17.8692 10.037 17.8083C9.97603 17.7474 9.92762 17.6751 9.89456 17.5955C9.8615 17.516 9.84444 17.4307 9.84435 17.3445C9.84426 17.2583 9.86114 17.173 9.89404 17.0933C9.92693 17.0137 9.97519 16.9413 10.0361 16.8803L15.4175 11.5008L10.0367 6.12134C9.91351 5.99816 9.84431 5.83108 9.84431 5.65687C9.84431 5.48265 9.91351 5.31558 10.0367 5.19239C10.1599 5.06921 10.327 5 10.5012 5C10.6754 5 10.8425 5.06921 10.9657 5.19239L16.8102 11.0357C16.932 11.1597 17.0001 11.3265 17 11.5003C16.9999 11.6741 16.9315 11.8408 16.8096 11.9647Z" fill="#2B353E"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1011 B

@ -1,4 +0,0 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="12" fill="white"/>
<path d="M7.1904 11.9647L13.035 17.8073C13.0959 17.8683 13.1681 17.9167 13.2477 17.9498C13.3273 17.9829 13.4126 17.9999 13.4988 18C13.585 18.0001 13.6703 17.9832 13.7499 17.9503C13.8296 17.9174 13.902 17.8692 13.963 17.8083C14.024 17.7474 14.0724 17.6751 14.1054 17.5955C14.1385 17.516 14.1556 17.4307 14.1557 17.3445C14.1557 17.2583 14.1389 17.173 14.106 17.0933C14.0731 17.0137 14.0248 16.9413 13.9639 16.8803L8.58255 11.5008L13.9633 6.12134C14.0865 5.99816 14.1557 5.83108 14.1557 5.65687C14.1557 5.48265 14.0865 5.31558 13.9633 5.19239C13.8401 5.06921 13.673 5 13.4988 5C13.3246 5 13.1575 5.06921 13.0343 5.19239L7.18976 11.0357C7.06803 11.1597 6.99988 11.3265 7 11.5003C7.00012 11.6741 7.0685 11.8408 7.1904 11.9647Z" fill="#2B353E"/>
</svg>

Before

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

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

@ -14,8 +14,8 @@
30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; };
30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4E9718EA62661304F55A32D /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@ -37,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 = "<group>"; };
104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; };
29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = "<group>"; };
300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = "<group>"; };
@ -58,10 +61,7 @@
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = "<group>"; };
9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = "<group>"; };
C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
E4E9718EA62661304F55A32D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -69,7 +69,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */,
3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -104,9 +104,9 @@
7D66D387293CE5376A07EC5F /* Pods */ = {
isa = PBXGroup;
children = (
C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */,
C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */,
E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */,
2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */,
E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */,
0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -129,7 +129,7 @@
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
7D66D387293CE5376A07EC5F /* Pods */,
A9562A4C43D78E443FA8BFD1 /* Frameworks */,
C1938275850F66EAA5D7AC0F /* Frameworks */,
);
sourceTree = "<group>";
};
@ -171,10 +171,10 @@
name = "Supporting Files";
sourceTree = "<group>";
};
A9562A4C43D78E443FA8BFD1 /* Frameworks */ = {
C1938275850F66EAA5D7AC0F /* Frameworks */ = {
isa = PBXGroup;
children = (
E4E9718EA62661304F55A32D /* Pods_Runner.framework */,
104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -186,14 +186,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
4CBD0CB2C106C3E696B88FDB /* [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 */,
C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */,
3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -215,7 +215,6 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 3A359E86ZF;
LastSwiftMigration = 1100;
};
};
@ -268,43 +267,7 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */ = {
3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -317,7 +280,7 @@
"${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework",
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework",
"${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.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",
@ -338,7 +301,8 @@
"${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}/local_auth_ios/local_auth_ios.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",
@ -358,7 +322,7 @@
"${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}/FirebaseCoreInternal.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",
@ -379,7 +343,8 @@
"${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}/local_auth_ios.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",
@ -396,6 +361,42 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -488,12 +489,12 @@
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 3A359E86ZF;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -501,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",
@ -517,7 +521,6 @@
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@ -624,12 +627,12 @@
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 3A359E86ZF;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -637,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",
@ -654,13 +660,13 @@
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 3A359E86ZF;
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -668,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",
@ -693,7 +702,7 @@
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
@ -703,7 +712,7 @@
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};

@ -65,7 +65,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>

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

@ -5,10 +5,10 @@ import 'dart:io' show Platform;
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart';
@ -47,12 +47,14 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID;
}
if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID;
if (body['EditedBy'] == null)
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
}
if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID;
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
} else {
String doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') {
@ -60,12 +62,6 @@ class BaseAppClient {
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
}
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID);
if (body['EditedBy'] == '') {
body.remove("EditedBy");
}
@ -92,56 +88,54 @@ class BaseAppClient {
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA;
if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
}
if (body['VidaRefreshTokenID'] == null) {
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
body['VidaRefreshTokenID'] =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
int projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true;
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3)
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 ||
body['facilityId'] == 3) ||
body['ProjectID'] == 2 ||
body['ProjectID'] == 3)
body['PatientOutSA'] = true;
else
body['PatientOutSA'] = false;
// if (!body.containsKey('ProjectID')) {
// if (projectID != null) {
// body['ProjectID'] = projectID;
// } else {
// body['ProjectID'] = 0;
// }
// }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
// body['DoctorID'] = 1002; //3844083
// body['TokenID'] = "@dm!n";
// print("ProjectID :");
// print(body['ProjectID']);
debugPrint("URL : $url");
debugPrint("Body : ${json.encode(body)}");
print("URL : $url");
print("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.post(Uri.parse(url),
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode);
} else {
var parsed = json.decode(response.body.toString());
print("Response : $parsed");
if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']);
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
}
if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) {
if (body['OTP_SendType'] != null) {
onFailure(getError(parsed), statusCode);
} else if (!isAllowAny) {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).logout();
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX,
listen: false)
.logout();
Utils.showErrorToast('Your session expired Please login again');
locator<NavigationService>().pushNamedAndRemoveUntil(ROOT);
@ -167,7 +161,6 @@ class BaseAppClient {
}
}
postPatient(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
@ -177,7 +170,10 @@ class BaseAppClient {
String url = BASE_URL + endPoint;
try {
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -188,15 +184,13 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID;
}
}
if (body['DoctorID'] == 0) {
body['DoctorID'] = null;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID);
: SETUP_ID
: SETUP_ID;
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
@ -211,11 +205,12 @@ class BaseAppClient {
: PATIENT_OUT_SA_PATIENT_REQ;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -236,8 +231,10 @@ class BaseAppClient {
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID']??token : token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: patient.patientId ?? patient.patientMRN;
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe
@ -248,23 +245,13 @@ class BaseAppClient {
else
body['PatientOutSA'] = false;
// if(!body.containsKey('ProjectID')) {
// if (projectID != null) {
// body['ProjectID'] = 313;
// } else {
// body['ProjectID'] = 0;
// }
// }
// body['DoctorID'] = 24; //3844083
// body['TokenID'] = "@dm!n";
print("URL : $url");
print("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final response = await http.post(Uri.parse(url.trim()),
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -276,7 +263,8 @@ class BaseAppClient {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']);
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
}
if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) {
@ -292,20 +280,28 @@ class BaseAppClient {
onFailure(getError(parsed), statusCode);
}
}
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", statusCode);
onFailure("Server Error found with no available message",
statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
}
}
} else {
@ -315,7 +311,9 @@ class BaseAppClient {
if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
}
}
@ -336,9 +334,14 @@ class BaseAppClient {
if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) {
error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null &&
parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0;
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +
parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +
"\n";
}
}
}
@ -347,19 +350,4 @@ class BaseAppClient {
}
return error;
}
get({String endPoint,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async{
String token = await sharedPref.getString(TOKEN);
String url = DOCTOR_ROTATION + endPoint+'&token='+token;
final response = await http.get(Uri.parse(url));
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode);
} else {
var parsed = json.decode(response.body.toString());
onSuccess(parsed,statusCode);
}
}
}

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

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

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

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

@ -2,24 +2,18 @@ class PostAssessmentRequestModel {
int patientMRN;
int appointmentNo;
int episodeId;
String createdByName;
int createdBy;
List<IcdCodeDetails> icdCodeDetails;
PostAssessmentRequestModel(
{this.patientMRN,
this.appointmentNo,
this.episodeId,
this.createdByName,
this.createdBy,
this.icdCodeDetails});
PostAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeID'];
createdByName = json['CreatedByName'];
createdBy= json['CreatedBy'];
if (json['icdCodeDetails'] != null) {
icdCodeDetails = new List<IcdCodeDetails>();
json['icdCodeDetails'].forEach((v) {
@ -33,8 +27,6 @@ class PostAssessmentRequestModel {
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeId;
data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy;
if (this.icdCodeDetails != null) {
data['icdCodeDetails'] =
this.icdCodeDetails.map((v) => v.toJson()).toList();

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

@ -23,7 +23,6 @@ class AdmissionRequest {
bool isDietType;
int dietType;
String dietRemarks;
String diagnosis;
bool isPhysicalActivityModification;
String physicalActivityModificationComments;
int orStatus;
@ -67,7 +66,6 @@ class AdmissionRequest {
this.isDietType,
this.dietType,
this.dietRemarks,
this.diagnosis,
this.isPhysicalActivityModification = false,
this.physicalActivityModificationComments = "",
this.orStatus = 1,
@ -111,9 +109,9 @@ class AdmissionRequest {
isDietType = json['isDietType'];
dietType = json['dietType'];
dietRemarks = json['dietRemarks'];
diagnosis = json['diagnosis'];
isPhysicalActivityModification = json['isPhysicalActivityModification'];
physicalActivityModificationComments = json['physicalActivityModificationComments'];
physicalActivityModificationComments =
json['physicalActivityModificationComments'];
orStatus = json['orStatus'];
mainLineOfTreatment = json['mainLineOfTreatment'];
estimatedCost = json['estimatedCost'];
@ -166,14 +164,16 @@ class AdmissionRequest {
data['transportComments'] = this.transportComments;
data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded;
data['physioAppointmentComments'] = this.physioAppointmentComments;
data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded;
data['isOPDFollowupAppointmentNeeded'] =
this.isOPDFollowupAppointmentNeeded;
data['opdFollowUpComments'] = this.opdFollowUpComments;
data['isDietType'] = this.isDietType;
data['dietType'] = this.dietType;
data['dietRemarks'] = this.dietRemarks;
data['diagnosis'] = this.diagnosis;
data['isPhysicalActivityModification'] = this.isPhysicalActivityModification;
data['physicalActivityModificationComments'] = this.physicalActivityModificationComments;
data['isPhysicalActivityModification'] =
this.isPhysicalActivityModification;
data['physicalActivityModificationComments'] =
this.physicalActivityModificationComments;
data['orStatus'] = this.orStatus;
data['mainLineOfTreatment'] = this.mainLineOfTreatment;
data['estimatedCost'] = this.estimatedCost;
@ -189,7 +189,8 @@ class AdmissionRequest {
// this.admissionRequestDiagnoses.map((v) => v.toJson()).toList();
}
if (this.admissionRequestProcedures != null) {
data['admissionRequestProcedures'] = this.admissionRequestProcedures.map((v) => v.toJson()).toList();
data['admissionRequestProcedures'] =
this.admissionRequestProcedures.map((v) => v.toJson()).toList();
}
data['appointmentNo'] = this.appointmentNo;
data['episodeID'] = this.episodeID;

@ -60,7 +60,7 @@ class CheckActivationCodeForDoctorAppResponseModel {
}
class ListDoctorsClinic {
String setupID;
Null setupID;
int projectID;
int doctorID;
int clinicID;

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

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

@ -6,7 +6,7 @@
*@desc: Clinic Model
*/
class ClinicModel {
String setupID;
Null setupID;
int projectID;
int doctorID;
int clinicID;

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

@ -8,7 +8,6 @@ class GetHospitalsRequestModel {
String sessionID;
bool isLoginForDoctorApp;
String memberID;
String doctorID;
GetHospitalsRequestModel(
{this.languageID,
@ -19,9 +18,7 @@ class GetHospitalsRequestModel {
this.tokenID,
this.sessionID,
this.isLoginForDoctorApp,
this.memberID,
this.doctorID,
});
this.memberID});
GetHospitalsRequestModel.fromJson(Map<String, dynamic> json) {
languageID = json['LanguageID'];
@ -33,7 +30,6 @@ class GetHospitalsRequestModel {
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
memberID = json['MemberID'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
@ -47,7 +43,6 @@ class GetHospitalsRequestModel {
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['MemberID'] = this.memberID;
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -36,7 +36,7 @@ class PatientLabOrders {
String setupID;
List<String> speciality;
bool isLiveCareAppointment;
String invoiceType;
PatientLabOrders(
{this.actualDoctorRate,
this.clinicDescription,
@ -71,9 +71,7 @@ class PatientLabOrders {
this.qR,
this.setupID,
this.speciality,
this.isLiveCareAppointment,
this.invoiceType
});
this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate'];
@ -110,7 +108,6 @@ class PatientLabOrders {
qR = json['QR'];
setupID = json['SetupID'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
invoiceType = json["InvoiceType"];
// speciality = json['Speciality'].cast<String>();
}
@ -150,7 +147,6 @@ class PatientLabOrders {
data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['InvoiceType'] = this.invoiceType;
return data;
}
}

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

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

@ -22,7 +22,7 @@ class VitalSignData {
int patientType;
int pulseBeatPerMinute;
int pulseRhythm;
num respirationBeatPerMinute;
int respirationBeatPerMinute;
int respirationPattern;
int sao2;
int status;

@ -7,7 +7,7 @@ class InterventionMedicationHistoryResModel {
int orderNo;
int id;
int interventionId;
dynamic intervention;
Null intervention;
String remark;
int commentedBy;
bool isDoctor;
@ -16,10 +16,10 @@ class InterventionMedicationHistoryResModel {
String createdByName;
String createdByNameN;
String createdOn;
dynamic editedBy;
dynamic editedByName;
dynamic editedByNameN;
dynamic editedOn;
Null editedBy;
Null editedByName;
Null editedByNameN;
Null editedOn;
InterventionMedicationHistoryResModel(
{this.setupId,

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

@ -6,7 +6,6 @@ class FinalRadiology {
dynamic patientID;
dynamic invoiceLineItemNo;
dynamic invoiceNo;
dynamic invoiceNo_VP;
dynamic doctorID;
dynamic clinicID;
DateTime orderDate;
@ -44,15 +43,13 @@ class FinalRadiology {
bool isCVI;
bool isRadMedicalReport;
bool isLiveCareAppodynamicment;
bool isRecordFromVidaPlus;
String invoiceType;
FinalRadiology(
{this.setupID,
this.projectID,
this.patientID,
this.invoiceLineItemNo,
this.invoiceNo,
this.invoiceNo_VP,
this.doctorID,
this.clinicID,
this.orderDate,
@ -89,7 +86,7 @@ class FinalRadiology {
this.speciality,
this.isCVI,
this.isRadMedicalReport,
this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType});
this.isLiveCareAppodynamicment});
FinalRadiology.fromJson(Map<dynamic, dynamic> json) {
try {
@ -98,7 +95,6 @@ class FinalRadiology {
patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
orderDate = AppDateUtils.convertStringToDate(json['OrderDate']);
@ -136,8 +132,6 @@ class FinalRadiology {
// speciality = json['Speciality'].cast<dynamic>();
isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport'];
isRecordFromVidaPlus = json['IsRecordFromVidaPlus'];
invoiceType = json["InvoiceType"];
} catch (e) {
print(e);
}
@ -150,7 +144,6 @@ class FinalRadiology {
data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate;
@ -186,8 +179,6 @@ class FinalRadiology {
data['Speciality'] = this.speciality;
data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport;
data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus;
data["InvoiceType"] =invoiceType;
return data;
}
}

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

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

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

@ -34,14 +34,12 @@ class VideoCallService extends BaseService {
await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
// TODO MOSA TEST
kApiKey: '46209962',
kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID,
//
// kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4",
kApiKey: '46209962',
// kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg",
// kApiKey:'47247954',
vcId: patient.vcId,
isRecording: isRecording,
patientName: patient.fullName ??

@ -7,10 +7,10 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
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/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class AuthenticationService extends BaseService {
List<GetIMEIDetailsModel> _imeiDetails = [];
@ -19,16 +19,26 @@ class AuthenticationService extends BaseService {
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;
SendActivationCodeForDoctorAppResponseModel
_activationCodeVerificationScreenRes =
SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel
get activationCodeVerificationScreenRes =>
_activationCodeVerificationScreenRes;
SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes =
SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel
get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes;
CheckActivationCodeForDoctorAppResponseModel
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel
get checkActivationCodeForDoctorAppRes =>
_checkActivationCodeForDoctorAppRes;
Map<String, dynamic> _insertDeviceImeiRes = {};
List<DoctorProfileModel> _doctorProfilesList = [];
@ -37,7 +47,8 @@ class AuthenticationService extends BaseService {
Future selectDeviceImei(imei) async {
try {
await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(SELECT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
_imeiDetails = [];
response['List_DoctorDeviceDetails'].forEach((v) {
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
@ -45,7 +56,7 @@ class AuthenticationService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {"IMEI": imei});
}, body: {"IMEI": imei, "TokenID": "@dm!n"});
} catch (error) {
hasError = true;
super.error = error;
@ -56,7 +67,8 @@ class AuthenticationService extends BaseService {
hasError = false;
_loginInfo = NewLoginInformationModel();
try {
await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(LOGIN_URL,
onSuccess: (dynamic response, int statusCode) {
_loginInfo = NewLoginInformationModel.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -68,12 +80,16 @@ class AuthenticationService extends BaseService {
}
}
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);
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;
@ -84,12 +100,16 @@ class AuthenticationService extends BaseService {
}
}
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);
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;
@ -100,12 +120,16 @@ class AuthenticationService extends BaseService {
}
}
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);
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;
@ -120,7 +144,8 @@ class AuthenticationService extends BaseService {
hasError = false;
_insertDeviceImeiRes = {};
try {
await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(INSERT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
_insertDeviceImeiRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -135,7 +160,8 @@ class AuthenticationService extends BaseService {
Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async {
hasError = false;
try {
await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) {
_doctorProfilesList.clear();
response['DoctorProfileList'].forEach((v) {
_doctorProfilesList.add(DoctorProfileModel.fromJson(v));

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

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

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

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

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

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

@ -33,7 +33,10 @@ class ERSignInService extends LookupService {
Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false;
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {

@ -112,7 +112,7 @@ class LabsService extends BaseService {
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID ?? 0;
body['InvoiceType'] = patientLabOrder.invoiceType ??"";
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult = [];

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

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

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

@ -23,7 +23,7 @@ class PendingOrderService extends BaseService {
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
setupID: "010266");
hasError = false;
await baseAppClient.post(GET_PENDING_ORDERS,
@ -50,7 +50,7 @@ class PendingOrderService extends BaseService {
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
setupID: "010266");
hasError = false;
await baseAppClient.post(GET_ADMISSION_ORDERS,

@ -27,7 +27,7 @@ class ERSignInViewModel extends BaseViewModel {
Future signInERPatient({int patientId, int signInType}) async {
hasError = false;
await getDoctorProfile();
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId);
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(setupID:"010266", signInType:signInType, loginDoctorID:doctorProfile.doctorID, patientID: patientId );
setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) {
@ -36,4 +36,6 @@ class ERSignInViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
}

@ -45,39 +45,52 @@ class SOAPViewModel extends BaseViewModel {
List<MasterKeyModel> get allergiesList => _SOAPService.allergiesList;
List<MasterKeyModel> get allergySeverityList => _SOAPService.allergySeverityList;
List<MasterKeyModel> get allergySeverityList =>
_SOAPService.allergySeverityList;
List<MasterKeyModel> get historyFamilyList => _SOAPService.historyFamilyList;
List<MasterKeyModel> get historyMedicalList => _SOAPService.historyMedicalList;
List<MasterKeyModel> get historyMedicalList =>
_SOAPService.historyMedicalList;
List<MasterKeyModel> get historySportList => _SOAPService.historySportList;
List<MasterKeyModel> get historySocialList => _SOAPService.historySocialList;
List<MasterKeyModel> get historySurgicalList => _SOAPService.historySurgicalList;
List<MasterKeyModel> get historySurgicalList =>
_SOAPService.historySurgicalList;
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList];
List<MasterKeyModel> get mergeHistorySurgicalWithHistorySportList =>
[...historySurgicalList, ...historySportList];
List<MasterKeyModel> get physicalExaminationList => _SOAPService.physicalExaminationList;
List<MasterKeyModel> get physicalExaminationList =>
_SOAPService.physicalExaminationList;
List<MasterKeyModel> get listOfDiagnosisType => _SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisType =>
_SOAPService.listOfDiagnosisType;
List<MasterKeyModel> get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfDiagnosisCondition =>
_SOAPService.listOfDiagnosisCondition;
List<MasterKeyModel> get listOfICD10 => _SOAPService.listOfICD10;
List<GetChiefComplaintResModel> get patientChiefComplaintList => _SOAPService.patientChiefComplaintList;
List<GetChiefComplaintResModel> get patientChiefComplaintList =>
_SOAPService.patientChiefComplaintList;
List<GetAllergiesResModel> get patientAllergiesList => _SOAPService.patientAllergiesList;
List<GetAllergiesResModel> get patientAllergiesList =>
_SOAPService.patientAllergiesList;
List<GetHistoryResModel> get patientHistoryList => _SOAPService.patientHistoryList;
List<GetHistoryResModel> get patientHistoryList =>
_SOAPService.patientHistoryList;
List<GetPhysicalExamResModel> get patientPhysicalExamList => _SOAPService.patientPhysicalExamList;
List<GetPhysicalExamResModel> get patientPhysicalExamList =>
_SOAPService.patientPhysicalExamList;
List<GetPatientProgressNoteResModel> get patientProgressNoteList => _SOAPService.patientProgressNoteList;
List<GetPatientProgressNoteResModel> get patientProgressNoteList =>
_SOAPService.patientProgressNoteList;
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
List<GetAssessmentResModel> get patientAssessmentList =>
_SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID;
@ -96,7 +109,8 @@ class SOAPViewModel extends BaseViewModel {
get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel;
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList;
SubjectiveCallBack subjectiveCallBack;
@ -137,13 +151,13 @@ class SOAPViewModel extends BaseViewModel {
nextOnPlanPage(model) {
planCallBack.nextFunction(model);
}
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async {
Future getMasterLookup(MasterKeysService masterKeys,
{bool isBusyLocal = false}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
await _SOAPService.getMasterLookup(masterKeys);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
@ -161,9 +175,12 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel postEpisodeForInpatientRequestModel) async {
Future postEpisodeForInPatient(
PostEpisodeForInpatientRequestModel
postEpisodeForInpatientRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postEpisodeForInPatient(postEpisodeForInpatientRequestModel);
await _SOAPService.postEpisodeForInPatient(
postEpisodeForInpatientRequestModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
@ -171,7 +188,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
Future postPhysicalExam(
PostPhysicalExamRequestModel postPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel);
if (_SOAPService.hasError) {
@ -181,7 +199,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async {
Future postProgressNote(
PostProgressNoteRequestModel postProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postProgressNote(postProgressNoteRequestModel);
if (_SOAPService.hasError) {
@ -191,7 +210,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async {
Future postAssessment(
PostAssessmentRequestModel postAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAssessment(postAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -201,7 +221,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
Future patchPhysicalExam(
PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel);
if (_SOAPService.hasError) {
@ -211,7 +232,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
Future patchProgressNote(
PostProgressNoteRequestModel patchProgressNoteRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchProgressNote(patchProgressNoteRequestModel);
if (_SOAPService.hasError) {
@ -221,7 +243,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async {
Future patchAssessment(
PatchAssessmentReqModel patchAssessmentRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.patchAssessment(patchAssessmentRequestModel);
if (_SOAPService.hasError) {
@ -231,7 +254,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP,
{isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else
@ -250,8 +274,14 @@ class SOAPViewModel extends BaseViewModel {
String getAllergicNames(isArabic) {
String allergiesString = '';
patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , ';
MasterKeyModel selectedAllergy = getOneMasterKey(
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
if (selectedAllergy != null && element.isChecked)
allergiesString +=
(isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) +
' , ';
});
return allergiesString;
}
@ -261,7 +291,9 @@ class SOAPViewModel extends BaseViewModel {
) async {
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(),
episodeID: patientInfo.episodeNo == null
? "0"
: patientInfo.episodeNo.toString(),
appointmentNo: patientInfo.appointmentNo == null
? 0
: int.parse(
@ -281,7 +313,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async {
Future getPatientProgressNote(
GetProgressNoteReqModel getGetProgressNoteReqModel) async {
setState(ViewState.Busy);
await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel);
if (_SOAPService.hasError) {
@ -291,6 +324,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getMedicationList() async {
setState(ViewState.Busy);
await _prescriptionService.getMedicationList();
@ -303,7 +337,11 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async {
setState(ViewState.BusyLocal);
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1);
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel =
GetEpisodeForInpatientReqModel(
patientID: patient.patientId,
admissionNo: int.parse(patient.admissionNo),
patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -315,11 +353,13 @@ class SOAPViewModel extends BaseViewModel {
}
// ignore: missing_return
MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) {
MasterKeyModel getOneMasterKey(
{@required MasterKeysService masterKeys, dynamic id, int typeId}) {
switch (masterKeys) {
case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -328,7 +368,8 @@ class SOAPViewModel extends BaseViewModel {
case MasterKeysService.HistoryFamily:
List<MasterKeyModel> result = historyFamilyList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -336,7 +377,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.HistoryMedical:
List<MasterKeyModel> result = historyMedicalList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -344,7 +386,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.HistorySocial:
List<MasterKeyModel> result = historySocialList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -352,7 +395,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.HistorySports:
List<MasterKeyModel> result = historySocialList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -368,7 +412,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.PhysicalExamination:
List<MasterKeyModel> result = physicalExaminationList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -376,7 +421,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.AllergySeverity:
List<MasterKeyModel> result = allergySeverityList.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -384,7 +430,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -392,7 +439,8 @@ class SOAPViewModel extends BaseViewModel {
break;
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -410,8 +458,10 @@ class SOAPViewModel extends BaseViewModel {
}
}
int getFirstIndexForOldExamination(List<MySelectedExamination> mySelectedExamination) {
Iterable<MySelectedExamination> examList = mySelectedExamination.where((element) => !element.isLocal);
int getFirstIndexForOldExamination(
List<MySelectedExamination> mySelectedExamination) {
Iterable<MySelectedExamination> examList =
mySelectedExamination.where((element) => !element.isLocal);
if (examList.length > 0) {
return mySelectedExamination.indexOf(examList.first);
@ -420,25 +470,44 @@ class SOAPViewModel extends BaseViewModel {
}
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo,
episodeID: patientInfo.episodeNo,
doctorID: '');
var services = [_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)];
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
admissionNo:
patientInfo
.admissionNo !=
null
? int.parse(patientInfo.admissionNo)
: null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null
? int.parse(patientInfo.appointmentNo.toString())
: null,
episodeId: patientInfo.episodeNo,
episodeID: patientInfo.episodeNo,
doctorID: '');
var services = [
_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)
];
if (patientInfo.admissionNo == null) {
complaintsControllerError = '';
medicationControllerError = '';
illnessControllerError = '';
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
GeneralGetReqForSOAP generalGetReqForSOAP =
GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(),
appointmentNo: int.parse(patientInfo.appointmentNo.toString()),
doctorID: '',
editedBy: '');
services.add(
_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: int.parse(patientInfo.appointmentNo.toString()),
doctorID: '',
editedBy: '');
services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP));
}
@ -452,28 +521,40 @@ class SOAPViewModel extends BaseViewModel {
if (patientHistoryList.isNotEmpty) {
if (historyFamilyList.isEmpty) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
}
}
if (historyMedicalList.isEmpty) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)
];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
}
if (historySurgicalList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)
];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
}
if (historySportList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySports)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.HistorySports)
];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySports));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.HistorySports));
}
}
@ -484,9 +565,12 @@ class SOAPViewModel extends BaseViewModel {
services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies));
if (allergySeverityList.isEmpty) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)
];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
}
}
@ -504,30 +588,42 @@ class SOAPViewModel extends BaseViewModel {
var services;
if (medicationStrengthList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
}
}
if (medicationFrequencyList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency));
services.add(_SOAPService.getMasterLookup(
MasterKeysService.MedicationFrequency));
}
}
if (medicationDoseTimeList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
}
}
if (medicationRouteList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
}
}
if (allMedicationList.length == 0) {
@ -547,28 +643,34 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
callAddAssessmentLookupsServices({bool allowSetState = true}) async {
if (allowSetState) setState(ViewState.Busy);
var services;
if (listOfDiagnosisCondition.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
services.add(
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
}
}
if (listOfDiagnosisType.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)];
services = [
_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)
];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
services
.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
}
}
if (listOfICD10.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10));
}
}
@ -584,7 +686,11 @@ class SOAPViewModel extends BaseViewModel {
onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)];
@ -601,21 +707,37 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List<MySelectedHistory> myHistoryList, List<MySelectedAllergy> myAllergiesList}) async {
postSubjectServices(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText,
List<MySelectedHistory> myHistoryList,
List<MySelectedAllergy> myAllergiesList}) async {
var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText);
createPostChiefComplaintRequestModel(
patientInfo: patientInfo,
illnessText: illnessText,
medicationText: medicationText,
complaintsText: complaintsText);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
services = [
_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)
];
} else {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
services = [
_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)
];
}
if (myHistoryList.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
PostHistoriesRequestModel postHistoriesRequestModel =
createPostHistoriesRequestModel(
patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) {
services.add(_SOAPService.postHistories(postHistoriesRequestModel));
@ -625,7 +747,9 @@ 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 {
@ -642,9 +766,15 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) {
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel(
{patientInfo,
String complaintsText,
String medicationText,
String illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
admissionNo: patientInfo.admissionNo != null
? int.parse(patientInfo.admissionNo)
: null,
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo ?? 0,
appointmentNo: patientInfo.appointmentNo ?? 0,
@ -657,10 +787,13 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0);
}
PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
PostHistoriesRequestModel createPostHistoriesRequestModel(
{patientInfo, List<MySelectedHistory> myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel(doctorID: '');
myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
@ -675,24 +808,29 @@ class SOAPViewModel extends BaseViewModel {
return postHistoriesRequestModel;
}
PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}) {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
PostAllergyRequestModel createPostAllergyRequestModel(
{myAllergiesList, patientInfo}) {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy ?? doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
});
return postAllergyRequestModel;

@ -11,26 +11,22 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
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/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/authentication_service.dart';
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/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/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart';
import 'package:local_auth/auth_strings.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@ -45,15 +41,20 @@ class AuthenticationViewModel extends BaseViewModel {
NewLoginInformationModel get loginInfo => _authService.loginInfo;
List<DoctorProfileModel> get doctorProfilesList => _authService.doctorProfilesList;
SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes;
List<DoctorProfileModel> get doctorProfilesList =>
_authService.doctorProfilesList;
SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes;
SendActivationCodeForDoctorAppResponseModel
get activationCodeVerificationScreenRes =>
_authService.activationCodeVerificationScreenRes;
CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes;
SendActivationCodeForDoctorAppResponseModel
get activationCodeForDoctorAppRes =>
_authService.activationCodeForDoctorAppRes;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
CheckActivationCodeForDoctorAppResponseModel
get checkActivationCodeForDoctorAppRes =>
_authService.checkActivationCodeForDoctorAppRes;
NewLoginInformationModel loggedUser;
GetIMEIDetailsModel user;
@ -68,7 +69,6 @@ class AuthenticationViewModel extends BaseViewModel {
bool isFromLogin = false;
APP_STATUS appStatus = APP_STATUS.LOADING;
String localToken = "";
bool isHuawei = false;
AuthenticationViewModel({bool checkDeviceInfo = false}) {
getDeviceInfoFromFirebase();
@ -88,20 +88,32 @@ class AuthenticationViewModel extends BaseViewModel {
profileInfo['IMEI'] = token;
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'];
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'];
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.doctorID = loggedIn != null
? loggedIn['List_MemberInformation'][0]['MemberID']
: user.doctorID;
insertIMEIDetailsModel.outSA =
loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString());
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
: int.parse(user.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) {
@ -129,22 +141,25 @@ 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);
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 sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
await _authService
.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.ErrorLocal);
@ -153,7 +168,8 @@ 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(
@ -168,47 +184,58 @@ class AuthenticationViewModel extends BaseViewModel {
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: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()),
///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin: isSilentLogin,
generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
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: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
: int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID,
// 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;
getHospitalsRequestModel.doctorID = memberID;
await _hospitalsService.getHospitals(getHospitalsRequestModel);
if (_hospitalsService.hasError) {
error = _hospitalsService.error;
@ -238,14 +265,17 @@ class AuthenticationViewModel extends BaseViewModel {
}
}
/// add token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
/// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(
CheckActivationCodeForDoctorAppResponseModel
sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(
DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : "");
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(TOKEN,
sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
}
saveObjToString(String key, value) async {
@ -254,10 +284,18 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric
showIOSAuthMessages() async {
const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID');
const iosStrings = const IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please Enable Your Touch ID');
try {
await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e.toString());
}
@ -270,7 +308,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// get doctor profile based on clinic model
Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async {
ProfileReqModel docInfo = new ProfileReqModel(doctorID: clinicInfo.doctorID, clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, languageID: 2);
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID,
clinicID: clinicInfo.clinicID,
license: true,
projectID: clinicInfo.projectID,
languageID: 2);
///TODO change the lan
await _authService.getDoctorProfileBasedOnClinic(docInfo);
@ -285,12 +328,17 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
sharedPref.setString(
TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null &&
checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
localSetDoctorProfile(
checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
} else {
sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson());
sharedPref.setObj(
CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
ClinicModel clinic = ClinicModel.fromJson(
checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson());
await getDoctorProfileBasedOnClinic(clinic);
}
}
@ -316,29 +364,14 @@ class AuthenticationViewModel extends BaseViewModel {
}
}
// checkIsHuawei() async {
// HmsApiAvailability hmsApiAvailability = HmsApiAvailability();
// await hmsApiAvailability.isHMSAvailable().then((value) {
// isHuawei = value == 0 ? true : false;
// });
// print(isHuawei);
// }
/// call firebase service to check if the user already login in before or not
getDeviceInfoFromFirebase() async {
// await checkIsHuawei();
var token;
_firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging.requestPermission();
}
setState(ViewState.Busy);
try {
token = await _firebaseMessaging.getToken();
} catch (ex) {
print(ex);
}
var token = await _firebaseMessaging.getToken();
if (localToken == "") {
localToken = token;
@ -349,8 +382,10 @@ class AuthenticationViewModel extends BaseViewModel {
} else {
if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
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);
this.unverified = true;
}

@ -23,7 +23,8 @@ class BaseViewModel extends ChangeNotifier {
notifyListeners();
}
Future<DoctorProfileModel> getDoctorProfile({bool isGetProfile = false}) async {
Future<DoctorProfileModel> getDoctorProfile(
{bool isGetProfile = false}) async {
if (isGetProfile) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {

@ -1,5 +1,4 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
@ -31,6 +30,7 @@ class DashboardViewModel extends BaseViewModel {
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList =>
_specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider,
AuthenticationViewModel authProvider) async {
setState(ViewState.Busy);
@ -130,6 +130,4 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
}

@ -55,7 +55,7 @@ class DoctorReplayViewModel extends BaseViewModel {
infoStatus: 6,
createdBy: this.doctorProfile.doctorID,
infoEnteredBy: this.doctorProfile.doctorID,
);
setupID: "010266");
setState(ViewState.BusyLocal);
await _doctorReplyService.createDoctorResponse(createDoctorResponseModel);
if (_doctorReplyService.hasError) {

@ -18,15 +18,19 @@ import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
List<GetChiefComplaintResModel> get patientChiefComplaintList =>
_ucafService.patientChiefComplaintList;
List<VitalSignHistory> get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory;
List<VitalSignHistory> get patientVitalSignsHistory =>
_ucafService.patientVitalSignsHistory;
List<GetAssessmentResModel> get patientAssessmentList => _ucafService.patientAssessmentList;
List<GetAssessmentResModel> get patientAssessmentList =>
_ucafService.patientAssessmentList;
List<MasterKeyModel> get diagnosisTypes => _ucafService.listOfDiagnosisType;
List<MasterKeyModel> get diagnosisConditions => _ucafService.listOfDiagnosisCondition;
List<MasterKeyModel> get diagnosisConditions =>
_ucafService.listOfDiagnosisCondition;
PrescriptionModel get prescriptionList => _ucafService.prescriptionList;
@ -87,16 +91,23 @@ class UcafViewModel extends BaseViewModel {
if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') {
bodyMax = element.bodyMassIndex.toString();
}
if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') {
if (temperatureCelcius == "0" ||
temperatureCelcius == null ||
temperatureCelcius == 'null') {
temperatureCelcius = element.temperatureCelcius.toString();
}
if (hartRat == "0" || hartRat == null || hartRat == 'null') {
hartRat = element.pulseBeatPerMinute.toString();
}
if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') {
respirationBeatPerMinute = element.respirationBeatPerMinute.toString();
if (respirationBeatPerMinute == "0" ||
respirationBeatPerMinute == null ||
respirationBeatPerMinute == 'null') {
respirationBeatPerMinute =
element.respirationBeatPerMinute.toString();
}
if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') {
if (bloodPressure == "0 / 0" ||
bloodPressure == null ||
bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString();
}
});
@ -115,7 +126,8 @@ class UcafViewModel extends BaseViewModel {
} else {
if (patientAssessmentList.isNotEmpty) {
if (diagnosisConditions.length == 0) {
await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition);
await _ucafService
.getMasterLookup(MasterKeysService.DiagnosisCondition);
}
if (diagnosisTypes.length == 0) {
await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType);
@ -157,11 +169,13 @@ class UcafViewModel extends BaseViewModel {
}
}
MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) {
MasterKeyModel findMasterDataById(
{@required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) {
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -169,7 +183,8 @@ class UcafViewModel extends BaseViewModel {
return null;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;

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

@ -7,7 +7,8 @@ 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/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_templateModel.dart';
@ -35,11 +36,14 @@ class ProcedureViewModel extends BaseViewModel {
bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>();
List<GetOrderedProcedureModel> get procedureList => _procedureService.procedureList;
List<GetOrderedProcedureModel> get procedureList =>
_procedureService.procedureList;
List<ProcedureValadteModel> get valadteProcedureList => _procedureService.valadteProcedureList;
List<ProcedureValadteModel> get valadteProcedureList =>
_procedureService.valadteProcedureList;
List<CategoriseProcedureModel> get categoriesList => _procedureService.categoriesList;
List<CategoriseProcedureModel> get categoriesList =>
_procedureService.categoriesList;
List<dynamic> get categoryList => _procedureService.categoryList;
RadiologyService _radiologyService = locator<RadiologyService>();
@ -47,31 +51,40 @@ class ProcedureViewModel extends BaseViewModel {
List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
List<FinalRadiologyList> get finalRadiologyList =>
filterType == FilterType.Clinic
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
List<FinalRadiology> get radiologyList => _radiologyService.finalRadiologyList;
List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList;
List<PatientLabOrders> get patientLabOrdersList => _labsService.patientLabOrdersList;
List<PatientLabOrders> get patientLabOrdersList =>
_labsService.patientLabOrdersList;
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList;
List<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList;
List<ProcedureTempleteDetailsModel> get procedureTemplate =>
_procedureService.templateList;
List<ProcedureTempleteDetailsModelList> templateList = List();
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList;
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails =>
_procedureService.templateDetailsList;
bool _isRadiologyVIDAPlus = false;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async {
Future getProcedure(
{int mrn,
String patientType,
int appointmentNo,
bool isLocalBusy = false}) async {
hasError = false;
await getDoctorProfile();
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
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")
@ -82,14 +95,21 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async {
Future getProcedureCategory(
{String categoryName,
String categoryID,
patientId,
bool isLocalBusy = false}) async {
if (categoryName == null) return;
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _procedureService.getProcedureCategory(categoryName: categoryName, categoryID: categoryID, patientId: patientId);
await _procedureService.getProcedureCategory(
categoryName: categoryName,
categoryID: categoryID,
patientId: patientId);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -109,13 +129,17 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async {
Future getProcedureTemplate(
{String categoryID,
bool isLocalBusy = false,
BuildContext context}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false);
await _procedureService.getProcedureTemplate(
categoryID: categoryID, isLocalBusy: false);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -126,12 +150,20 @@ class ProcedureViewModel extends BaseViewModel {
setTemplateListDependOnId() {
procedureTemplate.forEach((element) {
List<ProcedureTempleteDetailsModelList> templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList();
List<ProcedureTempleteDetailsModelList> 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);
var template = ProcedureTempleteDetailsModelList(
templateName: element.templateName,
templateId: element.templateID,
template: element);
if (!templateList.contains(template)) templateList.add(template);
}
});
@ -153,7 +185,8 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, {bool isLocalBusy = false}) async {
Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn,
{bool isLocalBusy = false}) async {
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
@ -164,12 +197,14 @@ class ProcedureViewModel extends BaseViewModel {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else {
await getProcedure(mrn: mrn, isLocalBusy: isLocalBusy);
await getProcedure(mrn: mrn, isLocalBusy:isLocalBusy);
setState(ViewState.Idle);
}
}
Future validationProcedure(ProcedureValidationRequestModel procedureValidateRequestModel, {bool isLocalBusy = false}) async {
Future validationProcedure(
ProcedureValidationRequestModel procedureValidateRequestModel,
{bool isLocalBusy = false}) async {
hasError = false;
if (isLocalBusy) {
setState(ViewState.BusyLocal);
@ -185,12 +220,12 @@ class ProcedureViewModel extends BaseViewModel {
}
}
Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async {
Future updateProcedure(
{UpdateProcedureRequestModel updateProcedureRequestModel,
int mrn, bool isLocalBusy = false}) async {
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
if(isLocalBusy)setState(ViewState.BusyLocal); else
setState(ViewState.Busy);
await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) {
error = _procedureService.error;
@ -200,10 +235,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);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
await _radiologyService.getPatientRadOrders(patient,
isInPatient: isInPatient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
if (patientType == "7")
@ -212,25 +248,39 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal);
} else {
_radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
List<FinalRadiologyList> finalRadiologyListClinic =
_finalRadiologyListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
if (finalRadiologyListClinic.length != 0) {
_finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element);
_finalRadiologyListClinic[
finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])]
.finalRadiologyList
.add(element);
} else {
_finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element));
_finalRadiologyListClinic.add(FinalRadiologyList(
filterName: element.clinicDescription, finalRadiology: element));
}
// FinalRadiologyList list sort via project
List<FinalRadiologyList> finalRadiologyListHospital = _finalRadiologyListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
List<FinalRadiologyList> finalRadiologyListHospital =
_finalRadiologyListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (finalRadiologyListHospital.length != 0) {
_finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element);
_finalRadiologyListHospital[finalRadiologyListHospital
.indexOf(finalRadiologyListHospital[0])]
.finalRadiologyList
.add(element);
} else {
_finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element));
_finalRadiologyListHospital.add(FinalRadiologyList(
filterName: element.projectName, finalRadiology: element));
}
});
@ -240,9 +290,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);
await _radiologyService.getRadImageURL(
invoiceNo: invoiceNo,
lineItem: lineItem,
projectId: projectId,
patient: patient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);
@ -255,7 +313,8 @@ class ProcedureViewModel extends BaseViewModel {
notifyListeners();
}
List<PatientLabSpecialResult> get patientLabSpecialResult => _labsService.patientLabSpecialResult;
List<PatientLabSpecialResult> get patientLabSpecialResult =>
_labsService.patientLabSpecialResult;
List<LabResult> get labResultList => _labsService.labResultList;
@ -276,9 +335,19 @@ class ProcedureViewModel extends BaseViewModel {
}
}
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async {
getLaboratoryResult(
{String projectID,
int clinicID,
String invoiceNo,
String orderNo,
PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient);
await _labsService.getLaboratoryResult(
invoiceNo: invoiceNo,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -287,9 +356,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);
await _labsService.getPatientLabOrdersResults(
patientLabOrder: patientLabOrder,
procedure: procedure,
patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -297,7 +372,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();
@ -328,7 +405,8 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Busy);
}
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel();
ProcedureValidationRequestModel procedureValadteRequestModel =
new ProcedureValidationRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -343,34 +421,48 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> 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;
await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy);
await validationProcedure(procedureValadteRequestModel,
isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy);
await postProcedure(postProcedureReqModel, patient.patientMRN,
isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy);
} else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
}
} else {
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
Utils.showErrorToast(
valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
@ -378,23 +470,34 @@ class ProcedureViewModel extends BaseViewModel {
}
}
bool isEntityListSelected(cpe.EntityList masterKey, List<cpe.EntityList> entityList) {
Iterable<cpe.EntityList> history = entityList.where((element) => masterKey.procedureId == element.procedureId);
bool isEntityListSelected(
cpe.EntityList masterKey, List<cpe.EntityList> entityList) {
Iterable<cpe.EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, List<ProcedureTempleteDetailsModel> entityList) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where((element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName);
bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey,
List<ProcedureTempleteDetailsModel> entityList) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where(
(element) =>
masterKey.templateID == element.templateID &&
masterKey.procedureName == element.procedureName);
if (history.length > 0) {
return true;
}
return false;
}
Future addProcedures(ProcedureViewModel model, List<ProcedureTempleteDetailsModel> items, PatiantInformtion patient, TextEditingController remarksController, {bool isLocalBusy = false}) async {
Future addProcedures(
ProcedureViewModel model,
List<ProcedureTempleteDetailsModel> items,
PatiantInformtion patient,
TextEditingController remarksController,
{bool isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
@ -415,10 +518,15 @@ class ProcedureViewModel extends BaseViewModel {
eventCategory: "Procedure Checkout Screen",
eventAction: "Add New Procedure",
);
await model.preparePostProcedure(entityList: entityList, patient: patient, remarks: remarksController.text, isLocalBusy: isLocalBusy);
await model.preparePostProcedure(
entityList: entityList,
patient: patient,
remarks: remarksController.text,
isLocalBusy: isLocalBusy);
}
Future filterSearchResults(String query, List<cpe.EntityList> masterList, List<cpe.EntityList> items) async {
Future filterSearchResults(String query, List<cpe.EntityList> masterList,
List<cpe.EntityList> items) async {
List<cpe.EntityList> dummySearchList = List();
dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
@ -436,9 +544,13 @@ class ProcedureViewModel extends BaseViewModel {
}
}
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
void filterProcedureSearchResults(
String query,
List<ProcedureTempleteModel> masterList,
List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = List();
if (masterList != null) dummySearchList.addAll(masterList);
if(masterList!= null)
dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = List();
dummySearchList.forEach((item) {

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

@ -1,12 +1,11 @@
import 'dart:async';
import 'package:connectivity_plus/connectivity_plus.dart';
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/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart';
@ -33,14 +32,12 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic;
StreamSubscription subscription;
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
ProjectViewModel() {
loadSharedPrefLanguage();
subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
@ -56,11 +53,6 @@ class ProjectViewModel with ChangeNotifier {
});
}
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'en');
@ -103,18 +95,12 @@ class ProjectViewModel with ChangeNotifier {
try {
dynamic localRes;
await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_CLINICS_FOR_DOCTOR,
onSuccess: (dynamic response, int statusCode) {
doctorClinicsList = [];
response['List_DoctorsClinic'].forEach((v) {
doctorClinicsList.add(new ClinicModel.fromJson(v));
});
_vidaPlusProjectListModel.clear();
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
_vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
setVidaPlusProjectList(_vidaPlusProjectListModel);
}
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
@ -136,6 +122,7 @@ class ProjectViewModel with ChangeNotifier {
projectID: doctorProfile.projectID,
);
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel);
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false)
.getDoctorProfileBasedOnClinic(clinicModel);
}
}

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

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

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

@ -2,7 +2,8 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/voipcall/provider/chat_call_provider.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -36,17 +37,13 @@ class MyApp extends StatelessWidget {
return MultiProvider(
providers: [
ChangeNotifierProvider<AuthenticationViewModel>(
create: (context) => AuthenticationViewModel(),
),
create: (context) => AuthenticationViewModel()),
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),
ChangeNotifierProvider<LiveCareViewModel>(
create: (context) => LiveCareViewModel(),
),
ChangeNotifierProvider<ChatCallProvider>(
create: (context) => ChatCallProvider(),
),
StreamProvider.value(
value: RobotProvider().intStream(),
initialData: RobotProvider().setValue({}),

@ -34,15 +34,14 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return BaseView<ERSignInViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientSearchHeader(
title: "ER Sign In",
),
appBar: PatientSearchHeader(title: "ER Sign In",)
,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
@ -59,7 +58,10 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
SizedBox(
height: 7,
),
AppText(TranslationBase.of(context).scanERQrCode, fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center),
AppText(TranslationBase.of(context).scanERQrCode,
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox(
height: 15,
),
@ -93,28 +95,29 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
_scanQrAndGetPatient(BuildContext context, ERSignInViewModel model) async {
var result = (await BarcodeScanner.scan()).rawContent;
if (result != "") {
try {
try{
List<String> listOfParams = result.split(',');
int patientID = 0;
if (listOfParams[0].length != 0) patientID = int.parse(listOfParams[0]);
showMyDialog(
context: context,
firstAction: () {
signInERPatient(context: context, model: model, patientId: patientID, signInType: 1);
},
secondAction: () {
signInERPatient(context: context, model: model, patientId: patientID, signInType: 2);
});
} catch (e) {
if (listOfParams[0].length != 0)
patientID = int.parse(listOfParams[0]);
showMyDialog(context:context, firstAction: (){
signInERPatient(context: context, model: model, patientId: patientID, signInType: 1);
} , secondAction: (){
signInERPatient(context: context, model: model, patientId: patientID, signInType: 2);
} );
}catch(e){
Utils.showErrorToast("Please Enter Valid Code");
}
}
}
signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
signInERPatient ({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.signInERPatient(patientId: patientId, signInType: signInType);
if (model.state == ViewState.ErrorLocal) {
await model.signInERPatient(patientId:patientId, signInType: signInType );
if(model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
/// TODO Elham* Create this in Utils
@ -122,100 +125,103 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
}
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop();
}
/// TODO Elham* Make this as custom Dialog
showMyDialog({
BuildContext context,
Function firstAction,
Function secondAction,
}) {
showMyDialog({BuildContext context, Function firstAction,Function secondAction, }) {
showDialog(
context: context,
builder: (ctx) => Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 250,
child: AppScaffold(
isShowAppBar: false,
body: Container(
color: Colors.white,
child: Center(
child: Column(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 250,
child: AppScaffold(
isShowAppBar: false,
body: Container(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
"Select option",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
AppText(
"Select option",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
),
Container(
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ',
fontSize: 15,
textAlign: TextAlign.center,
),
),
Container(
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic
? "الرجاء اختيار الإجراء الذي تريد القيام به"
: 'Please choose the action you want to do ',
fontSize: 15,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 8,
),
DividerWithSpacesAround(),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
child: AppText(
"Sign In",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () async {
await firstAction();
}),
ElevatedButton(
child: AppText(
"Sign Out",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await secondAction();
})
],
),
)
],
SizedBox(
height: 8,
),
),
DividerWithSpacesAround(),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
child: AppText(
"Sing In",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () async {
await firstAction();
}),
FlatButton(
child: AppText(
"Sing Out",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await secondAction();
})
],
),
)
],
),
),
),
));
),
),
));
}
}

@ -3,7 +3,6 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -33,12 +32,10 @@ class _LoginScreenState extends State<LoginScreen> {
FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold(
isShowAppBar: false,
backgroundColor: HexColor('#F8F8F8'),
@ -47,106 +44,142 @@ class _LoginScreenState extends State<LoginScreen> {
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
alignment: Alignment.topLeft,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Column(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
//TODO Use App Text rather than text
Container(
child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
//TODO Use App Text rather than text
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 30,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 30,
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Text(
TranslationBase.of(context).welcomeTo,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context)
.drSulaimanAlHabib,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.isMobile
? 24
: SizeConfig.realScreenWidth *
0.029,
fontFamily: 'Poppins'),
),
Text(
"Doctor App",
style: TextStyle(
fontSize: SizeConfig.isMobile
? 16
: SizeConfig.realScreenWidth *
0.030,
fontWeight: FontWeight.w600,
color: Color(0xFFD02127)),
),
]),
],
)),
SizedBox(
height: 40,
),
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
SizedBox(
height: 10,
),
Text(
TranslationBase.of(context).welcomeTo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context).drSulaimanAlHabib,
style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'),
),
Text(
"Doctor App",
style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)),
),
]),
],
)),
SizedBox(
height: 40,
),
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo.userID = value.trim();
});
},
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
buildSizedBox(),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.userID = value.trim();
});
},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(
authenticationViewModel
.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
Utils.showCupertinoPicker(
context,
projectsList,
'facilityName',
onSelectProject,
authenticationViewModel);
},
),
buildSizedBox()
]),
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(authenticationViewModel.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
},
),
buildSizedBox()
]),
],
),
],
),
)
],
)
],
)
]))
]))
]),
),
bottomSheet: Container(
@ -162,7 +195,8 @@ class _LoginScreenState extends State<LoginScreen> {
title: TranslationBase.of(context).login,
color: AppGlobal.appRedColor,
fontWeight: FontWeight.w600,
disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null,
disabled: authenticationViewModel.userInfo.userID == null ||
authenticationViewModel.userInfo.password == null,
onPressed: () {
login(context);
},
@ -212,7 +246,8 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) {
setState(() {
authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
authenticationViewModel.userInfo.projectID =
projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName;
});
@ -229,8 +264,8 @@ class _LoginScreenState extends State<LoginScreen> {
if (authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals;
setState(() {
projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList);
authenticationViewModel.userInfo.projectID = projectsList[0].facilityId;
authenticationViewModel.userInfo.projectID =
projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName;
});
}

@ -35,7 +35,8 @@ class VerificationMethodsScreen extends StatefulWidget {
});
@override
_VerificationMethodsScreenState createState() => _VerificationMethodsScreenState();
_VerificationMethodsScreenState createState() =>
_VerificationMethodsScreenState();
}
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
@ -63,13 +64,16 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 6 : 4),
),
if (authenticationViewModel.isFromLogin)
InkWell(
onTap: () {
authenticationViewModel.setUnverified(false, isFromLogin: false);
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
authenticationViewModel.setUnverified(false,
isFromLogin: false);
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
child: Icon(
Icons.arrow_back_ios,
@ -78,23 +82,30 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Column(
children: <Widget>[
SizedBox(
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 3 : 4),
),
authenticationViewModel.user != null && isMoreOption == false
authenticationViewModel.user != null &&
isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).welcomeBack,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontWeight: FontWeight.w600,
color: AppGlobal.appTextColor,
letterSpacing: -0.72,
),
AppText(
Utils.convertToTitleCase(authenticationViewModel.user.doctorName),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
Utils.convertToTitleCase(
authenticationViewModel.user.doctorName),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
6,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold,
letterSpacing: -1.44,
@ -104,12 +115,15 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
SizedBox(height: SizeConfig.heightMultiplier * 4),
SizedBox(
height: SizeConfig.heightMultiplier * 4),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
@ -117,85 +131,149 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(color: HexColor('#707070'), width: 0.1),
border: Border.all(
color: HexColor('#707070'), width: 0.1),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).lastLoginAt,
TranslationBase.of(context)
.lastLoginAt,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
letterSpacing: -0.4),
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
width: MediaQuery.of(context)
.size
.width *
0.55,
child: RichText(
text: TextSpan(
text: TranslationBase.of(context).verifyWith + ':',
text: TranslationBase.of(
context)
.verifyWith +
':',
style: TextStyle(
color: Color(0xFF575757),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color:
Color(0xFF575757),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontWeight:
FontWeight.w600,
letterSpacing: -0.4),
children: <TextSpan>[
TextSpan(
text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context),
text: authenticationViewModel
.getType(
authenticationViewModel
.user
.logInTypeID,
context),
style: TextStyle(
color: AppGlobal.appTextColor,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.48),
color: AppGlobal
.appTextColor,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
letterSpacing:
-0.48),
)
]),
),
),
],
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
),
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
authenticationViewModel.user.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true)
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true)
authenticationViewModel
.user.editedOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.editedOn),
isMonthShort: true)
: authenticationViewModel
.user.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn),
isMonthShort: true)
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
),
AppText(
authenticationViewModel.user.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn))
: authenticationViewModel.user.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn))
authenticationViewModel
.user.editedOn !=
null
? AppDateUtils.getHour(AppDateUtils
.convertStringToDate(
authenticationViewModel
.user.editedOn))
: authenticationViewModel
.user.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF575757),
)
],
crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
)
],
),
@ -208,7 +286,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
//todo add translation
AppText(
"Please Verify",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600,
letterSpacing: -.64,
@ -220,90 +300,150 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
],
)
: Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context).verifyLoginWith,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context).verifyFingerprint2,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null && isMoreOption == false
? Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
print("Fingerprint"),
// TODO check this logic it seem it will create bug to us
authenticateUser(AuthMethodTypes.Fingerprint, true)
},
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.MoreOptions,
onShowMore: () {
setState(() {
isMoreOption = true;
});
},
))
]),
])
: Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
this.onlySMSBox == false
? Container(
margin: EdgeInsets.only(
bottom: 20, top: 30),
child: AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
),
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null &&
isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
child: InkWell(
onTap: () => {
// TODO check this logic it seem it will create bug to us
authenticateUser(
AuthMethodTypes
.Fingerprint,
true)
},
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel
.user
.logInTypeID),
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.MoreOptions,
onShowMore: () {
setState(() {
isMoreOption = true;
});
},
))
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.SMS,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.WhatsApp,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
))
],
),
]),
]),
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType: AuthMethodTypes.SMS,
authenticateUser:
(AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.WhatsApp,
authenticateUser:
(AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
),
]),
// )
],
@ -328,12 +468,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).useAnotherAccount ?? '',
title:
TranslationBase.of(context).useAnotherAccount ?? '',
color: Color(0xFFD02127),
//fontWeight: FontWeight.w700,
onPressed: () {
authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
),
SizedBox(
@ -347,11 +489,15 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
);
}
sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
sendActivationCodeByOtpNotificationType(
AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password);
await authenticationViewModel.sendActivationCodeForDoctorApp(
authMethodType: authMethodType,
password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context);
@ -369,14 +515,19 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType);
await authenticationViewModel
.sendActivationCodeVerificationScreen(authMethodType);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
await sharedPref.setString(
TOKEN,
authenticationViewModel
.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true);
} else {
@ -386,10 +537,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
authenticateUser(AuthMethodTypes authMethodType, isActive) {
if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) {
if (authMethodType == AuthMethodTypes.Fingerprint ||
authMethodType == AuthMethodTypes.FaceID) {
fingerPrintBefore = authMethodType;
}
this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
this.selectedOption =
fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
switch (authMethodType) {
case AuthMethodTypes.SMS:
@ -399,7 +552,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCode(authMethodType);
break;
case AuthMethodTypes.Fingerprint:
this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive);
this.loginWithFingerPrintOrFaceID(
AuthMethodTypes.Fingerprint, isActive);
break;
case AuthMethodTypes.FaceID:
this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive);
@ -422,7 +576,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
new SMSOTP(
context,
type,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile,
authenticationViewModel.loggedUser != null
? authenticationViewModel.loggedUser.mobileNumber
: authenticationViewModel.user.mobile,
(value) {
showDialog(
context: context,
@ -438,13 +594,18 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
).displayDialog(context);
}
loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async {
loginWithFingerPrintOrFaceID(
AuthMethodTypes authMethodTypes, isActive) async {
if (isActive) {
await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return;
if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) {
(SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes);
} else {
setState(() {
@ -455,7 +616,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
checkActivationCode({String value, bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin);
await authenticationViewModel.checkActivationCodeForDoctorApp(
activationCode: value, isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context);
Utils.showErrorToast(authenticationViewModel.error);

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

@ -70,7 +70,10 @@ class _VideoCallPageState extends State<VideoCallPage> {
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}" : "-",
patientName: widget.patientData.fullName ??
widget.patientData.firstName != null
? "${widget.patientData.firstName} ${widget.patientData.lastName}"
: "-",
tokenID: token,
//"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958",
@ -102,7 +105,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
});
connectOpenTok(result);
}).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()});
}).catchError((error) =>
{Utils.showErrorToast(error), Navigator.of(context).pop()});
}
@override
@ -130,14 +134,20 @@ class _VideoCallPageState extends State<VideoCallPage> {
),
Text(
_start == 0 ? 'Dailing' : 'Connected',
style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15),
style: TextStyle(
color: Colors.deepPurpleAccent,
fontWeight: FontWeight.w300,
fontSize: 15),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
),
Text(
widget.patientData.fullName,
style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20),
style: TextStyle(
color: Colors.deepPurpleAccent,
fontWeight: FontWeight.w900,
fontSize: 20),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
@ -145,7 +155,10 @@ class _VideoCallPageState extends State<VideoCallPage> {
Container(
child: Text(
_start == 0 ? 'Connecting...' : _timmer.toString(),
style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15),
style: TextStyle(
color: Colors.deepPurpleAccent,
fontWeight: FontWeight.w300,
fontSize: 15),
)),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
@ -192,21 +205,22 @@ class _VideoCallPageState extends State<VideoCallPage> {
_showAlert(BuildContext context) async {
await showDialog(
context: context,
builder: (dialogContex) => AlertDialog(content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
builder: (dialogContex) => AlertDialog(content: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return Container(
height: MediaQuery.of(context).size.height * 0.7,
width: MediaQuery.of(context).size.width * .9,
child: Stack(
fit: StackFit.loose,
// overflow: Overflow.visible,
overflow: Overflow.visible,
children: <Widget>[
Positioned(
right: -40.0,
top: -40.0,
child: InkResponse(
onTap: () {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context, rootNavigator: true)
.pop('dialog');
Navigator.of(context).pop();
},
child: CircleAvatar(
@ -222,41 +236,41 @@ class _VideoCallPageState extends State<VideoCallPage> {
children: <Widget>[
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => {endCall()},
child: Text(TranslationBase.of(context).endcall),
style: ElevatedButton.styleFrom(backgroundColor: Colors.red, textStyle: TextStyle(color: Colors.white))
//color: Colors.red,
//textColor: Colors.white,
)),
child: RaisedButton(
onPressed: () => {endCall()},
child:
Text(TranslationBase.of(context).endcall),
color: Colors.red,
textColor: Colors.white,
)),
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => {resumeCall()},
child: Text(TranslationBase.of(context).resumecall),
style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appGreenColor, textStyle: TextStyle(color: Colors.white))
// color: AppGlobal.appGreenColor,
// textColor: Colors.white,
),
child: RaisedButton(
onPressed: () => {resumeCall()},
child:
Text(TranslationBase.of(context).resumecall),
color: AppGlobal.appGreenColor,
textColor: Colors.white,
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () => {endCallWithCharge()},
child: Text(TranslationBase.of(context).endcallwithcharge),
style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.white))),
child: RaisedButton(
onPressed: () => {endCallWithCharge()},
child: Text(TranslationBase.of(context)
.endcallwithcharge),
textColor: Colors.white,
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: ElevatedButton(
child: RaisedButton(
onPressed: () => {
setState(() => {isTransfer = true})
},
child: Text(TranslationBase.of(context).transfertoadmin),
style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])),
// color: Colors.yellow[900],
child: Text(
TranslationBase.of(context).transfertoadmin),
color: Colors.yellow[900],
),
),
isTransfer == true
@ -269,13 +283,16 @@ class _VideoCallPageState extends State<VideoCallPage> {
child: TextField(
maxLines: 3,
controller: notes,
decoration: InputDecoration.collapsed(hintText: "Enter your notes here"),
decoration: InputDecoration.collapsed(
hintText:
"Enter your notes here"),
)),
Center(
child: ElevatedButton(
onPressed: () => {this.transferToAdmin(notes)},
child: RaisedButton(
onPressed: () =>
{this.transferToAdmin(notes)},
child: Text('Transfer'),
style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])),
color: Colors.yellow[900],
))
],
)
@ -295,24 +312,33 @@ class _VideoCallPageState extends State<VideoCallPage> {
transferToAdmin(notes) {
closeRoute();
_liveCareProvider.transfterToAdmin(widget.patientData, notes).then((result) {
_liveCareProvider
.transfterToAdmin(widget.patientData, notes)
.then((result) {
connectOpenTok(result);
}).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()});
}).catchError((error) =>
{Utils.showErrorToast(error), Navigator.of(context).pop()});
}
endCall() {
closeRoute();
_liveCareProvider.endCall(widget.patientData, false, doctorprofile['DoctorID']).then((result) {
_liveCareProvider
.endCall(widget.patientData, false, doctorprofile['DoctorID'])
.then((result) {
print(result);
}).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()});
}).catchError((error) =>
{Utils.showErrorToast(error), Navigator.of(context).pop()});
}
endCallWithCharge() {
_liveCareProvider.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']).then((result) {
_liveCareProvider
.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID'])
.then((result) {
closeRoute();
print('end callwith charge');
print(result);
}).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()});
}).catchError((error) =>
{Utils.showErrorToast(error), Navigator.of(context).pop()});
}
closeRoute() {

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -30,7 +30,18 @@ class MedicalFileDetails extends StatefulWidget {
String doctorImage;
MedicalFileDetails(
{this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage});
{this.age,
this.firstName,
this.lastName,
this.gender,
this.encounterNumber,
this.pp,
this.patient,
this.doctorName,
this.vistDate,
this.clinicName,
this.episode,
this.doctorImage});
@override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState(
@ -64,7 +75,18 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
String doctorImage;
_MedicalFileDetailsState(
{this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage});
{this.age,
this.firstName,
this.lastName,
this.gender,
this.encounterNumber,
this.pp,
this.patient,
this.doctorName,
this.vistDate,
this.clinicName,
this.episode,
this.doctorImage});
bool isPhysicalExam = true;
bool isProcedureExpand = true;
@ -80,7 +102,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model.getMedicalFile(mrn: pp);
}
},
builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
appBar: PatientProfileAppBar(
patient,
doctorName: doctorName,
@ -89,9 +113,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
isPrescriptions: true,
isMedicalFile: true,
episode: episode,
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
visitDate:
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate,
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true,
),
isShowAppBar: true,
@ -103,67 +128,125 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: Container(
child: Column(
children: [
model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0
model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0
? Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Column(
children: [
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
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),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(),
variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black),
AppText(
TranslationBase.of(
context)
.historyOfPresentIllness
.toUpperCase(),
variant: isHistoryExpand
? "bodyText"
: '',
bold: isHistoryExpand
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
isHistoryExpand =
!isHistoryExpand;
});
},
child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
child: Icon(isHistoryExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length,
itemBuilder: (BuildContext ctxt, int index) {
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstCheifComplaint
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstCheifComplaint[
index]
.hOPI
.trim(),
),
),
SizedBox(width: 35.0),
SizedBox(
width: 35.0),
],
),
],
@ -182,50 +265,87 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
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),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).assessment.toUpperCase(),
variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black),
AppText(
TranslationBase.of(
context)
.assessment
.toUpperCase(),
variant:
isAssessmentExpand
? "bodyText"
: '',
bold: isAssessmentExpand
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
isAssessmentExpand =
!isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
child: Icon(isAssessmentExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length,
itemBuilder: (BuildContext ctxt, int index) {
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Row(
children: [
@ -234,25 +354,59 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
fontSize: 13.0,
),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(),
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.iCD10
.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
fontWeight:
FontWeight
.w700,
),
SizedBox(width: 15.0),
SizedBox(
width: 15.0),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).condition + ": ",
TranslationBase.of(
context)
.condition +
": ",
fontSize: 12.5,
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.condition
.trim(),
fontSize: 13.0,
fontWeight: FontWeight.w700,
fontWeight:
FontWeight
.w700,
),
),
],
@ -261,8 +415,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description,
fontWeight: FontWeight.w700,
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.description,
fontWeight:
FontWeight
.w700,
fontSize: 15.0,
),
)
@ -271,14 +440,32 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row(
children: [
AppText(
TranslationBase.of(context).type + ": ",
TranslationBase.of(
context)
.type +
": ",
fontSize: 15.5,
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type,
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstAssessments[
index]
.type,
fontSize: 16.0,
fontWeight: FontWeight.w700,
fontWeight:
FontWeight
.w700,
),
),
],
@ -287,7 +474,18 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(),
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstAssessments[
index]
.remarks
.trim(),
),
Divider(
height: 1,
@ -310,50 +508,86 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
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),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).test.toUpperCase(),
variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black),
AppText(
TranslationBase.of(
context)
.test
.toUpperCase(),
variant: isProcedureExpand
? "bodyText"
: '',
bold: isProcedureExpand
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isProcedureExpand = !isProcedureExpand;
isProcedureExpand =
!isProcedureExpand;
});
},
child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
child: Icon(isProcedureExpand
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length,
itemBuilder: (BuildContext ctxt, int index) {
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstProcedure
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Row(
children: [
@ -363,26 +597,65 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'Procedure ID: ',
),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.procedureId
.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
fontSize:
13.5,
fontWeight:
FontWeight
.w700,
),
],
),
SizedBox(width: 35.0),
SizedBox(
width: 35.0),
Column(
children: [
AppText(
TranslationBase.of(context).orderDate + ": ",
TranslationBase.of(
context)
.orderDate +
": ",
),
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate
AppDateUtils
.getDateFormatted(
DateTime
.parse(
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.orderDate
.trim(),
)),
fontSize: 13.5,
fontWeight: FontWeight.w700,
fontSize:
13.5,
fontWeight:
FontWeight
.w700,
),
],
),
@ -395,8 +668,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName,
fontWeight: FontWeight.w700,
model
.medicalFileList[
0]
.entityList[
0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.procName,
fontWeight:
FontWeight
.w700,
),
)
],
@ -407,9 +695,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'CPT Code : ',
),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstProcedure[
index]
.patientID
.toString(),
fontWeight: FontWeight.w700,
fontWeight:
FontWeight
.w700,
),
],
),
@ -437,45 +739,79 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0)
if (model.medicalFileList.length != 0 &&
model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations
.length !=
0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
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),
border: Border.all(
color: Colors.grey[200],
width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(),
variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black),
AppText(
TranslationBase.of(
context)
.physicalSystemExamination
.toUpperCase(),
variant: isPhysicalExam
? "bodyText"
: '',
bold: isPhysicalExam
? true
: true,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isPhysicalExam = !isPhysicalExam;
isPhysicalExam =
!isPhysicalExam;
});
},
child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown))
child: Icon(isPhysicalExam
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length,
itemBuilder: (BuildContext ctxt, int index) {
itemCount: model
.medicalFileList[0]
.entityList[0]
.timelines[encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam
.length,
itemBuilder: (BuildContext ctxt,
int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
@ -483,27 +819,75 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
children: [
Row(
children: [
AppText(TranslationBase.of(context).examType + ": "),
AppText(TranslationBase.of(
context)
.examType +
": "),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc,
fontWeight: FontWeight.w700,
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.examDesc,
fontWeight:
FontWeight
.w700,
),
],
),
Row(
children: [
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc,
fontWeight: FontWeight.w700,
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.examDesc,
fontWeight:
FontWeight
.w700,
)
],
),
Row(
children: [
AppText(TranslationBase.of(context).abnormal + ": "),
AppText(TranslationBase.of(
context)
.abnormal +
": "),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal,
fontWeight: FontWeight.w700,
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[
0]
.consulations[
0]
.lstPhysicalExam[
index]
.abnormal,
fontWeight:
FontWeight
.w700,
),
],
),
@ -511,7 +895,17 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks,
model
.medicalFileList[
0]
.entityList[0]
.timelines[
encounterNumber]
.timeLineEvents[0]
.consulations[0]
.lstPhysicalExam[
index]
.remarks,
),
Divider(
height: 1,

@ -70,18 +70,11 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
});
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<MedicineViewModel>(onModelReady: (model) async {
}, builder: (_, model, w) {
// myController.text = model.searchText;
myController.text = model.searchText;
return AppScaffold(
// baseViewModel: model,
isShowAppBar: true,
@ -93,7 +86,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
height: 20,
),
AppTextFieldCustomSearch(
hintText:

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

@ -72,70 +72,136 @@ class _DischargedPatientState extends State<DischargedPatient> {
model.filterData.length,
(index) => InkWell(
onTap: () {
Navigator.of(context).pushNamed(PATIENTS_PROFILE,
arguments: {"patient": model.filterData[index], "patientType": "1", "isSearch": false, "isInpatient": true, "isDischargedPatient": true});
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient":
model.filterData[index],
"patientType": "1",
"isSearch": false,
"isInpatient": true,
"isDischargedPatient": true
});
},
child: Container(
width: double.maxFinite,
margin: EdgeInsets.all(8),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
padding: EdgeInsets.only(
left: 0,
right: 5,
bottom: 5,
top: 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
borderRadius:
BorderRadius.circular(15),
color: Colors.white,
),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
padding: EdgeInsets.only(
left: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Row(children: [
Container(
width: 170,
child: AppText(
(Utils.capitalize(model.filterData[index].firstName) + " " + Utils.capitalize(model.filterData[index].lastName)),
(Utils.capitalize(model
.filterData[
index]
.firstName) +
" " +
Utils.capitalize(model
.filterData[
index]
.lastName)),
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
fontWeight:
FontWeight
.bold,
fontFamily:
'Poppins',
textOverflow:
TextOverflow
.ellipsis,
),
),
model.filterData[index].gender == 1
model.filterData[index]
.gender ==
1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
DoctorApp
.male_2,
color: Colors
.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
DoctorApp
.female_1,
color: Colors
.pink,
),
]),
Row(
children: [
AppText(
model.filterData[index].nationalityName != null
? model.filterData[index].nationalityName.trim()
: model.filterData[index].nationality != null
? model.filterData[index].nationality.trim()
: model.filterData[index].nationalityId != null
model.filterData[index].nationalityName !=
null
? model
.filterData[
index]
.nationalityName
.trim()
: model.filterData[index].nationality !=
null
? model
.filterData[
index]
.nationality
.trim()
: model.filterData[index].nationalityId !=
null
? model.filterData[index].nationalityId
: "",
fontWeight: FontWeight.bold,
fontWeight:
FontWeight
.bold,
fontSize: 14,
textOverflow: TextOverflow.ellipsis,
textOverflow:
TextOverflow
.ellipsis,
),
model.filterData[index].nationality != null || model.filterData[index].nationalityId != null
model.filterData[index].nationality !=
null ||
model.filterData[index].nationalityId !=
null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '',
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
borderRadius:
BorderRadius.circular(
20.0),
child: Image
.network(
model.filterData[index].nationalityFlagURL !=
null
? model.filterData[index].nationalityFlagURL
: '',
height:
25,
width:
30,
errorBuilder: (BuildContext context,
Object
exception,
StackTrace
stackTrace) {
return AppText(
'',
fontSize: 10,
fontSize:
10,
);
},
))
@ -147,16 +213,26 @@ class _DischargedPatientState extends State<DischargedPatient> {
Row(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment
.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12.0),
padding:
EdgeInsets.only(
left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
model.filterData[index].gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
fit: BoxFit.cover,
child:
Image.asset(
model.filterData[index]
.gender ==
1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit
.cover,
),
),
),
@ -167,57 +243,118 @@ class _DischargedPatientState extends State<DischargedPatient> {
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')),
text:
new TextSpan(
text: model.filterData[index].patientId.toString(),
style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)),
style: new TextStyle(
fontSize: 2.0 *
SizeConfig
.textMultiplier,
color: Colors
.black),
children: <
TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize:
14,
fontFamily:
'Poppins')),
new TextSpan(
text: model
.filterData[
index]
.patientId
.toString(),
style: TextStyle(
fontWeight: FontWeight
.w700,
fontFamily:
'Poppins',
fontSize:
15)),
],
),
),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
text:
new TextSpan(
style:
new TextStyle(
fontSize: 2.0 *
SizeConfig
.textMultiplier,
color: Colors
.black,
fontFamily:
'Poppins',
),
children: <TextSpan>[
children: <
TextSpan>[
new TextSpan(
text: model.filterData[index].admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
style: TextStyle(fontSize: 14)),
text: model.filterData[index].admissionDate ==
null
? ""
: TranslationBase.of(context).admissionDate +
" : ",
style: TextStyle(
fontSize:
14)),
new TextSpan(
text: model.filterData[index].admissionDate == null
text: model.filterData[index].admissionDate ==
null
? ""
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 15)),
],
),
),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
text:
new TextSpan(
style:
new TextStyle(
fontSize: 2.0 *
SizeConfig
.textMultiplier,
color: Colors
.black,
fontFamily:
'Poppins',
),
children: <TextSpan>[
new TextSpan(text: model.filterData[index].dischargeDate == null ? "" : "Discharge Date : ", style: TextStyle(fontSize: 14)),
children: <
TextSpan>[
new TextSpan(
text: model.filterData[index].dischargeDate ==
null
? ""
: "Discharge Date : ",
style: TextStyle(
fontSize:
14)),
new TextSpan(
text: model.filterData[index].dischargeDate == null
text: model.filterData[index].dischargeDate ==
null
? ""
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)),
style: TextStyle(
fontWeight:
FontWeight.w700,
fontSize: 15)),
],
),
),
@ -227,12 +364,17 @@ class _DischargedPatientState extends State<DischargedPatient> {
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 14,
fontWeight: FontWeight.w300,
fontWeight:
FontWeight
.w300,
),
AppText(
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
fontSize:
15,
fontWeight:
FontWeight
.w700),
],
),
],

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

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
@ -20,7 +20,6 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_cus
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'filter_date_page.dart';
// ignore: must_be_immutable
@ -108,7 +107,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item ? true : false;
bool _isActive =
_times[_activeLocation] == item ? true : false;
return Expanded(
child: InkWell(
@ -128,7 +128,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
await model.getPatientBasedOnDate(
item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget.patientSearchRequestModel,
patientSearchRequestModel:
widget.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo,
outPatientFilterType: outPatientFilterType);
GifLoaderDialogUtils.hideDialog(context);
@ -139,15 +140,24 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: _isActive,
isFirst: _times.indexOf(item) == 0,
isLast: _times.indexOf(item) == _times.length - 1,
isMiddle: _times.indexOf(item) != 0 && _times.indexOf(item) != _times.length - 1,
isLast:
_times.indexOf(item) == _times.length - 1,
isMiddle: _times.indexOf(item) != 0 &&
_times.indexOf(item) != _times.length - 1,
projectViewModel: projectsProvider),
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabUtils.getTabText(title: item, isActive: _isActive),
_isActive && _activeLocation != 0 && model.state == ViewState.Idle ? TabUtils.getTabCounter(isActive: _isActive, counter: model.filterData.length) : Container(),
TabUtils.getTabText(
title: item, isActive: _isActive),
_isActive &&
_activeLocation != 0 &&
model.state == ViewState.Idle
? TabUtils.getTabCounter(
isActive: _isActive,
counter: model.filterData.length)
: Container(),
],
),
),
@ -167,7 +177,9 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
marginTop: 5,
suffixIcon: IconButton(
icon: Icon(
_activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH,
_activeLocation != 0
? DoctorApp.filter_1
: FontAwesomeIcons.slidersH,
color: Colors.black,
),
iconSize: 20,
@ -177,17 +189,21 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => FilterDatePage(
builder: (BuildContext context) =>
FilterDatePage(
outPatientFilterType: outPatientFilterType,
patientSearchViewModel: model,
),
settings: RouteSettings(name: 'FilterOutPatentDateScreen'),
settings: RouteSettings(
name: 'FilterOutPatentDateScreen'),
));
},
),
positionedChild: IconButton(
icon: Icon(
isSortDes ? FontAwesomeIcons.sortAmountDown : FontAwesomeIcons.sortAmountUp,
isSortDes
? FontAwesomeIcons.sortAmountDown
: FontAwesomeIcons.sortAmountUp,
color: Colors.black,
),
iconSize: 20,
@ -202,7 +218,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).youDontHaveAnyPatient,
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
),
)
: ListView.builder(
@ -210,9 +227,15 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
if (_activeLocation != 0 || (model.filterData[index].patientStatusType != null && model.filterData[index].patientStatusType == 43))
if (_activeLocation != 0 ||
(model.filterData[index].patientStatusType !=
null &&
model.filterData[index]
.patientStatusType ==
43))
return Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
padding: EdgeInsets.symmetric(
horizontal: 8, vertical: 0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
@ -221,17 +244,20 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget.patientSearchRequestModel.from,
"to": widget.patientSearchRequestModel.from,
"isSearch": false,
"isInpatient": false,
"arrivalType": "7",
"isSearchAndOut": false,
"isSigned": model.filterData[index].isSigned != null ? model.filterData[index].isSigned : false,
});
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": false,
"isInpatient": false,
"arrivalType": "7",
"isSearchAndOut": false,
});
},
// isFromSearch: widget.isSearch,
),

@ -26,10 +26,12 @@ import '../../../../routes.dart';
class AdmissionRequestFirstScreen extends StatefulWidget {
@override
_AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState();
_AdmissionRequestThirdScreenState createState() =>
_AdmissionRequestThirdScreenState();
}
class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScreen> {
class _AdmissionRequestThirdScreenState
extends State<AdmissionRequestFirstScreen> {
final _dietTypeRemarksController = TextEditingController();
final _sickLeaveCommentsController = TextEditingController();
final _postMedicalHistoryController = TextEditingController();
@ -90,7 +92,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
height: 15,
),
Container(
margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16),
margin:
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -117,27 +120,45 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
: _selectedClinic['clinicNameEnglish']
: null,
enabled: false,
onClick: model.clinicList != null && model.clinicList.length > 0
onClick: model.clinicList != null &&
model.clinicList.length > 0
? () {
openListDialogField(projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) {
openListDialogField(
projectViewModel.isArabic
? 'clinicNameArabic'
: 'clinicNameEnglish',
'clinicID',
model.clinicList, (selectedValue) {
setState(() {
_selectedClinic = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getClinics().then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.clinicList.length > 0) {
openListDialogField(projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getClinics().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.clinicList.length > 0) {
openListDialogField(
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");
}
},
),
@ -148,31 +169,47 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
isTextFieldHasSuffix: true,
dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null,
dropDownText: _selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
enabled: false,
validationError: doctorError,
onClick: _selectedClinic != null
? model.doctorsList != null && model.doctorsList.length > 0
? model.doctorsList != null &&
model.doctorsList.length > 0
? () {
openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) {
openListDialogField('DoctorName',
'DoctorID', model.doctorsList,
(selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.getClinicDoctors(_selectedClinic['clinicID']).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.doctorsList.length > 0) {
openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.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,
@ -204,7 +241,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
_patientPregnant = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
@ -228,7 +266,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
height: 8,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).sickLeaveComments,
hintText:
TranslationBase.of(context).sickLeaveComments,
controller: _sickLeaveCommentsController,
minLines: 2,
maxLines: 4,
@ -243,29 +282,45 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
hintText: TranslationBase.of(context).dietType,
isTextFieldHasSuffix: true,
validationError: dietTypeError,
dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null,
dropDownText: _selectedDietType != null
? _selectedDietType['nameEn']
: null,
enabled: false,
onClick: model.dietTypesList != null && model.dietTypesList.length > 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);
await model.getDietTypes(patient.patientId).then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.Idle && model.dietTypesList.length > 0) {
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
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) {
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");
}
},
),
@ -273,7 +328,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).dietTypeRemarks,
hintText:
TranslationBase.of(context).dietTypeRemarks,
controller: _dietTypeRemarksController,
minLines: 4,
maxLines: 6,
@ -283,7 +339,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).pastMedicalHistory,
hintText: TranslationBase.of(context)
.pastMedicalHistory,
controller: _postMedicalHistoryController,
minLines: 4,
maxLines: 6,
@ -294,7 +351,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).pastSurgicalHistory,
hintText: TranslationBase.of(context)
.pastSurgicalHistory,
controller: _postSurgicalHistoryController,
minLines: 2,
maxLines: 4,
@ -327,56 +385,80 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
_sickLeaveCommentsController.text != "" &&
_postMedicalHistoryController.text != "" &&
_postSurgicalHistoryController.text != "") {
model.admissionRequestData.patientMRN = patient.patientMRN;
model.admissionRequestData.appointmentNo = patient.appointmentNo;
model.admissionRequestData.patientMRN =
patient.patientMRN;
model.admissionRequestData.appointmentNo =
patient.appointmentNo;
model.admissionRequestData.episodeID = patient.episodeNo;
model.admissionRequestData.admissionRequestNo = 0;
model.admissionRequestData.admitToClinic = _selectedClinic['clinicID'];
model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID'];
model.admissionRequestData.admitToClinic =
_selectedClinic['clinicID'];
model.admissionRequestData.mrpDoctorID =
_selectedDoctor['DoctorID'];
model.admissionRequestData.isPregnant = _patientPregnant;
model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired;
model.admissionRequestData.sickLeaveComments = _sickLeaveCommentsController.text;
model.admissionRequestData.isDietType = _selectedDietType != null ? true : false;
model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0;
model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text;
model.admissionRequestData.diagnosis = "0";
model.admissionRequestData.pastMedicalHistory = _postMedicalHistoryController.text;
model.admissionRequestData.pastSurgicalHistory = _postSurgicalHistoryController.text;
model.admissionRequestData.isSickLeaveRequired =
_isSickLeaveRequired;
model.admissionRequestData.sickLeaveComments =
_sickLeaveCommentsController.text;
model.admissionRequestData.isDietType =
_selectedDietType != null ? true : false;
model.admissionRequestData.dietType =
_selectedDietType != null
? _selectedDietType['id']
: 0;
model.admissionRequestData.dietRemarks =
_dietTypeRemarksController.text;
model.admissionRequestData.pastMedicalHistory =
_postMedicalHistoryController.text;
model.admissionRequestData.pastSurgicalHistory =
_postSurgicalHistoryController.text;
Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData});
.pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {
'patient': patient,
'patientType': patientType,
'arrivalType': arrivalType,
'admission-data': model.admissionRequestData
});
} else {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill);
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
setState(() {
if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired;
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired;
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if (_sickLeaveCommentsController.text == "") {
sickLeaveCommentError = TranslationBase.of(context).fieldRequired;
sickLeaveCommentError =
TranslationBase.of(context).fieldRequired;
} else {
sickLeaveCommentError = null;
}
if (_selectedDietType == null) {
dietTypeError = TranslationBase.of(context).fieldRequired;
dietTypeError =
TranslationBase.of(context).fieldRequired;
} else {
dietTypeError = null;
}
if (_postMedicalHistoryController.text == "") {
medicalHistoryError = TranslationBase.of(context).fieldRequired;
medicalHistoryError =
TranslationBase.of(context).fieldRequired;
} else {
medicalHistoryError = null;
}
if (_postSurgicalHistoryController.text == "") {
surgicalHistoryError = TranslationBase.of(context).fieldRequired;
surgicalHistoryError =
TranslationBase.of(context).fieldRequired;
} else {
surgicalHistoryError = null;
}
@ -388,7 +470,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
);
}
void openListDialogField(String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
void openListDialogField(String attributeName, String attributeValueId,
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog(
list: list,
attributeName: attributeName,

@ -10,7 +10,8 @@ class LineChartForDiabetic extends StatelessWidget {
final int indexes;
final bool isOX;
LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false});
LineChartForDiabetic(
{this.title, this.timeSeries1, this.indexes, this.isOX = false});
List<int> xAxixs = List();
List<double> yAxixs = List();
@ -51,7 +52,8 @@ class LineChartForDiabetic extends StatelessWidget {
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
padding:
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
@ -82,10 +84,11 @@ class LineChartForDiabetic extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
//touchCallback: (LineTouchResponse touchResponse) {},
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
@ -106,8 +109,10 @@ class LineChartForDiabetic extends StatelessWidget {
} else
return '';
} else {
if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == 0)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
}

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

@ -90,10 +90,11 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
// touchCallback: (LineTouchResponse touchResponse) {},
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
@ -107,7 +108,8 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
rotateAngle: -65,
getTitles: (value) {
print(value);
DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime);
DateTime date = AppDateUtils.convertStringToDate(
widget.labResultHistory[value.toInt()].verifiedOnDateTime);
if (widget.labResultHistory.length < 8) {
if (widget.labResultHistory.length > value.toInt()) {
return '${date.day}/ ${date.year}';
@ -115,7 +117,8 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
return '';
} else {
if (value.toInt() == 0) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}';
if (value.toInt() == widget.labResultHistory.length - 1)
return '${date.day}/ ${date.year}';
if (xAxixs.contains(value.toInt())) {
return '${date.day}/ ${date.year}';
}
@ -200,7 +203,8 @@ class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
List<FlSpot> spots = List();
for (int index = 0; index < widget.labResultHistory.length; index++) {
try {
var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue);
var resultValueDouble =
double.parse(widget.labResultHistory[index].resultValue);
spots.add(FlSpot(index.toDouble(), resultValueDouble));
} catch (e) {
print(e);

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

@ -23,8 +23,8 @@ class LaboratoryResultWidget extends StatefulWidget {
final PatientLabOrders patientLabOrder;
final PatiantInformtion patient;
final bool isInpatient;
final String invoiceType;
const LaboratoryResultWidget(
const LaboratoryResultWidget(
{Key key,
this.onTap,
this.billNo,
@ -32,9 +32,7 @@ class LaboratoryResultWidget extends StatefulWidget {
this.orderNo,
this.patientLabOrder,
this.patient,
this.isInpatient,
this.invoiceType
})
this.isInpatient})
: super(key: key);
@override

@ -45,7 +45,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
getProgressNoteList(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -60,7 +61,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) {
model
.getPatientProgressNote(progressNoteRequest.toJson(),
isLocalBusy: isLocalBusy)
.then((c) {
notesList = model.patientProgressNoteList;
});
}
@ -72,7 +76,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold(
@ -83,338 +88,511 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patient,
isInpatient: true,
),
body: Container(
color: Colors.grey[200],
child: Column(
children: <Widget>[
if (!isDischargedPatient)
AddNewOrder(
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Progress Note Screen",
eventAction: "Update Progress Note",
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: false,
),
settings: RouteSettings(name: 'UpdateNoteOrder'),
body: Container(
color: Colors.grey[200],
child: Column(
children: <Widget>[
if (!isDischargedPatient)
AddNewOrder(
onTap: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Progress Note Screen",
eventAction: "Update Progress Note",
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: false,
),
settings: RouteSettings(name: 'UpdateNoteOrder'),
),
);
},
label: widget.visitType == 3
? TranslationBase.of(context).addNewOrderSheet
: TranslationBase.of(context).addProgressNote,
),
);
},
label: widget.visitType == 3 ? TranslationBase.of(context).addNewOrderSheet : TranslationBase.of(context).addProgressNote,
),
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.patientProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy
? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4
? Colors.red.shade700
: model.patientProgressNoteList[index].status == 2
? AppGlobal.appGreenColor
: Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy)
AppText(
TranslationBase.of(context).notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model.patientProgressNoteList[index].status == 4)
AppText(
TranslationBase.of(context).noteCanceled,
fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
if (model.patientProgressNoteList[index].status == 2)
AppText(
TranslationBase.of(context).noteVerified,
fontWeight: FontWeight.bold,
color: AppGlobal.appGreenColor,
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 &&
authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.patientProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
child: CardWithBgWidget(
hasBorder: false,
bgColor: model.patientProgressNoteList[index]
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy
? Color(0xFFCC9B14)
: model.patientProgressNoteList[index]
.status ==
4
? Colors.red.shade700
: model.patientProgressNoteList[index]
.status ==
2
? AppGlobal.appGreenColor
: Color(0xFFCC9B14),
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UpdateNoteOrder(
note: model.patientProgressNoteList[index],
patientModel: model,
patient: patient,
visitType: widget.visitType,
isUpdate: true,
)),
);
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
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).update,
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
if (model
.patientProgressNoteList[
index]
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText(
TranslationBase.of(context)
.notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: "verify",
confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo),
cancelledNote: false,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
conditionId: model.patientProgressNoteList[index].condition,
createdBy: model.patientProgressNoteList[index].createdBy,
notes: model.patientProgressNoteList[index].notes,
verifiedNote: true,
patientTypeID: patient.patientType,
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
await getProgressNoteList(context, model, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: AppGlobal.appGreenColor,
borderRadius: BorderRadius.circular(10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons.check,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
TranslationBase.of(context).noteVerify,
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText(
TranslationBase.of(context)
.noteCanceled,
fontWeight: FontWeight.bold,
color: Colors.red.shade700,
fontSize: 12,
),
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: TranslationBase.of(context).cancel,
confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(
if (model
.patientProgressNoteList[
index]
.status ==
2)
AppText(
TranslationBase.of(context)
.noteVerified,
fontWeight: FontWeight.bold,
color: AppGlobal.appGreenColor,
fontSize: 12,
),
if (model.patientProgressNoteList[index].status != 2 &&
model
.patientProgressNoteList[
index]
.status !=
4 &&
authenticationViewModel
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
UpdateNoteOrder(
note: model
.patientProgressNoteList[
index],
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true,
)),
);
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
admissionNo: int.parse(patient.admissionNo),
conditionId: model.patientProgressNoteList[index].condition,
cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo,
createdBy: model.patientProgressNoteList[index].createdBy,
notes: model.patientProgressNoteList[index].notes,
verifiedNote: false,
patientTypeID: patient.patientType,
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
await getProgressNoteList(context, model, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[600],
borderRadius: BorderRadius.circular(10),
),
// color:Colors.red[600],
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons.trash,
size: 12,
color: Colors.white,
child: Row(
children: [
Icon(
DoctorApp.edit_1,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
TranslationBase.of(
context)
.update,
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
),
SizedBox(
width: 2,
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName: "verify",
confirmFun: () async {
GifLoaderDialogUtils
.showMyDialog(
context);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
conditionId: model
.patientProgressNoteList[
index].condition,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true,
patientTypeID:
patient
.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: AppGlobal
.appGreenColor,
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons
.check,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
TranslationBase.of(
context)
.noteVerify,
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
),
AppText(
'Cancel',
fontSize: 10,
color: Colors.white,
),
SizedBox(
width: 10,
),
InkWell(
onTap: () async {
showMyDialog(
context: context,
actionName:
TranslationBase.of(
context)
.cancel,
confirmFun: () async {
GifLoaderDialogUtils
.showMyDialog(
context,
);
UpdateNoteReqModel
reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
conditionId: model
.patientProgressNoteList[
index].condition,
cancelledNote: true,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: false,
patientTypeID:
patient
.patientType,
patientOutSA: false,
);
await model
.updatePatientProgressNote(
reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[600],
borderRadius:
BorderRadius.circular(
10),
),
// color:Colors.red[600],
child: Row(
children: [
Icon(
FontAwesomeIcons
.trash,
size: 12,
color: Colors.white,
),
SizedBox(
width: 2,
),
AppText(
'Cancel',
fontSize: 10,
color: Colors.white,
),
],
),
padding: EdgeInsets.all(6),
),
],
),
padding: EdgeInsets.all(6),
),
SizedBox(
width: 10,
)
],
),
),
SizedBox(
width: 10,
)
],
),
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,
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).createdBy + ' ',
fontSize: 10,
),
Expanded(
child: AppText(
model.patientProgressNoteList[index].doctorName ?? '',
fontWeight: FontWeight.w600,
fontSize: 12,
isCopyable: true,
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
.patientProgressNoteList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12,
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,
),
),
],
),
],
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
Column(
children: [
AppText(
TranslationBase.of(context).conditionDescription + ' : ',
fontSize: 10,
model
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientProgressNoteList[
index]
.createdOn),
isArabic:
projectViewModel
.isArabic,
isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
Expanded(
child: AppText(
model.patientProgressNoteList[index].conditionDescription ?? '',
fontWeight: FontWeight.w600,
fontSize: 12,
isCopyable: true,
),
AppText(
model
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientProgressNoteList[
index]
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
],
),
crossAxisAlignment:
CrossAxisAlignment.end,
)
],
),
),
Column(
children: [
AppText(
model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn),
isArabic: projectViewModel.isArabic, isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
AppText(
model.patientProgressNoteList[index].createdOn != null
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn))
: AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
],
crossAxisAlignment: CrossAxisAlignment.end,
)
],
),
SizedBox(
height: 8,
),
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded(
child: AppText(
model.patientProgressNoteList[index].notes,
fontSize: 10,
isCopyable: true,
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
model
.patientProgressNoteList[
index]
.notes,
fontSize: 10,
isCopyable: true,
),
),
])
],
),
])
],
),
SizedBox(
height: 20,
SizedBox(
height: 20,
),
],
),
),
],
),
),
);
}),
);
}),
),
),
],
),
),
],
),
),
),
);
}
/// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function confirmFun, String actionName}) {
showDialog(
@ -459,7 +637,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?',
projectViewModel.isArabic
? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
: 'Are you sure you want $actionName this order?',
fontSize: 15,
textAlign: TextAlign.center,
),
@ -474,7 +654,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
FlatButton(
child: AppText(
TranslationBase.of(context).cancel,
fontWeight: FontWeight.w600,
@ -484,7 +664,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onPressed: () {
Navigator.of(context).pop();
}),
ElevatedButton(
FlatButton(
child: AppText(
TranslationBase.of(context).noteConfirm,
fontWeight: FontWeight.w600,

@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -378,14 +377,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
void resultListener(result) {
recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord});
if (result.finalResult ==true) {
setState(() {
if (mounted) {
// speech.stop();
progressNoteController.text += recognizedWord + '\n';
SpeechToText.closeAlertDialog(context);
}
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
progressNoteController.text += recognizedWord + '\n';
});
} else {
print(result.finalResult);

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

@ -591,7 +591,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
widget.patient.admissionNo),
createdBy:
model.doctorProfile.doctorID,
);
setupID: "010266");
await model.updateOperationReport(
createUpdateOperationReportRequestModel);

@ -1,24 +1,22 @@
import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart';
import 'package:doctor_app_flutter/utils/notification_permission_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -26,7 +24,6 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:quiver/async.dart';
import '../../../../locator.dart';
@ -37,15 +34,14 @@ class PatientProfileScreen extends StatefulWidget {
_PatientProfileScreenState createState() => _PatientProfileScreenState();
}
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
class _PatientProfileScreenState extends State<PatientProfileScreen>
with SingleTickerProviderStateMixin {
PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false;
bool isFromLiveCare = false;
bool isSigned = false;
bool isInpatient = false;
bool isMyPatient = false;
bool isCallFinished = false;
@ -89,7 +85,6 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
isSigned = routeArgs['isSigned'];
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
}
@ -120,14 +115,15 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
StreamSubscription callTimer;
callConnected() {
callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
..onDone(() {
callTimer.cancel();
})
..onData((data) {
var t = Utils.timeFrom(duration: data.elapsed);
videoCallDurationStreamController.sink.add(t);
});
callTimer =
CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null)
..onDone(() {
callTimer.cancel();
})
..onData((data) {
var t = Utils.timeFrom(duration: data.elapsed);
videoCallDurationStreamController.sink.add(t);
});
}
callDisconnected() {
@ -142,10 +138,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId);
if (isFromLiveCare && patient.patientStatus == 1)
await model.addPatientToDoctorList(patient.vcId);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -158,11 +154,13 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType,
PatientProfileHeaderNewDesignAppBar(
patient, arrivalType ?? '0', patientType,
videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
height: (patient.patientStatusType != null && patient.patientStatusType == 43)
height: (patient.patientStatusType != null &&
patient.patientStatusType == 43)
? 210
: isDischargedPatient
? 240
@ -194,7 +192,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
isInpatient: isInpatient,
from: from,
to: to,
isDischargedPatient: isDischargedPatient,
isDischargedPatient:
isDischargedPatient,
isFromSearch: isFromSearch,
)
: ProfileGridForOther(
@ -205,7 +204,6 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
isFromLiveCare: isFromLiveCare,
from: from,
to: to,
projectViewModel: projectViewModel,
),
),
SizedBox(
@ -220,7 +218,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
? true
: isFromLiveCare
? patient.episodeNo != null
: patient.patientStatusType != null && patient.patientStatusType == 43)
: patient.patientStatusType != null &&
patient.patientStatusType == 43)
BaseView<SOAPViewModel>(
onModelReady: (model) async {
model.getDoctorProfile();
@ -238,8 +237,10 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
if (patient.episodeNo == 0)
AppButton(
loading: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal,
title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
disabled:
model.state == ViewState.BusyLocal,
title:
"${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}",
color: isFromLiveCare || isInpatient
? AppGlobal.appRedColor
: patient.patientStatusType == 43
@ -247,7 +248,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
: AppGlobal.appRedColor,
fontColor: Colors.white,
// vPadding: 8,
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 25,
fontWeight: FontWeight.normal,
@ -258,24 +260,34 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
height: 30,
),
onPressed: () async {
if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) {
createEpisode(patient: patient, model: model);
if ((isFromLiveCare &&
patient.appointmentNo != null) ||
patient.patientStatusType == 43 ||
isInpatient) {
createEpisode(
patient: patient, model: model);
}
},
),
if (patient.episodeNo != 0)
AppButton(
loading: model.state == ViewState.BusyLocal,
// disabled: model.state == ViewState.BusyLocal || isSigned,
title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}",
color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal
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
? AppGlobal.appRedColor
: patient.patientStatusType == 43
? AppGlobal.appRedColor
?AppGlobal.appRedColor
: AppGlobal.appRedColor,
fontColor: Colors.white,
// vPadding: 8,
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 9 : 6),
radius: 30,
hPadding: 25,
fontWeight: FontWeight.normal,
@ -286,12 +298,19 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
height: 30,
),
onPressed: () async {
await locator<AnalyticsService>().logEvent(
await locator<AnalyticsService>()
.logEvent(
eventCategory: "Patient Profile ",
eventAction: "Update Episode",
);
if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43 || isInpatient) {
Navigator.of(context).pushNamed(UPDATE_EPISODE, arguments: {'patient': patient});
if ((isFromLiveCare &&
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType == 43 ||
isInpatient) {
Navigator.of(context).pushNamed(
UPDATE_EPISODE,
arguments: {'patient': patient});
}
}),
],
@ -323,9 +342,14 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
color: isCallFinished ? Colors.red[600] : AppGlobal.appGreenColor,
title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall,
disabled: isCallStarted || model.state == ViewState.BusyLocal,
color: isCallFinished
? Colors.red[600]
: AppGlobal.appGreenColor,
title: isCallFinished
? TranslationBase.of(context).endCall
: TranslationBase.of(context).initiateCall,
disabled: isCallStarted ||
model.state == ViewState.BusyLocal,
onPressed: () async {
// TODO MOSA TEST
// AppPermissionsUtils
@ -343,32 +367,50 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => EndCallScreen(patient: patient),
settings: RouteSettings(name: 'EndCallScreen'),
builder: (BuildContext context) =>
EndCallScreen(patient: patient),
settings:
RouteSettings(name: 'EndCallScreen'),
),
);
} else {
GifLoaderDialogUtils.showMyDialog(context);
await model.startCall(isReCall: false, vCID: patient.vcId);
await model.startCall(
isReCall: false, vCID: patient.vcId);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
patient.appointmentNo = int.parse(model
.startCallRes.appointmentNo
.toString());
patient.episodeNo = 0;
model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString()));
model.updateInCallPatient(
patient: patient,
appointmentNo: int.parse(model
.startCallRes.appointmentNo
.toString()));
setState(() {
isCallStarted = true;
});
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(
context: context,
onTapGrant: () {
locator<VideoCallService>()
.openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected);
});
AppPermissionsUtils
.requestVideoCallPermission(
context: context,
onTapGrant: () {
locator<VideoCallService>()
.openVideo(
model.startCallRes,
patient,
model.startCallRes != null
? model.startCallRes
.isRecording
: true,
callConnected,
callDisconnected);
});
}
}
},
@ -394,10 +436,15 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
);
GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId);
PostEpisodeForInpatientRequestModel postEpisodeReqModel =
PostEpisodeForInpatientRequestModel(
admissionNo: int.parse(patient.admissionNo),
patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel);
} else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: int.parse(patient.appointmentNo.toString()),
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
}
@ -407,7 +454,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Utils.showErrorToast(model.error);
} else {
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
Navigator.of(context)
.pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
}
}
}
@ -421,7 +469,12 @@ class AvatarWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)],
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC),
),

@ -1,8 +1,6 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart';
@ -18,50 +16,122 @@ class ProfileGridForOther extends StatelessWidget {
final bool isFromLiveCare;
String from;
String to;
ProjectViewModel projectViewModel;
ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key);
ProfileGridForOther(
{Key key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient,
this.from,
this.to,
this.isFromLiveCare})
: super(key: key);
@override
Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg',
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).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg',
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD,
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg',
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).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg',
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG",
PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient),
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg',
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, 'assets/images/svgs/profile_screen/patient sick leave.svg',
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null,
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null,
),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
if (isFromLiveCare ||
(patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isDisable:
Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null),
isDisable: isFromLiveCare
? patient.appointmentNo == null
: patient.patientStatusType != 43 ||
patient.appointmentNo == null),
];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),

@ -1,18 +1,15 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../../locator.dart';
@ -23,24 +20,23 @@ class RadiologyDetailsPage extends StatelessWidget {
final String patientType;
final String arrivalType;
final bool isInpatient;
final bool isVidaPlus;
RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false});
RadiologyDetailsPage(
{Key key,
this.finalRadiology,
this.patient,
this.patientType,
this.arrivalType,
this.isInpatient = false});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(
patient: patient,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceType:finalRadiology.invoiceType,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID,
),
),
patient: patient,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: finalRadiology.invoiceNo),
builder: (_, model, widget) => AppScaffold(
appBar: PatientProfileAppBar(
patient,
@ -54,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget {
),
isShowAppBar: true,
baseViewModel: model,
body: SingleChildScrollView(
body: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
@ -103,9 +99,11 @@ class RadiologyDetailsPage extends StatelessWidget {
height: 80,
width: double.maxFinite,
child: Container(
margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
margin:
EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12),
child: AppButton(
color: Color(0xffD02127),
disabled: finalRadiology.dIAPACSURL == "",
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "RadiologyDetailsPage",

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
@ -17,7 +17,6 @@ import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../widgets/shared/errors/error_message.dart';
class RadiologyHomePage extends StatefulWidget {
@ -48,7 +47,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false),
onModelReady: (model) => model.getPatientRadOrders(patient,
patientType: patientType, isInPatient: false),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
@ -66,17 +66,21 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SizedBox(
height: 12,
),
if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43)
if (model.radiologyList.isNotEmpty &&
patient.patientStatusType != 43)
ServiceTitle(
title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result,
),
if (patient.patientStatusType != null && patient.patientStatusType == 43)
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
ServiceTitle(
title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result,
),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
@ -92,7 +96,6 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
},
label: TranslationBase.of(context).applyForRadiologyOrder,
),
///TODO Elham * fix this to be list view builder
...List.generate(
model.radiologyList.length,
@ -114,26 +117,43 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
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),
),
)),
@ -141,27 +161,28 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Expanded(
child: DoctorCard(
isNoMargin: true,
doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName),
profileUrl: model.radiologyList[index].doctorImageURL,
invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
? '${model.radiologyList[index].invoiceNo_VP}'
: '${model.radiologyList[index].invoiceNo}',
// model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}',
branch: '${model.radiologyList[index].projectName}',
clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate,
doctorName:
Utils.convertToTitleCase(model.radiologyList[index].doctorName),
profileUrl:
model.radiologyList[index].doctorImageURL,
invoiceNO:
'${model.radiologyList[index].invoiceNo}',
branch:
'${model.radiologyList[index].projectName}',
clinic:
Utils.convertToTitleCase(model.radiologyList[index].clinicDescription),
appointmentDate:
model.radiologyList[index].orderDate ??
model.radiologyList[index].reportDate,
onTap: () {
Navigator.push(
context,
FadePage(
page: RadiologyDetailsPage(
finalRadiology: model.radiologyList[index],
finalRadiology:
model.radiologyList[index],
patient: patient,
isInpatient: isInpatient,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID)
// false
// model.radiologyList[index].isRecordFromVidaPlus
),
isInpatient: isInpatient),
),
);
},
@ -170,7 +191,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
],
),
)),
if (model.radiologyList.isEmpty && patient.patientStatusType != 43)
if (model.radiologyList.isEmpty &&
patient.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,

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

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

Loading…
Cancel
Save