merge-requests/291/head
Sultan Khan 5 years ago
commit 8b7acf7202

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 29 compileSdkVersion 30
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.doctor_app_flutter" applicationId "com.example.doctor_app_flutter"
minSdkVersion 18 minSdkVersion 18
targetSdkVersion 29 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -73,10 +73,10 @@ dependencies {
implementation 'com.opentok.android:opentok-android-sdk:2.16.5' implementation 'com.opentok.android:opentok-android-sdk:2.16.5'
//permissions //permissions
implementation 'pub.devrel:easypermissions:0.4.0' implementation 'pub.devrel:easypermissions:0.4.0'
implementation 'com.google.firebase:firebase-core:9.6.1'
//retrofit //retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1' implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1'
apply plugin: 'com.google.gms.google-services'
} }
apply plugin: 'com.google.gms.google-services'

@ -1,34 +1,41 @@
{ {
"project_info": { "project_info": {
"project_number": "1008895414777", "project_number": "1097451043303",
"project_id": "doctorapp-9f172", "project_id": "doctor-app-35ddc",
"storage_bucket": "doctorapp-9f172.appspot.com" "storage_bucket": "doctor-app-35ddc.appspot.com"
}, },
"client": [ "client": [
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28", "mobilesdk_app_id": "1:1097451043303:android:f82ecce9562ecaad866542",
"android_client_info": { "android_client_info": {
"package_name": "com.example.doctor_app_flutter" "package_name": "com.example.doctor_app_flutter"
} }
}, },
"oauth_client": [ "oauth_client": [
{ {
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
], ],
"api_key": [ "api_key": [
{ {
"current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw" "current_key": "AIzaSyChu44P8Dp8jtRqnoDR2mdjqKgSKQq-FPY"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [ "other_platform_oauth_client": [
{ {
"client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
},
{
"client_id": "1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.hmg.doctorApp"
}
} }
] ]
} }

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre</string>
<key>API_KEY</key>
<string>AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo</string>
<key>GCM_SENDER_ID</key>
<string>1097451043303</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.hmg.doctorApp</string>
<key>PROJECT_ID</key>
<string>doctor-app-35ddc</string>
<key>STORAGE_BUCKET</key>
<string>doctor-app-35ddc.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:1097451043303:ios:0e9b87e77dcf397d866542</string>
</dict>
</plist>

@ -18,7 +18,7 @@ PODS:
- Firebase/Messaging (6.33.0): - Firebase/Messaging (6.33.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0) - FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.3): - firebase_core (0.5.2):
- Firebase/CoreOnly (~> 6.33.0) - Firebase/CoreOnly (~> 6.33.0)
- Flutter - Flutter
- firebase_core_web (0.1.0): - firebase_core_web (0.1.0):
@ -100,7 +100,7 @@ PODS:
- Flutter - Flutter
- "permission_handler (5.0.1+1)": - "permission_handler (5.0.1+1)":
- Flutter - Flutter
- PromisesObjC (1.2.10) - PromisesObjC (1.2.11)
- Protobuf (3.13.0) - Protobuf (3.13.0)
- Reachability (3.2) - Reachability (3.2)
- shared_preferences (0.0.1): - shared_preferences (0.0.1):
@ -250,7 +250,7 @@ SPEC CHECKSUMS:
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
@ -273,7 +273,7 @@ SPEC CHECKSUMS:
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151 PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d

@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
29211E4225C172B700DD740D /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29211E4125C172B700DD740D /* GoogleService-Info.plist */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
@ -34,6 +35,8 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; };
29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@ -108,6 +111,8 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
29211E4125C172B700DD740D /* GoogleService-Info.plist */,
29211CD725C165D600DD740D /* RunnerRelease.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@ -204,6 +209,7 @@
files = ( files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
29211E4225C172B700DD740D /* GoogleService-Info.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
); );
@ -354,7 +360,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -437,7 +443,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -486,7 +492,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -530,6 +536,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 3A359E86ZF; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;

@ -1,7 +1,6 @@
import UIKit import UIKit
import Flutter import Flutter
import OpenTok import OpenTok
// Created by Mohammad Aljammal & Elham Rababah on 24/06/20. // Created by Mohammad Aljammal & Elham Rababah on 24/06/20.
// Copyright © 2020 Cloud. All rights reserved. // Copyright © 2020 Cloud. All rights reserved.
@ -23,7 +22,6 @@ import OpenTok
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall",
binaryMessenger: controller.binaryMessenger) binaryMessenger: controller.binaryMessenger)

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre</string>
<key>API_KEY</key>
<string>AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo</string>
<key>GCM_SENDER_ID</key>
<string>1097451043303</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.hmg.doctorApp</string>
<key>PROJECT_ID</key>
<string>doctor-app-35ddc</string>
<key>STORAGE_BUCKET</key>
<string>doctor-app-35ddc.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:1097451043303:ios:0e9b87e77dcf397d866542</string>
</dict>
</plist>

@ -47,10 +47,13 @@
<false/> <false/>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>${PRODUCT_NAME} always camera use</string> <string>App requires access to camera incase you are interested to attach images to your Qr Code.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Need to upload image</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>${PRODUCT_NAME} always Microphone use</string> <string>${PRODUCT_NAME} always Microphone use</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
</dict> </dict>
</plist> </plist>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

@ -70,7 +70,7 @@ class BaseAppClient {
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA; body['PatientOutSA'] = body['PatientOutSA']??0; // PATIENT_OUT_SA;
if (body['VidaAuthTokenID'] == null) { if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] = body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID); await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
@ -96,9 +96,9 @@ class BaseAppClient {
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
onFailure(getError(parsed), statusCode); // onFailure(getError(parsed), statusCode);
//await helpers.logout(); await helpers.logout();
//helpers.showErrorToast('Your session expired Please login agian'); helpers.showErrorToast('Your session expired Please login agian');
} else if (parsed['MessageStatus'] == 1) { } else if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated']) if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);

@ -191,6 +191,8 @@ const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG = const DRUG_TO_DRUG =
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
var selectedPatientType = 1; var selectedPatientType = 1;

@ -52,6 +52,8 @@ const Map<String, Map<String, String>> localizedValues = {
'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'},
'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'},
'referredOn': {'en': 'referred On : ', 'ar': ' : تمت الإحالة في'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},
'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'}, 'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'},
'lastName': {'en': 'Last Name', 'ar': 'اسم العائلة'}, 'lastName': {'en': 'Last Name', 'ar': 'اسم العائلة'},
@ -670,4 +672,21 @@ const Map<String, Map<String, String>> localizedValues = {
'referralRemark': {'en': "Referral Remark : ", 'ar': "ملاحظة الإحالة :"}, 'referralRemark': {'en': "Referral Remark : ", 'ar': "ملاحظة الإحالة :"},
'ICDName': {'en': "ICDName", 'ar': "اسم ال ICD"}, 'ICDName': {'en': "ICDName", 'ar': "اسم ال ICD"},
'offTime': {'en': "OffTime", 'ar': "خارج الوقت"}, 'offTime': {'en': "OffTime", 'ar': "خارج الوقت"},
'patient-name': {'en': "Patient Name", 'ar': "اسم المريص"},
'icd': {'en': "ICD", 'ar': "التصنيف الدولي للأمراض"},
'days': {'en': "Days", 'ar': "أيام"},
'months': {'en': "Months", 'ar': "أشهر"},
'years': {'en': "Years", 'ar': "سنين"},
'hr': {'en': "HR", 'ar': "س"},
'min': {'en': "Min", 'ar': "د"},
'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"},
'referralStatusHold': {'en': "Hold", 'ar': "معلق"},
'referralStatusActive': {'en': "Active", 'ar': "نشط"},
'referralStatusCancelled': {'en': "Cancelled", 'ar': "ملغاة"},
'referralStatusCompleted': {'en': "Completed", 'ar': "مكتمل"},
'referralStatusNotSeen': {'en': "NotSeen", 'ar': "لم يرى"},
'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"},
'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"},
// 'icd': {'en': "ICD", 'ar': " "},
}; };

@ -12,7 +12,15 @@ enum MasterKeysService {
DiagnosisType, DiagnosisType,
ICD10, ICD10,
TemperatureMethods, TemperatureMethods,
Speciality Speciality,
MedicationStrength,
MedicationDuration,
MedicationRoute,
MedicationFrequency,
MedicationDoseTime,
MedicationIndications,
AdmissionRequestType,
} }
extension SelectedMasterKeysService on MasterKeysService { extension SelectedMasterKeysService on MasterKeysService {
@ -45,7 +53,8 @@ extension SelectedMasterKeysService on MasterKeysService {
break; break;
case MasterKeysService.physiotherapyGoals: case MasterKeysService.physiotherapyGoals:
return 117; return 117;
break;case MasterKeysService.DiagnosisCondition: break;
case MasterKeysService.DiagnosisCondition:
return 34; return 34;
break; break;
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
@ -57,6 +66,25 @@ extension SelectedMasterKeysService on MasterKeysService {
return 2005; return 2005;
case MasterKeysService.Speciality: case MasterKeysService.Speciality:
return 10; return 10;
case MasterKeysService.MedicationStrength:
return 2100;
break;
case MasterKeysService.MedicationDuration:
return 118;
break;
case MasterKeysService.MedicationRoute:
return 32;
break;
case MasterKeysService.MedicationFrequency:
return 31;
break;
case MasterKeysService.MedicationDoseTime:
return 30;
break;
case MasterKeysService.MedicationIndications:
return 450;
case MasterKeysService.AdmissionRequestType:
return 2019;
break; break;
} }
} }

@ -0,0 +1,26 @@
class WardModel{
String description;
String descriptionN;
int floorID;
bool isActive;
WardModel(
{this.description, this.descriptionN, this.floorID, this.isActive});
WardModel.fromJson(Map<String, dynamic> json) {
description = json['description'];
descriptionN = json['descriptionN'];
floorID = json['floorID'];
isActive = json['isActive'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['description'] = this.description;
data['descriptionN'] = this.descriptionN;
data['floorID'] = this.floorID;
data['isActive'] = this.isActive;
return data;
}
}

@ -169,6 +169,7 @@ class Consulations {
List<LstPhysicalExam> lstPhysicalExam; List<LstPhysicalExam> lstPhysicalExam;
List<LstProcedure> lstProcedure; List<LstProcedure> lstProcedure;
List<LstMedicalHistory> lstMedicalHistory; List<LstMedicalHistory> lstMedicalHistory;
List<LstCheifComplaint> lstCheifComplaint;
Consulations( Consulations(
{this.admissionNo, {this.admissionNo,
@ -194,7 +195,8 @@ class Consulations {
this.lstAssessments, this.lstAssessments,
this.lstPhysicalExam, this.lstPhysicalExam,
this.lstProcedure, this.lstProcedure,
this.lstMedicalHistory}); this.lstMedicalHistory,
this.lstCheifComplaint});
Consulations.fromJson(Map<String, dynamic> json) { Consulations.fromJson(Map<String, dynamic> json) {
admissionNo = json['AdmissionNo']; admissionNo = json['AdmissionNo'];
@ -223,6 +225,12 @@ class Consulations {
lstAssessments.add(new LstAssessments.fromJson(v)); lstAssessments.add(new LstAssessments.fromJson(v));
}); });
} }
if (json['lstCheifComplaint'] != null) {
lstCheifComplaint = new List<LstCheifComplaint>();
json['lstCheifComplaint'].forEach((v) {
lstCheifComplaint.add(new LstCheifComplaint.fromJson(v));
});
}
if (json['lstPhysicalExam'] != null) { if (json['lstPhysicalExam'] != null) {
lstPhysicalExam = new List<LstPhysicalExam>(); lstPhysicalExam = new List<LstPhysicalExam>();
json['lstPhysicalExam'].forEach((v) { json['lstPhysicalExam'].forEach((v) {
@ -269,6 +277,10 @@ class Consulations {
data['lstAssessments'] = data['lstAssessments'] =
this.lstAssessments.map((v) => v.toJson()).toList(); this.lstAssessments.map((v) => v.toJson()).toList();
} }
if (this.lstCheifComplaint != null) {
data['lstCheifComplaint'] =
this.lstCheifComplaint.map((v) => v.toJson()).toList();
}
if (this.lstPhysicalExam != null) { if (this.lstPhysicalExam != null) {
data['lstPhysicalExam'] = data['lstPhysicalExam'] =
this.lstPhysicalExam.map((v) => v.toJson()).toList(); this.lstPhysicalExam.map((v) => v.toJson()).toList();
@ -284,6 +296,67 @@ class Consulations {
} }
} }
class LstCheifComplaint {
int appointmentNo;
String cCDate;
String chiefComplaint;
String currentMedication;
int episodeID;
String hOPI;
int patientID;
String patientType;
int projectID;
String projectName;
String setupID;
String dispalyName;
LstCheifComplaint(
{this.appointmentNo,
this.cCDate,
this.chiefComplaint,
this.currentMedication,
this.episodeID,
this.hOPI,
this.patientID,
this.patientType,
this.projectID,
this.projectName,
this.setupID,
this.dispalyName});
LstCheifComplaint.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
cCDate = json['CCDate'];
chiefComplaint = json['ChiefComplaint'];
currentMedication = json['CurrentMedication'];
episodeID = json['EpisodeID'];
hOPI = json['HOPI'];
patientID = json['PatientID'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
setupID = json['SetupID'];
dispalyName = json['dispalyName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['CCDate'] = this.cCDate;
data['ChiefComplaint'] = this.chiefComplaint;
data['CurrentMedication'] = this.currentMedication;
data['EpisodeID'] = this.episodeID;
data['HOPI'] = this.hOPI;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['SetupID'] = this.setupID;
data['dispalyName'] = this.dispalyName;
return data;
}
}
class LstAssessments { class LstAssessments {
int appointmentNo; int appointmentNo;
String condition; String condition;

@ -11,6 +11,13 @@ class LookupService extends BaseService {
List<MasterKeyModel> get allergySeverityList => _allergySeverityList; List<MasterKeyModel> get allergySeverityList => _allergySeverityList;
List<MasterKeyModel> _allergySeverityList = []; List<MasterKeyModel> _allergySeverityList = [];
List<dynamic> medicationStrengthList = [];
List<dynamic> medicationDurationList = [];
List<dynamic> medicationRouteList = [];
List<dynamic> medicationFrequencyList = [];
List<dynamic> medicationDoseTimeList = [];
List<dynamic> medicationIndicationsList = [];
List<MasterKeyModel> get historyFamilyList => _historyFamilyList; List<MasterKeyModel> get historyFamilyList => _historyFamilyList;
List<MasterKeyModel> _historyFamilyList = []; List<MasterKeyModel> _historyFamilyList = [];
@ -37,6 +44,7 @@ class LookupService extends BaseService {
List<MasterKeyModel> listOfICD10 = []; List<MasterKeyModel> listOfICD10 = [];
List<MasterKeyModel> listOfTemperatureMethods = []; List<MasterKeyModel> listOfTemperatureMethods = [];
List<MasterKeyModel> listOfSpeciality = []; List<MasterKeyModel> listOfSpeciality = [];
List<dynamic> listOfAdmissionType = [];
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false; hasError = false;
@ -113,39 +121,76 @@ class LookupService extends BaseService {
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
listOfDiagnosisType.clear(); listOfDiagnosisType.clear();
entryList.forEach((v) { entryList.forEach((v) {
listOfDiagnosisType listOfDiagnosisType.add(MasterKeyModel.fromJson(v));
.add(MasterKeyModel.fromJson(v));
}); });
break; break;
case MasterKeysService.DiagnosisCondition: case MasterKeysService.DiagnosisCondition:
listOfDiagnosisCondition.clear(); listOfDiagnosisCondition.clear();
entryList.forEach((v) { entryList.forEach((v) {
listOfDiagnosisCondition listOfDiagnosisCondition.add(MasterKeyModel.fromJson(v));
.add(MasterKeyModel.fromJson(v));
}); });
break; break;
case MasterKeysService.ICD10: case MasterKeysService.ICD10:
listOfICD10.clear(); listOfICD10.clear();
entryList.forEach((v) { entryList.forEach((v) {
listOfICD10 listOfICD10.add(MasterKeyModel.fromJson(v));
.add(MasterKeyModel.fromJson(v));
}); });
break; break;
case MasterKeysService.TemperatureMethods: case MasterKeysService.TemperatureMethods:
listOfTemperatureMethods.clear(); listOfTemperatureMethods.clear();
entryList.forEach((v) { entryList.forEach((v) {
listOfTemperatureMethods listOfTemperatureMethods.add(MasterKeyModel.fromJson(v));
.add(MasterKeyModel.fromJson(v));
}); });
break; break;
case MasterKeysService.Speciality: case MasterKeysService.Speciality:
listOfSpeciality.clear(); listOfSpeciality.clear();
entryList.forEach((v) { entryList.forEach((v) {
listOfSpeciality listOfSpeciality.add(MasterKeyModel.fromJson(v));
.add(MasterKeyModel.fromJson(v)); });
break;
case MasterKeysService.MedicationStrength:
medicationStrengthList.clear();
entryList.forEach((v) {
medicationStrengthList.add(v);
});
break;
case MasterKeysService.MedicationDuration:
medicationDurationList.clear();
entryList.forEach((v) {
medicationDurationList.add(v);
});
break;
case MasterKeysService.MedicationRoute:
medicationRouteList.clear();
entryList.forEach((v) {
medicationRouteList.add(v);
});
break;
case MasterKeysService.MedicationFrequency:
medicationFrequencyList.clear();
entryList.forEach((v) {
medicationFrequencyList.add(v);
});
break;
case MasterKeysService.MedicationDoseTime:
medicationDoseTimeList.clear();
entryList.forEach((v) {
medicationDoseTimeList.add(v);
});
break;
case MasterKeysService.MedicationIndications:
medicationIndicationsList.clear();
entryList.forEach((v) {
medicationIndicationsList.add(v);
});
break;
case MasterKeysService.AdmissionRequestType:
listOfAdmissionType.clear();
entryList.forEach((v) {
// listOfAdmissionType.add(MasterKeyModel.fromJson(v));
listOfAdmissionType.add(v);
}); });
break; break;
} }
} }
} }

@ -1,9 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class AdmissionRequestService extends LookupService { class AdmissionRequestService extends LookupService {
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<dynamic> specialityList = []; List<dynamic> specialityList = [];
List<dynamic> wardList = [];
List<dynamic> diagnosisTypesList = [];
List<dynamic> allergiesLookupList = [];
setSpecialityList() { setSpecialityList() {
specialityList.clear(); specialityList.clear();
@ -12,6 +17,13 @@ class AdmissionRequestService extends LookupService {
}); });
} }
setAllergies() {
allergiesLookupList.clear();
allergiesList.forEach((element) {
allergiesLookupList.add(element.toJson());
});
}
Future getDoctorsList() async { Future getDoctorsList() async {
hasError = false; hasError = false;
@ -28,4 +40,50 @@ class AdmissionRequestService extends LookupService {
body: Map(), body: Map(),
); );
} }
Future getWardList() async {
hasError = false;
await baseAppClient.post(
GET_WARDS,
onSuccess: (dynamic response, int statusCode) {
wardList.clear();
if (response['AdmissionMasterList'] != null &&
response['AdmissionMasterList']['entityList'] != null) {
response['AdmissionMasterList']['entityList'].forEach((v) {
// wardList.add(WardModel.fromJson(v));
wardList.add(v);
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
Future getDiagnosisTypesList() async {
hasError = false;
await baseAppClient.post(
GET_DIAGNOSIS_TYPES,
onSuccess: (dynamic response, int statusCode) {
diagnosisTypesList.clear();
if (response['AdmissionDiagnosisList'] != null &&
response['AdmissionDiagnosisList']['entityList'] != null) {
response['AdmissionDiagnosisList']['entityList'].forEach((v) {
// diagnosisTypesList.add(MasterKeyModel.fromJson(v));
diagnosisTypesList.add(v);
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
} }

@ -32,13 +32,14 @@ class PatientReferralService extends LookupService {
"Channel": 9, "Channel": 9,
"TokenID": "", "TokenID": "",
"SessionID": "i1UJwCTSqt", "SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true "IsLoginForDoctorApp": true,
// "MemberID": memberID
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(url, onSuccess: (response, statusCode) async { await baseAppClient.post(url, onSuccess: (response, statusCode) async {
if (response['MessageStatus'] == 1) { if (response['MessageStatus'] == 1) {
projectsList = response['ListProject']; projectsList = response['ProjectInfo'];
} else { } else {
// handel error // handel error
projectsList = ListProject; projectsList = ListProject;

@ -41,7 +41,7 @@ class UcafService extends LookupService {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
// body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo; // body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post( await baseAppClient.post(

@ -43,7 +43,7 @@ class VitalSignsService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo; // body['EpisodeID'] = patient.episodeNo;
body['PatientTypeID'] = 1; body['PatientTypeID'] = 1;
body['PatientType'] = 1; body['PatientType'] = 1;
body['DeviceTypeID'] = 1; body['DeviceTypeID'] = 1;

@ -6,12 +6,13 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends LookupService {
List<PrescriptionModel> _prescriptionList = List(); List<PrescriptionModel> _prescriptionList = List();
List<PrescriptionModel> get prescriptionList => _prescriptionList; List<PrescriptionModel> get prescriptionList => _prescriptionList;
List<SearchDrugModel> _drugsList = List(); List<SearchDrugModel> _drugsList = List();

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/SOAP_service.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
@ -8,10 +10,25 @@ import 'base_view_model.dart';
class MedicineViewModel extends BaseViewModel { class MedicineViewModel extends BaseViewModel {
MedicineService _medicineService = locator<MedicineService>(); MedicineService _medicineService = locator<MedicineService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmacyItemsList => _medicineService.pharmacyItemsList;
get pharmaciesList => _medicineService.pharmaciesList; get pharmaciesList => _medicineService.pharmaciesList;
PrescriptionService _prescriptionService = locator<PrescriptionService>(); get medicationStrengthList => _prescriptionService.medicationStrengthList;
get medicationDurationList => _prescriptionService.medicationDurationList;
get medicationRouteList => _prescriptionService.medicationRouteList;
get medicationFrequencyList => _prescriptionService.medicationFrequencyList;
get medicationIndicationsList =>
_prescriptionService.medicationIndicationsList;
get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList;
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList; _prescriptionService.allMedicationList;
@ -35,6 +52,72 @@ class MedicineViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMedicationStrength() async {
setState(ViewState.Busy);
await _prescriptionService
.getMasterLookup(MasterKeysService.MedicationStrength);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationRoute() async {
setState(ViewState.Busy);
await _prescriptionService
.getMasterLookup(MasterKeysService.MedicationRoute);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationIndications() async {
setState(ViewState.Busy);
await _prescriptionService
.getMasterLookup(MasterKeysService.MedicationIndications);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationDoseTime() async {
setState(ViewState.Busy);
await _prescriptionService
.getMasterLookup(MasterKeysService.MedicationDoseTime);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationFrequency() async {
setState(ViewState.Busy);
await _prescriptionService
.getMasterLookup(MasterKeysService.MedicationFrequency);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationDuration() async {
setState(ViewState.Busy);
await _prescriptionService
.getMasterLookup(MasterKeysService.MedicationDuration);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPharmaciesList(int itemId) async { Future getPharmaciesList(int itemId) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _medicineService.getPharmaciesList(itemId); await _medicineService.getPharmaciesList(itemId);
@ -44,4 +127,13 @@ class MedicineViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
dynamic getLookupById(List<dynamic> list, String id) {
for (int i = 0; i < list.length; i++) {
if (list[i]['id'].toString() == id) {
return list[i];
}
}
return null;
}
} }

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart';
import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
@ -15,20 +16,24 @@ class AdmissionRequestViewModel extends BaseViewModel{
List<dynamic> get speciality => _admissionRequestService.specialityList; List<dynamic> get speciality => _admissionRequestService.specialityList;
List<dynamic> get wardList => _admissionRequestService.wardList;
List<dynamic> get admissionTypeList => _admissionRequestService.listOfAdmissionType;
List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList;
String selectedLanguage; String selectedLanguage;
Future getLanguage() async { Future getLanguage() async {
selectedLanguage = await sharedPref.getString(APP_Language); selectedLanguage = await sharedPref.getString(APP_Language);
} }
Future getMasterLookup() async { Future getSpecialityList() async {
setState(ViewState.Busy);
await getLanguage(); await getLanguage();
await _admissionRequestService.getMasterLookup(MasterKeysService.Speciality); await getMasterLookup(MasterKeysService.Speciality);
if (_admissionRequestService.hasError) { if (!_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.Error);
} else {
_admissionRequestService.setSpecialityList(); _admissionRequestService.setSpecialityList();
await getClinicDoctors(); await getClinicDoctors();
} }
@ -43,4 +48,42 @@ class AdmissionRequestViewModel extends BaseViewModel{
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getWards() async {
setState(ViewState.Busy);
await _admissionRequestService.getWardList();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getDiagnosis() async {
setState(ViewState.Busy);
await _admissionRequestService.getDiagnosisTypesList();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getAllergies() async {
await getMasterLookup(MasterKeysService.Allergies);
if (!_admissionRequestService.hasError) {
_admissionRequestService.setAllergies();
}
}
Future getMasterLookup(MasterKeysService keysService) async {
setState(ViewState.Busy);
await _admissionRequestService.getMasterLookup(keysService);
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
} }

@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -94,8 +96,8 @@ class PatientReferralViewModel extends BaseViewModel {
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) { if (doctorProfile != null) {
dynamic _selectedBranch = { dynamic _selectedBranch = {
"ID": doctorProfile.projectID, "facilityId": doctorProfile.projectID,
"Desciption": doctorProfile.projectName "facilityName": doctorProfile.projectName
}; };
return _selectedBranch; return _selectedBranch;
} }
@ -126,7 +128,8 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { Future responseReferral(
PendingReferral pendingReferral, bool isAccepted) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.responseReferral(pendingReferral, isAccepted); await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -136,14 +139,11 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future makeReferral(PatiantInformtion patient, Future makeReferral(PatiantInformtion patient, String isoStringDate,
String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async {
int projectID,
int clinicID,
int doctorID,
String remarks) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); await _referralPatientService.makeReferral(
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -152,10 +152,14 @@ class PatientReferralViewModel extends BaseViewModel {
} }
} }
Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { Future getPatientDetails(
String fromDate, String toDate, int patientMrn, int appointmentNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn, appointmentNo: appointmentNo); await _referralPatientService.getPatientArrivalList(toDate,
fromDate: fromDate,
patientMrn: patientMrn,
appointmentNo: appointmentNo);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -163,7 +167,25 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
/* /*
* model * model
.getPatientArrivalList()*/ .getPatientArrivalList()*/
String getReferralStatusNameByCode(int statusCode, BuildContext context) {
switch (statusCode) {
case 1:
return TranslationBase.of(context).referralStatusHold;
case 2:
return TranslationBase.of(context).referralStatusActive;
case 4:
return TranslationBase.of(context).referralStatusCancelled;
case 46:
return TranslationBase.of(context).referralStatusCompleted;
case 63:
return TranslationBase.of(context).referralStatusNotSeen;
default:
return "-";
}
}
} }

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.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/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -13,7 +14,9 @@ import './routes.dart';
import 'config/config.dart'; import 'config/config.dart';
import 'locator.dart'; import 'locator.dart';
void main() { void main()async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
setupLocator(); setupLocator();
runApp(MyApp()); runApp(MyApp());
} }

@ -8,7 +8,7 @@ class VitalSignData {
var bodyMassIndex; var bodyMassIndex;
int fio2; int fio2;
int headCircumCm; int headCircumCm;
int heightCm; var heightCm;
int idealBodyWeightLbs; int idealBodyWeightLbs;
bool isPainManagementDone; bool isPainManagementDone;
bool isVitalsRequired; bool isVitalsRequired;
@ -26,10 +26,10 @@ class VitalSignData {
int respirationPattern; int respirationPattern;
int sao2; int sao2;
int status; int status;
int temperatureCelcius; var temperatureCelcius;
int temperatureCelciusMethod; int temperatureCelciusMethod;
int waistSizeInch; var waistSizeInch;
int weightKg; var weightKg;
VitalSignData( VitalSignData(
{this.appointmentNo, {this.appointmentNo,

@ -64,7 +64,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
projectsProvider = Provider.of<ProjectViewModel>(context); projectsProvider = Provider.of<ProjectViewModel>(context);
projectsProvider.getDoctorClinicsList(); projectsProvider.getDoctorClinicsList();
_firebaseMessaging.setAutoInitEnabled(true); // _firebaseMessaging.setAutoInitEnabled(true);
_firebaseMessaging.requestNotificationPermissions(
const IosNotificationSettings(
sound: true, badge: true, alert: true, provisional: true));
_firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings) {
print("Settings registered: $settings");
});
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != '') { if (token != '') {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;

@ -188,7 +188,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations .consulations
.length != .length !=
0) 0)
AppText( Expanded(
child: AppText(
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
@ -199,6 +200,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.toUpperCase(), .toUpperCase(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
], ],
), ),
if (model.medicalFileList.length != 0) if (model.medicalFileList.length != 0)
@ -315,7 +317,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.timelines[encounterNumber] .timelines[encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstMedicalHistory .lstCheifComplaint
.length, .length,
itemBuilder: itemBuilder:
(BuildContext ctxt, int index) { (BuildContext ctxt, int index) {
@ -338,9 +340,9 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstMedicalHistory[ .lstCheifComplaint[
index] index]
.history .hOPI
.trim(), .trim(),
), ),
), ),
@ -795,7 +797,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstPhysicalExam[ .lstPhysicalExam[
index] index]
.examType), .examDesc),
], ],
), ),
Row( Row(

@ -34,6 +34,10 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
// mainAxisAlignment: model.medicalFileList.length != 0 &&
// model.medicalFileList != null
// ? MainAxisAlignment.start
// : MainAxisAlignment.center,
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
Divider( Divider(

@ -472,10 +472,21 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
); );
}).toList(); }).toList();
}, },
onChanged: (String newValue) => { onChanged: (String newValue) {
setState(() { setState(() {
_selectedLocation = newValue; _selectedLocation = newValue;
}) });
if (newValue == '1')
{
_patientSearchFormValues
.PatientOutSA = false;
}
else
{
_patientSearchFormValues
.PatientOutSA = true;
}
}, },
items: LOCATIONS.map((item) { items: LOCATIONS.map((item) {
!projectsProvider.isArabic !projectsProvider.isArabic

@ -616,7 +616,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
.white, .white,
), ),
AppText( AppText(
" ${DateUtils.getAgeByBirthday(item.dateofBirth)}", " ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}",
fontSize: 1.8 * fontSize: 1.8 *
SizeConfig SizeConfig

@ -284,7 +284,24 @@ class DiagnosisWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", "${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).icd}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${diagnosis.icdCode10ID}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),

@ -144,7 +144,11 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
], ],
), ),
Row( SizedBox(
width: 4,
),
Expanded(
child: Row(
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).temperature}", "${TranslationBase.of(context).temperature}",
@ -155,14 +159,17 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
SizedBox( SizedBox(
width: 8, width: 8,
), ),
AppText( Expanded(
"${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)", child: AppText(
"${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
),
], ],
), ),
),
], ],
), ),
SizedBox( SizedBox(
@ -224,9 +231,9 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
false), false),
enabled: false, enabled: false,
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
keyboardType: TextInputType.text, keyboardType: TextInputType.multiline,
/*minLines: 4, minLines: 1,
maxLines: 6,*/ maxLines: 15,
)), )),
SizedBox( SizedBox(
height: 16, height: 16,
@ -356,7 +363,9 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
false), false),
enabled: true, enabled: true,
controller: _signsController, controller: _signsController,
keyboardType: TextInputType.text, keyboardType: TextInputType.multiline,
minLines: null,
maxLines: null,
)), )),
SizedBox( SizedBox(
height: 16, height: 16,

@ -14,7 +14,6 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
import 'admission-request_second-screen.dart';
class AdmissionRequestDetailScreen extends StatefulWidget { class AdmissionRequestDetailScreen extends StatefulWidget {
@override @override
@ -35,7 +34,7 @@ class _AdmissionRequestDetailScreenState
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
onModelReady: (model) => model.getMasterLookup(), onModelReady: (model) => model.getSpecialityList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
@ -178,6 +177,10 @@ class _AdmissionRequestDetailScreenState
list: model.doctorsList, list: model.doctorsList,
attributeName: 'DoctorName', attributeName: 'DoctorName',
attributeValueId: 'DoctorID', attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText:
TranslationBase.of(context)
.doctorSearch,
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
.ok, .ok,

@ -1,18 +1,24 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -33,15 +39,17 @@ class _AdmissionRequestSecondScreenState
bool _preAnesthesiaReferred = false; bool _preAnesthesiaReferred = false;
dynamic _selectedWard; dynamic _selectedWard;
dynamic _selectedAdmissionType; dynamic _selectedAdmissionType;
dynamic _selectedDiagnosis;
dynamic _selectedAllergies;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
// onModelReady: (model) => model.getMasterLookup(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
@ -179,40 +187,44 @@ class _AdmissionRequestSecondScreenState
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: onTap: model.wardList != null &&
/*model.doctorsList != null && model.wardList.length > 0
model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = openListDialogField('description',
ListSelectDialog( 'description', model.wardList,
list: model.doctorsList, (selectedValue) {
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedWard = selectedValue;
});
}); });
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} }
:*/ : () async {
null, await model.getWards();
if (model.state == ViewState.Idle &&
model.wardList.length > 0) {
openListDialogField('description',
'description', model.wardList,
(selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward, TranslationBase.of(context).ward,
/* _selectedWard != null _selectedWard != null
? _selectedWard['DoctorName'] ? _selectedWard['description']
:*/ : null,
null,
true), true),
enabled: false, enabled: false,
), ),
@ -238,41 +250,51 @@ class _AdmissionRequestSecondScreenState
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: onTap: model.admissionTypeList != null &&
/*model.doctorsList != null && model.admissionTypeList.length > 0
model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = openListDialogField('nameEn', 'id',
ListSelectDialog( model.admissionTypeList,
list: model.doctorsList, (selectedValue) {
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedAdmissionType =
selectedValue;
});
}); });
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} }
:*/ : () async {
null, await model.getMasterLookup(
MasterKeysService
.AdmissionRequestType);
if (model.state == ViewState.Idle &&
model.admissionTypeList.length >
0) {
openListDialogField('nameEn',
'id', model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.admissionType, .admissionType,
/* _admissionType != null _selectedAdmissionType != null
? _admissionType['DoctorName'] ? _selectedAdmissionType[
:*/ 'nameEn']
null, : null,
true), true),
enabled: false, enabled: false,
), ),
@ -284,41 +306,51 @@ class _AdmissionRequestSecondScreenState
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: onTap: model.diagnosisTypesList != null &&
/*model.doctorsList != null && model.diagnosisTypesList.length > 0
model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = openListDialogField('nameEn', 'id',
ListSelectDialog( model.diagnosisTypesList,
list: model.doctorsList, (selectedValue) {
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedDiagnosis =
selectedValue;
});
}); });
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} }
:*/ : () async {
null, await model.getDiagnosis();
if (model.state == ViewState.Idle &&
model.diagnosisTypesList
.length >
0) {
openListDialogField(
'nameEn',
'id',
model.diagnosisTypesList,
(selectedValue) {
setState(() {
_selectedDiagnosis =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.diagnosis, .diagnosis,
/* _admissionType != null _selectedDiagnosis != null
? _admissionType['DoctorName'] ? _selectedDiagnosis['nameEn']
:*/ : null,
null,
true), true),
enabled: false, enabled: false,
), ),
@ -347,41 +379,48 @@ class _AdmissionRequestSecondScreenState
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: onTap: model.allergiesList != null &&
/*model.doctorsList != null && model.allergiesList.length > 0
model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = openListDialogField('nameEn', 'id',
ListSelectDialog( model.allergiesList,
list: model.doctorsList, (selectedValue) {
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedAllergies =
selectedValue;
});
}); });
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} }
:*/ : () async {
null, await model.getAllergies();
if (model.state == ViewState.Idle &&
model.allergiesList.length >
0) {
openListDialogField('nameEn',
'id', model.allergiesList,
(selectedValue) {
setState(() {
_selectedAllergies =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.allergies, .allergies,
/* _admissionType != null _selectedAllergies != null
? _admissionType['DoctorName'] ? _selectedAllergies['nameEn']
:*/ : null,
null,
true), true),
enabled: false, enabled: false,
), ),
@ -426,4 +465,59 @@ class _AdmissionRequestSecondScreenState
updateDate(picked); updateDate(picked);
} }
} }
void openListDialogField(String attributeName, String attributeValueId,
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog(
list: list,
attributeName: attributeName,
attributeValueId: attributeValueId,
usingSearch: true,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
okFunction(selectedValue);
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
/*
onTap: model.wardList != null &&
model.wardList.length > 0
? () {
openListDialogField('description',
'description', model.wardList,
(selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
}
: () async {
await model.getWards();
if (model.state == ViewState.Idle &&
model.wardList.length > 0) {
openListDialogField('description',
'description', model.wardList,
(selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
*/
} }

@ -42,7 +42,8 @@ class MyReferralDetailScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.patientArrivalList != null body: model.patientArrivalList != null &&
model.patientArrivalList.length > 0
? Column( ? Column(
children: [ children: [
Expanded( Expanded(
@ -77,6 +78,7 @@ class MyReferralDetailScreen extends StatelessWidget {
), ),
), ),
PatientReferralItemWidget( PatientReferralItemWidget(
"${pendingReferral.patientID}",
patientName: pendingReferral.patientName, patientName: pendingReferral.patientName,
referralStatus: null, referralStatus: null,
isReferredTo: false, isReferredTo: false,
@ -86,6 +88,7 @@ class MyReferralDetailScreen extends StatelessWidget {
pendingReferral.referredByDoctorInfo, pendingReferral.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: pendingReferral.remarksFromSource, remark: pendingReferral.remarksFromSource,
referredOn: pendingReferral.referredOn,
), ),
SizedBox( SizedBox(
child: GridView.count( child: GridView.count(
@ -147,7 +150,8 @@ class MyReferralDetailScreen extends StatelessWidget {
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: () async { handler: () async {
await model.responseReferral(pendingReferral, true); await model.responseReferral(
pendingReferral, true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} }
@ -166,7 +170,8 @@ class MyReferralDetailScreen extends StatelessWidget {
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: () async { handler: () async {
await model.responseReferral(pendingReferral, true); await model.responseReferral(
pendingReferral, true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} }

@ -23,8 +23,7 @@ class MyReferralPatientScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.pendingReferral == null || body: model.pendingReferral == null || model.pendingReferral.length == 0
model.pendingReferral.length == 0
? Center( ? Center(
child: AppText( child: AppText(
TranslationBase.of(context).referralEmptyMsg, TranslationBase.of(context).referralEmptyMsg,
@ -62,6 +61,7 @@ class MyReferralPatientScreen extends StatelessWidget {
...List.generate( ...List.generate(
model.pendingReferral.length, model.pendingReferral.length,
(index) => PatientReferralItemWidget( (index) => PatientReferralItemWidget(
"${model.pendingReferral[index].patientID}",
patientName: model.pendingReferral[index].patientName, patientName: model.pendingReferral[index].patientName,
referralStatus: null, referralStatus: null,
isReferredTo: false, isReferredTo: false,
@ -72,11 +72,11 @@ class MyReferralPatientScreen extends StatelessWidget {
clinicDescription: null, clinicDescription: null,
remark: remark:
model.pendingReferral[index].remarksFromSource, model.pendingReferral[index].remarksFromSource,
referredOn: model.pendingReferral[index].referredOn,
infoIcon: InkWell( infoIcon: InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context)
MY_REFERRAL_DETAIL, .pushNamed(MY_REFERRAL_DETAIL, arguments: {
arguments: {
'referral': model.pendingReferral[index] 'referral': model.pendingReferral[index]
}); });
}, },

@ -1,26 +1,22 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../QR_reader_screen.dart';
class PatientMakeReferralScreen extends StatefulWidget { class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen // previous design page is: ReferPatientScreen
@override @override
@ -74,14 +70,14 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
if (model.state == ViewState.BusyLocal) /*if (model.state == ViewState.BusyLocal)
Container( Container(
color: Colors.white, color: Colors.white,
width: 50, width: 50,
height: 50, height: 50,
child: AppLoaderWidget( child: AppLoaderWidget(
containerColor: Colors.white, containerColor: Colors.white,
)), )),*/
Column( Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
@ -95,16 +91,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? ReferralForm(model, screenSize) ? ReferralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
"${model.patientReferral[0].patientID}",
patientName: model.patientReferral[0].patientName, patientName: model.patientReferral[0].patientName,
referralStatus: "${model.patientReferral[0].referralStatus}", referralStatus:
"${model.patientReferral[0].referralStatus}",
isReferredTo: true, isReferredTo: true,
isSameBranch: model.patientReferral[0] isSameBranch: model
.isReferralDoctorSameBranch, .patientReferral[0].isReferralDoctorSameBranch,
referralDoctorName: referralDoctorName:
model.patientReferral[0].referredByDoctorInfo, model.patientReferral[0].referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: remark: model.patientReferral[0].remarksFromSource,
model.patientReferral[0].remarksFromSource referredOn: model.patientReferral[0].referredOn,
), ),
], ],
), ),
@ -124,7 +122,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
.makeReferral( .makeReferral(
patient, patient,
appointmentDate.toIso8601String(), appointmentDate.toIso8601String(),
_selectedBranch['ID'], _selectedBranch['facilityId'],
_selectedClinic['ClinicID'], _selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'], _selectedDoctor['DoctorID'],
_remarksController.text) _remarksController.text)
@ -180,7 +178,12 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.getDoctorBranch().then((value) { model.getDoctorBranch().then((value) {
_selectedBranch = value; _selectedBranch = value;
if (_referTo['id'] == 1) { if (_referTo['id'] == 1) {
model.getClinics(_selectedBranch['ID']); GifLoaderDialogUtils.showMyDialog(context);
model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
} }
}); });
}); });
@ -196,7 +199,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).referTo, TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null, _referTo != null ? _referTo['name'] : null,
true), true),
@ -217,15 +220,19 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList, list: model.branchesList,
attributeName: 'Desciption', attributeName: 'facilityName',
attributeValueId: 'ID', attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedBranch = selectedValue; _selectedBranch = selectedValue;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
model.getClinics(_selectedBranch['ID']); GifLoaderDialogUtils.showMyDialog(context);
model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
}); });
}, },
); );
@ -239,10 +246,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).branch, TranslationBase.of(context).branch,
_selectedBranch != null _selectedBranch != null
? _selectedBranch['Desciption'] ? _selectedBranch['facilityName']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -263,13 +270,19 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
list: model.clinicsList, list: model.clinicsList,
attributeName: 'ClinicDescription', attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID', attributeValueId: 'ClinicID',
usingSearch: true,
hintSearchText: TranslationBase.of(context).clinicSearch,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
_selectedDoctor = null; _selectedDoctor = null;
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
model.getClinicDoctors( GifLoaderDialogUtils.showMyDialog(context);
_selectedClinic['ClinicID'].toString()); model
.getClinicDoctors(
_selectedClinic['ClinicID'].toString())
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
}); });
}, },
); );
@ -283,7 +296,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).clinic, TranslationBase.of(context).clinic,
_selectedClinic != null _selectedClinic != null
? _selectedClinic['ClinicDescription'] ? _selectedClinic['ClinicDescription']
@ -307,6 +320,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
list: model.doctorsList, list: model.doctorsList,
attributeName: 'DoctorName', attributeName: 'DoctorName',
attributeValueId: 'DoctorID', attributeValueId: 'DoctorID',
usingSearch: true,
hintSearchText: TranslationBase.of(context).doctorSearch,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -324,7 +339,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).doctor, TranslationBase.of(context).doctor,
_selectedDoctor != null _selectedDoctor != null
? _selectedDoctor['DoctorName'] ? _selectedDoctor['DoctorName']
@ -342,7 +357,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
child: InkWell( child: InkWell(
onTap: () => _selectDate(context, model), onTap: () => _selectDate(context, model),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).chooseAppointment, TranslationBase.of(context).chooseAppointment,
appointmentDate != null appointmentDate != null
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
@ -361,7 +376,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
), ),
Container( Container(
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).remarks, null, false), TranslationBase.of(context).remarks, null, false),
enabled: true, enabled: true,
controller: _remarksController, controller: _remarksController,
@ -440,49 +455,4 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
});*/ });*/
} }
} }
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -14,7 +15,7 @@ class ReferredPatientScreen extends StatelessWidget {
onModelReady: (model) => model.getMyReferredPatient(), onModelReady: (model) => model.getMyReferredPatient(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referredPatient,
body: model.listMyReferredPatientModel == null || body: model.listMyReferredPatientModel == null ||
model.listMyReferredPatientModel.length == 0 model.listMyReferredPatientModel.length == 0
? Center( ? Center(
@ -45,10 +46,11 @@ class ReferredPatientScreen extends StatelessWidget {
...List.generate( ...List.generate(
model.listMyReferredPatientModel.length, model.listMyReferredPatientModel.length,
(index) => PatientReferralItemWidget( (index) => PatientReferralItemWidget(
"${model.getReferredPatientItem(index).patientId}",
patientName: patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
referralStatus: referralStatus:
"${model.getReferredPatientItem(index).referralStatus}", "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}",
isReferredTo: true, isReferredTo: true,
isSameBranch: model isSameBranch: model
.getReferredPatientItem(index) .getReferredPatientItem(index)
@ -62,6 +64,12 @@ class ReferredPatientScreen extends StatelessWidget {
remark: model remark: model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referringDoctorRemarks, .referringDoctorRemarks,
referredOn: model
.getReferredPatientItem(index)
.referralDate !=
null
? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy")
: null,
), ),
), ),
], ],

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -9,13 +10,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class VitalSignDetailsScreen extends StatelessWidget { class VitalSignDetailsScreen extends StatelessWidget {
int appointmentNo; int appointmentNo;
int projectID; int projectID;
bool isNotOneAppointment; bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true});
VitalSignDetailsScreen(
{this.appointmentNo, this.projectID, this.isNotOneAppointment = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -26,7 +29,8 @@ class VitalSignDetailsScreen extends StatelessWidget {
String imageBasePath = 'assets/images/'; String imageBasePath = 'assets/images/';
return BaseView<VitalSignsViewModel>( return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to), onModelReady: (model) =>
model.getPatientVitalSignHistory(patient, from, to),
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: mode, baseViewModel: mode,
@ -38,16 +42,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () =>isNotOneAppointment? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Height, pageKey: vitalSignDetails.Height,
pageTitle: TranslationBase.of(context).height, pageTitle:
TranslationBase.of(context).height,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
):null, )
: null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).height, des: TranslationBase.of(context).height,
@ -58,16 +65,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Weight, pageKey: vitalSignDetails.Weight,
pageTitle: TranslationBase.of(context).weight, pageTitle:
TranslationBase.of(context).weight,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
):null, )
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).weight, des: TranslationBase.of(context).weight,
imagePath: "${imageBasePath}vital_weight.png", imagePath: "${imageBasePath}vital_weight.png",
@ -80,17 +90,20 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.BodyMeasurements, pageKey:
vitalSignDetails.BodyMeasurements,
pageTitle: TranslationBase.of(context) pageTitle: TranslationBase.of(context)
.bodyMeasurements, .bodyMeasurements,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
): null, )
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).body, des: TranslationBase.of(context).body,
imagePath: "${imageBasePath}vital_body_mass.png", imagePath: "${imageBasePath}vital_body_mass.png",
@ -99,21 +112,24 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Temperature, pageKey: vitalSignDetails.Temperature,
pageTitle: pageTitle: TranslationBase.of(context)
TranslationBase.of(context).temperature, .temperature,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
):null, )
: null,
child: Container( child: Container(
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).temperature, des: TranslationBase.of(context).temperature,
imagePath: "${imageBasePath}vital_temperature.png", imagePath:
"${imageBasePath}vital_temperature.png",
lastVal: mode.temperatureCelcius, lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context).tempC, unit: TranslationBase.of(context).tempC,
), ),
@ -124,16 +140,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.heart, pageKey: vitalSignDetails.heart,
pageTitle: TranslationBase.of(context).heart, pageTitle:
TranslationBase.of(context).heart,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
):null, )
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).heart, des: TranslationBase.of(context).heart,
imagePath: "${imageBasePath}vital_heart_rate.png", imagePath: "${imageBasePath}vital_heart_rate.png",
@ -142,17 +161,19 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
), ),
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.Respiration, pageKey: vitalSignDetails.Respiration,
pageTitle: pageTitle: TranslationBase.of(context)
TranslationBase.of(context).respirationRate, .respirationRate,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
):null, )
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).respirationRate, des: TranslationBase.of(context).respirationRate,
imagePath: "${imageBasePath}vital_respiration.png", imagePath: "${imageBasePath}vital_respiration.png",
@ -166,19 +187,23 @@ class VitalSignDetailsScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () => isNotOneAppointment ? Navigator.push( onTap: () => isNotOneAppointment
? Navigator.push(
context, context,
FadePage( FadePage(
page: VitalSignItemDetailsScreen( page: VitalSignItemDetailsScreen(
pageKey: vitalSignDetails.BloodPressure, pageKey: vitalSignDetails.BloodPressure,
pageTitle: TranslationBase.of(context).bloodPressure, pageTitle: TranslationBase.of(context)
.bloodPressure,
vitalList: mode.patientVitalSignsHistory, vitalList: mode.patientVitalSignsHistory,
), ),
), ),
):null, )
: null,
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).bloodPressure, des: TranslationBase.of(context).bloodPressure,
imagePath: "${imageBasePath}vital_blood-pressure.png", imagePath:
"${imageBasePath}vital_blood-pressure.png",
lastVal: mode.bloodPressure, lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias, unit: TranslationBase.of(context).sysDias,
), ),
@ -189,7 +214,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
), ),
) )
: Center( : Center(
child: AppText('No Data'), child: AppText(
TranslationBase.of(context).vitalSignEmptyMsg,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
), ),
), ),
); );

@ -127,13 +127,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic indication; dynamic indication;
dynamic units; dynamic units;
List<dynamic> strengthList;
List<dynamic> routeList;
List<dynamic> frequencyList;
List<dynamic> durationList;
List<dynamic> doseTimeList;
List<dynamic> indicationList; List<dynamic> indicationList;
List<dynamic> unitsList;
String routeInatial = 'By Mouth'; String routeInatial = 'By Mouth';
//PatiantInformtion patient; //PatiantInformtion patient;
@ -142,111 +136,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
super.initState(); super.initState();
selectedType = 1; selectedType = 1;
referToList = List(); referToList = List();
strengthList = List();
routeList = List();
frequencyList = List();
durationList = List();
doseTimeList = List();
indicationList = List();
unitsList = List();
dynamic unit1 = {"id": 1, "name": "MG"}; indicationList = List();
dynamic unit2 = {"id": 2, "name": "MCG"};
dynamic unit3 = {"id": 3, "name": "GM"};
dynamic regularOrder = {"id": 1, "name": "regular Order"};
dynamic urgentOrder = {"id": 2, "name": "urgent Order"};
dynamic strength1 = {"id": 1, "name": "1"};
dynamic strength2 = {"id": 2, "name": "2"};
dynamic strength3 = {"id": 3, "name": "3"};
dynamic strength4 = {"id": 4, "name": "4"};
dynamic strength5 = {"id": 5, "name": "5"};
dynamic strength6 = {"id": 6, "name": "6"};
dynamic strength7 = {"id": 7, "name": "7"};
dynamic strength8 = {"id": 8, "name": "8"};
dynamic strength9 = {"id": 9, "name": "9"};
dynamic route1 = {"id": 7, "name": "By Mouth"};
dynamic route2 = {"id": 10, "name": "Inhale by Mouth"};
dynamic route3 = {"id": 15, "name": "for INJECTION"};
dynamic route4 = {"id": 17, "name": "Drops"};
dynamic route5 = {"id": 18, "name": "Rub On"};
dynamic route6 = {"id": 20, "name": "Spary"};
dynamic route7 = {"id": 27, "name": "In Both EYES"};
dynamic route8 = {"id": 28, "name": "In Both Ears"};
dynamic route9 = {"id": 32, "name": "Intramuscular"};
dynamic route10 = {"id": 60, "name": "TRANSDERMAL"};
dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"};
dynamic route12 = {"id": 15, "name": "for INJECTION"};
dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"};
dynamic route14 = {"id": 57, "name": "NASOGASTRIC"};
dynamic route15 = {"id": 56, "name": "IRRIGATION"};
dynamic route16 = {"id": 55, "name": "INTRAVITREAL"};
dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"};
dynamic route18 = {"id": 51, "name": "EPIDURAL"};
dynamic route19 = {"id": 47, "name": "Parenteral"};
dynamic route20 = {"id": 43, "name": "IM"};
dynamic route21 = {"id": 42, "name": "IV"};
dynamic route22 = {"id": 41, "name": "Sublingual"};
dynamic route23 = {"id": 40, "name": "For Nebulization"};
dynamic route24 = {"id": 39, "name": "Nasal"};
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
dynamic frequency4 = {"id": 8, "name": "As Needed"};
dynamic frequency5 = {"id": 9, "name": "Bed Time"};
dynamic frequency6 = {"id": 11, "name": "Every Other Day"};
dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"};
dynamic frequency8 = {"id": 34, "name": "As Directed"};
dynamic frequency9 = {"id": 22, "name": "Once Per Month"};
dynamic frequency10 = {"id": 2, "name": "3 Times a day"};
dynamic frequency11 = {"id": 21, "name": "Every 3 hours"};
dynamic frequency12 = {"id": 20, "name": "Once a Week"};
dynamic frequency13 = {"id": 12, "name": "Every Half Hour"};
dynamic frequency14 = {"id": 10, "name": "4 Times a Day"};
dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"};
dynamic frequency16 = {"id": 25, "name": "Every One Hour"};
dynamic frequency17 = {"id": 26, "name": "Every Two Hours"};
dynamic frequency18 = {"id": 28, "name": "Every Six Hours"};
dynamic duration1 = {"id": 1, "name": "For 1 Day"};
dynamic duration2 = {"id": 2, "name": "For 2 Days"};
dynamic duration3 = {"id": 3, "name": "For 3 Days"};
dynamic duration4 = {"id": 4, "name": "For 4 Days"};
dynamic duration5 = {"id": 5, "name": "For 5 Days"};
dynamic duration6 = {"id": 6, "name": "For 6 Days"};
dynamic duration7 = {"id": 7, "name": "For 7 Days"};
dynamic duration8 = {"id": 8, "name": "For 8 Days"};
dynamic duration9 = {"id": 9, "name": "For 9 Days"};
dynamic duration10 = {"id": 10, "name": "For 10 Days"};
dynamic duration11 = {"id": 14, "name": "For 14 Days"};
dynamic duration12 = {"id": 21, "name": "For 21 Days"};
dynamic duration13 = {"id": 30, "name": "For 30 Days"};
dynamic duration14 = {"id": 45, "name": "For 45 Days"};
dynamic duration15 = {"id": 60, "name": "For 60 Days"};
dynamic duration16 = {"id": 90, "name": "For 90 Days"};
dynamic doseTime1 = {"id": 1, "name": "Before Meals"};
dynamic doseTime2 = {"id": 2, "name": "After Meals"};
dynamic doseTime3 = {"id": 3, "name": "With Meals"};
dynamic doseTime4 = {"id": 4, "name": "In The Morning"};
dynamic doseTime5 = {"id": 5, "name": "In the Evening"};
dynamic doseTime6 = {"id": 6, "name": "After Supper"};
dynamic doseTime7 = {"id": 7, "name": "With Supper"};
dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"};
dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"};
dynamic doseTime10 = {"id": 10, "name": "While wake"};
dynamic doseTime11 = {"id": 12, "name": "Any Time"};
dynamic doseTime12 = {"id": 21, "name": "Bed Time"};
dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"};
dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"};
dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"};
dynamic doseTime16 = {"id": 16, "name": "After Breakfast"};
dynamic doseTime17 = {"id": 17, "name": "Before Lunch"};
dynamic doseTime18 = {"id": 18, "name": "After Lunch"};
dynamic doseTime19 = {"id": 20, "name": "After Dinner"};
dynamic doseTime20 = {"id": 21, "name": "Bed Time"};
dynamic doseTime21 = {"id": 11, "name": "Now"};
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"};
@ -261,9 +153,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"};
dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"};
unitsList.add(unit1);
unitsList.add(unit2);
unitsList.add(unit3);
indicationList.add(indication1); indicationList.add(indication1);
indicationList.add(indication2); indicationList.add(indication2);
indicationList.add(indication3); indicationList.add(indication3);
@ -274,102 +163,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indicationList.add(indication8); indicationList.add(indication8);
indicationList.add(indication9); indicationList.add(indication9);
indicationList.add(indication10); indicationList.add(indication10);
doseTimeList.add(doseTime1);
doseTimeList.add(doseTime2);
doseTimeList.add(doseTime3);
doseTimeList.add(doseTime4);
doseTimeList.add(doseTime5);
doseTimeList.add(doseTime6);
doseTimeList.add(doseTime7);
doseTimeList.add(doseTime8);
doseTimeList.add(doseTime9);
doseTimeList.add(doseTime10);
doseTimeList.add(doseTime11);
doseTimeList.add(doseTime12);
doseTimeList.add(doseTime13);
doseTimeList.add(doseTime14);
doseTimeList.add(doseTime15);
doseTimeList.add(doseTime16);
doseTimeList.add(doseTime17);
doseTimeList.add(doseTime18);
doseTimeList.add(doseTime19);
doseTimeList.add(doseTime20);
doseTimeList.add(doseTime21);
doseTimeList.add(doseTime12);
frequencyList.add(frequency1);
frequencyList.add(frequency2);
frequencyList.add(frequency3);
frequencyList.add(frequency4);
frequencyList.add(frequency5);
frequencyList.add(frequency6);
frequencyList.add(frequency7);
frequencyList.add(frequency8);
frequencyList.add(frequency9);
frequencyList.add(frequency10);
frequencyList.add(frequency11);
frequencyList.add(frequency12);
frequencyList.add(frequency13);
frequencyList.add(frequency14);
frequencyList.add(frequency15);
frequencyList.add(frequency16);
frequencyList.add(frequency17);
frequencyList.add(frequency18);
routeList.add(route1);
routeList.add(route2);
routeList.add(route3);
routeList.add(route4);
routeList.add(route5);
routeList.add(route6);
routeList.add(route7);
routeList.add(route8);
routeList.add(route9);
routeList.add(route10);
routeList.add(route11);
routeList.add(route12);
routeList.add(route13);
routeList.add(route14);
routeList.add(route15);
routeList.add(route16);
routeList.add(route17);
routeList.add(route18);
routeList.add(route19);
routeList.add(route20);
routeList.add(route21);
routeList.add(route22);
routeList.add(route23);
routeList.add(route24);
routeList.add(route25);
routeList.add(route26);
routeList.add(route27);
strengthList.add(strength1);
strengthList.add(strength2);
strengthList.add(strength3);
strengthList.add(strength4);
strengthList.add(strength5);
strengthList.add(strength6);
strengthList.add(strength7);
strengthList.add(strength8);
strengthList.add(strength9);
durationList.add(duration1);
durationList.add(duration2);
durationList.add(duration3);
durationList.add(duration4);
durationList.add(duration5);
durationList.add(duration6);
durationList.add(duration7);
durationList.add(duration8);
durationList.add(duration9);
durationList.add(duration10);
durationList.add(duration11);
durationList.add(duration12);
durationList.add(duration13);
durationList.add(duration14);
durationList.add(duration15);
durationList.add(duration16);
referToList.add(regularOrder);
referToList.add(urgentOrder);
} }
setSelectedType(int val) { setSelectedType(int val) {
@ -388,6 +181,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getMedicationList(); await model.getMedicationList();
await model.getMedicationStrength();
await model.getMedicationDuration();
await model.getMedicationRoute();
await model.getMedicationFrequency();
await model.getMedicationDoseTime();
await model.getMedicationIndications();
}, },
builder: (BuildContext context, MedicineViewModel model, Widget child) => builder: (BuildContext context, MedicineViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
@ -564,12 +363,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.350, 0.350,
child: InkWell( child: InkWell(
onTap: unitsList != null onTap: model.medicationStrengthList !=
null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: unitsList, list: model
attributeName: 'name', .medicationStrengthList,
attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: TranslationBase.of( okText: TranslationBase.of(
context) context)
@ -596,7 +397,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
textFieldSelectorDecoration( textFieldSelectorDecoration(
'UNIT Type', 'UNIT Type',
units != null units != null
? units['name'] ? units['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -610,12 +411,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: routeList != null onTap: model.medicationRouteList != null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: routeList, list: model.medicationRouteList,
attributeName: 'name', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -642,7 +443,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route, TranslationBase.of(context).route,
route != null ? route['name'] : null, route != null
? route['nameEn']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -652,12 +455,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: frequencyList != null onTap: model.medicationFrequencyList != null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: frequencyList, list:
attributeName: 'name', model.medicationFrequencyList,
attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -681,7 +485,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).frequency, TranslationBase.of(context).frequency,
frequency != null frequency != null
? frequency['name'] ? frequency['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -692,12 +496,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: doseTimeList != null onTap: model.medicationDoseTimeList != null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: doseTimeList, list:
attributeName: 'name', model.medicationDoseTimeList,
attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -721,7 +526,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doseTime, TranslationBase.of(context).doseTime,
doseTime != null doseTime != null
? doseTime['name'] ? doseTime['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -795,12 +600,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: durationList != null onTap: model.medicationDurationList != null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: durationList, list:
attributeName: 'name', model.medicationDurationList,
attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -824,7 +630,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).duration, TranslationBase.of(context).duration,
duration != null duration != null
? duration['name'] ? duration['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,

@ -1,29 +1,15 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
class NewPrescriptionScreen extends StatefulWidget { class NewPrescriptionScreen extends StatefulWidget {
@override @override
@ -37,198 +23,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
int testNum = 0; int testNum = 0;
int strengthChar; int strengthChar;
PatiantInformtion patient; PatiantInformtion patient;
dynamic route;
dynamic doseTime;
dynamic frequencyUpdate;
dynamic updatedDuration;
dynamic units;
List<dynamic> doseTimeList;
List<dynamic> routeList;
List<dynamic> frequencyList;
List<dynamic> durationList;
List<dynamic> unitsList;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
routeList = List();
doseTimeList = List();
frequencyList = List();
durationList = List();
unitsList = List();
dynamic unit1 = {"id": 1, "name": "MG"};
dynamic unit2 = {"id": 2, "name": "MCG"};
dynamic unit3 = {"id": 3, "name": "GM"};
dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
dynamic frequency4 = {"id": 8, "name": "As Needed"};
dynamic frequency5 = {"id": 9, "name": "Bed Time"};
dynamic frequency6 = {"id": 11, "name": "Every Other Day"};
dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"};
dynamic frequency8 = {"id": 34, "name": "As Directed"};
dynamic frequency9 = {"id": 22, "name": "Once Per Month"};
dynamic frequency10 = {"id": 2, "name": "3 Times a day"};
dynamic frequency11 = {"id": 21, "name": "Every 3 hours"};
dynamic frequency12 = {"id": 20, "name": "Once a Week"};
dynamic frequency13 = {"id": 12, "name": "Every Half Hour"};
dynamic frequency14 = {"id": 10, "name": "4 Times a Day"};
dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"};
dynamic frequency16 = {"id": 25, "name": "Every One Hour"};
dynamic frequency17 = {"id": 26, "name": "Every Two Hours"};
dynamic frequency18 = {"id": 28, "name": "Every Six Hours"};
dynamic doseTime1 = {"id": 1, "name": "Before Meals"};
dynamic doseTime2 = {"id": 2, "name": "After Meals"};
dynamic doseTime3 = {"id": 3, "name": "With Meals"};
dynamic doseTime4 = {"id": 4, "name": "In The Morning"};
dynamic doseTime5 = {"id": 5, "name": "In the Evening"};
dynamic doseTime6 = {"id": 6, "name": "After Supper"};
dynamic doseTime7 = {"id": 7, "name": "With Supper"};
dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"};
dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"};
dynamic doseTime10 = {"id": 10, "name": "While wake"};
dynamic doseTime11 = {"id": 12, "name": "Any Time"};
dynamic doseTime12 = {"id": 21, "name": "Bed Time"};
dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"};
dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"};
dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"};
dynamic doseTime16 = {"id": 16, "name": "After Breakfast"};
dynamic doseTime17 = {"id": 17, "name": "Before Lunch"};
dynamic doseTime18 = {"id": 18, "name": "After Lunch"};
dynamic doseTime19 = {"id": 20, "name": "After Dinner"};
dynamic doseTime20 = {"id": 21, "name": "Bed Time"};
dynamic doseTime21 = {"id": 11, "name": "Now"};
dynamic route1 = {"id": 7, "name": "By Mouth"};
dynamic route2 = {"id": 10, "name": "Inhale by Mouth"};
dynamic route3 = {"id": 15, "name": "for INJECTION"};
dynamic route4 = {"id": 17, "name": "Drops"};
dynamic route5 = {"id": 18, "name": "Rub On"};
dynamic route6 = {"id": 20, "name": "Spary"};
dynamic route7 = {"id": 27, "name": "In Both EYES"};
dynamic route8 = {"id": 28, "name": "In Both Ears"};
dynamic route9 = {"id": 32, "name": "Intramuscular"};
dynamic route10 = {"id": 60, "name": "TRANSDERMAL"};
dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"};
dynamic route12 = {"id": 15, "name": "for INJECTION"};
dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"};
dynamic route14 = {"id": 57, "name": "NASOGASTRIC"};
dynamic route15 = {"id": 56, "name": "IRRIGATION"};
dynamic route16 = {"id": 55, "name": "INTRAVITREAL"};
dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"};
dynamic route18 = {"id": 51, "name": "EPIDURAL"};
dynamic route19 = {"id": 47, "name": "Parenteral"};
dynamic route20 = {"id": 43, "name": "IM"};
dynamic route21 = {"id": 42, "name": "IV"};
dynamic route22 = {"id": 41, "name": "Sublingual"};
dynamic route23 = {"id": 40, "name": "For Nebulization"};
dynamic route24 = {"id": 39, "name": "Nasal"};
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
dynamic duration1 = {"id": 1, "name": "For 1 Day"};
dynamic duration2 = {"id": 2, "name": "For 2 Days"};
dynamic duration3 = {"id": 3, "name": "For 3 Days"};
dynamic duration4 = {"id": 4, "name": "For 4 Days"};
dynamic duration5 = {"id": 5, "name": "For 5 Days"};
dynamic duration6 = {"id": 6, "name": "For 6 Days"};
dynamic duration7 = {"id": 7, "name": "For 7 Days"};
dynamic duration8 = {"id": 8, "name": "For 8 Days"};
dynamic duration9 = {"id": 9, "name": "For 9 Days"};
dynamic duration10 = {"id": 10, "name": "For 10 Days"};
dynamic duration11 = {"id": 14, "name": "For 14 Days"};
dynamic duration12 = {"id": 21, "name": "For 21 Days"};
dynamic duration13 = {"id": 30, "name": "For 30 Days"};
dynamic duration14 = {"id": 45, "name": "For 45 Days"};
dynamic duration15 = {"id": 60, "name": "For 60 Days"};
dynamic duration16 = {"id": 90, "name": "For 90 Days"};
durationList.add(duration1);
durationList.add(duration2);
durationList.add(duration3);
durationList.add(duration4);
durationList.add(duration5);
durationList.add(duration6);
durationList.add(duration7);
durationList.add(duration8);
durationList.add(duration9);
durationList.add(duration10);
durationList.add(duration11);
durationList.add(duration12);
durationList.add(duration13);
durationList.add(duration14);
durationList.add(duration15);
durationList.add(duration16);
frequencyList.add(frequency1);
frequencyList.add(frequency2);
frequencyList.add(frequency3);
frequencyList.add(frequency4);
frequencyList.add(frequency5);
frequencyList.add(frequency6);
frequencyList.add(frequency7);
frequencyList.add(frequency8);
frequencyList.add(frequency9);
frequencyList.add(frequency10);
frequencyList.add(frequency11);
frequencyList.add(frequency12);
frequencyList.add(frequency13);
frequencyList.add(frequency14);
frequencyList.add(frequency15);
frequencyList.add(frequency16);
frequencyList.add(frequency17);
frequencyList.add(frequency18);
doseTimeList.add(doseTime1);
doseTimeList.add(doseTime2);
doseTimeList.add(doseTime3);
doseTimeList.add(doseTime4);
doseTimeList.add(doseTime5);
doseTimeList.add(doseTime6);
doseTimeList.add(doseTime7);
doseTimeList.add(doseTime8);
doseTimeList.add(doseTime9);
doseTimeList.add(doseTime10);
doseTimeList.add(doseTime11);
doseTimeList.add(doseTime12);
doseTimeList.add(doseTime13);
doseTimeList.add(doseTime14);
doseTimeList.add(doseTime15);
doseTimeList.add(doseTime16);
doseTimeList.add(doseTime17);
doseTimeList.add(doseTime18);
doseTimeList.add(doseTime19);
doseTimeList.add(doseTime20);
doseTimeList.add(doseTime21);
routeList.add(route1);
routeList.add(route2);
routeList.add(route3);
routeList.add(route4);
routeList.add(route5);
routeList.add(route6);
routeList.add(route7);
routeList.add(route8);
routeList.add(route9);
routeList.add(route10);
routeList.add(route11);
routeList.add(route12);
routeList.add(route13);
routeList.add(route14);
routeList.add(route15);
routeList.add(route16);
routeList.add(route17);
routeList.add(route18);
routeList.add(route19);
routeList.add(route20);
routeList.add(route21);
routeList.add(route22);
routeList.add(route23);
routeList.add(route24);
routeList.add(route25);
routeList.add(route26);
routeList.add(route27);
unitsList.add(unit1);
unitsList.add(unit2);
unitsList.add(unit3);
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -248,61 +46,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
Padding( PatientPageHeaderWidget(patient),
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
patient.firstName +
' ' +
patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
//if (model.prescriptionList.length > 0)
Row(
children: [
AppText(
TranslationBase.of(context).age2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Divider( Divider(
height: 1.0, height: 1.0,
thickness: 1.0, thickness: 1.0,
@ -435,7 +179,6 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
model.prescriptionList[0] model.prescriptionList[0]
.rowcount, .rowcount,
(index) => Container( (index) => Container(
//height: 240,
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -489,7 +232,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.295, 0.3019,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -612,6 +355,14 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
Row( Row(
children: [ children: [
AppText(
TranslationBase.of(context)
.doctorName +
": ",
fontWeight:
FontWeight
.w600,
),
Expanded( Expanded(
child: child:
AppText( AppText(
@ -818,511 +569,4 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
}); });
} }
} }
void updatePrescriptionForm(
{context,
String drugName,
int drugId,
String remarks,
PrescriptionViewModel model,
PatiantInformtion patient,
String rouat,
String frequency,
String dose,
String duration,
String doseStreangth,
String doseUnit,
String enteredRemarks,
String startDate}) {
TextEditingController remarksController = TextEditingController();
TextEditingController doseController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
TextEditingController routeController = TextEditingController();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return StatefulBuilder(builder: (BuildContext context,
StateSetter setState /*You can rename this!*/) {
return DraggableScrollableSheet(
initialChildSize: 0.90,
maxChildSize: 0.90,
minChildSize: 0.6,
builder:
(BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.0,
child: Form(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.0, vertical: 12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
drugName.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 10.0,
),
Column(
children: [
Container(
height: MediaQuery.of(context).size.height *
0.070,
width: double.infinity,
child: Row(
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.550,
child: TextFields(
inputFormatters: [
LengthLimitingTextInputFormatter(
4)
],
hintText:
TranslationBase.of(context)
.strength,
controller: strengthController,
keyboardType: TextInputType.number,
onChanged: (String value) {
setState(() {
strengthChar = value.length;
});
if (strengthChar >= 4) {
DrAppToastMsg.showErrorToast(
"Only 4 Digits allowed for strength");
}
},
// validator: (value) {
// if (value.isEmpty &&
// strengthController.text.length >
// 4)
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
),
),
SizedBox(
width: 10.0,
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.3200,
child: InkWell(
onTap: unitsList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: unitsList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
units = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
'UNIT Type',
units != null
? units['name']
: null,
true),
enabled: false,
),
),
),
],
),
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: routeList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: routeList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
route = selectedValue;
});
if (route == null) {
route = route['id'];
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route,
route != null
? route['name']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: doseTimeList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: doseTimeList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
doseTime = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.doseTime,
doseTime != null
? doseTime['name']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: frequencyList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: frequencyList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
frequencyUpdate =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.frequency,
frequencyUpdate != null
? frequencyUpdate['name']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: durationList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: durationList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
updatedDuration =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.duration,
updatedDuration != null
? updatedDuration['name']
.toString()
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: remarks,
controller: remarksController,
maxLines: 7,
minLines: 4,
),
),
SizedBox(
height: 12.0,
),
SizedBox(
height: MediaQuery.of(context).size.height *
0.12,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'update prescription'
.toUpperCase(),
onPressed: () {
updatePrescription(
newDoseStreangth:
strengthController
.text.isNotEmpty
? strengthController
.text
: doseStreangth,
newUnit: units != null
? units['id'].toString()
: doseUnit,
doseUnit: doseUnit,
doseStreangth: doseStreangth,
duration: duration,
startDate: startDate,
doseId: dose,
frequencyId: frequency,
routeId: rouat,
patient: patient,
model: model,
newDuration: updatedDuration !=
null
? updatedDuration['id']
.toString()
: duration,
drugId: drugId,
remarks: remarksController.text,
route: route != null
? route['id'].toString()
: rouat,
frequency: frequencyUpdate != null
? frequencyUpdate['id']
.toString()
: frequency,
dose: doseTime != null
? doseTime['id'].toString()
: dose,
enteredRemarks: enteredRemarks);
Navigator.pop(context);
},
),
],
),
),
],
),
],
),
),
));
});
});
});
}
updatePrescription(
{PrescriptionViewModel model,
int drugId,
String frequencyId,
String remarks,
String dose,
String doseId,
String frequency,
String route,
String routeId,
String startDate,
String doseUnit,
String doseStreangth,
String newDoseStreangth,
String duration,
String newDuration,
String newUnit,
String enteredRemarks,
PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel();
PostPrescriptionReqModel updatePrescriptionReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List();
updatePrescriptionReqModel.appointmentNo = patient.appointmentNo;
updatePrescriptionReqModel.clinicID = patient.clinicId;
updatePrescriptionReqModel.episodeID = patient.episodeNo;
updatePrescriptionReqModel.patientMRN = patient.patientMRN;
sss.add(PrescriptionRequestModel(
covered: true,
dose: newDoseStreangth.isNotEmpty
? int.parse(newDoseStreangth)
: int.parse(
doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId,
doseUnitId:
newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit),
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
frequency: frequency.isNotEmpty
? int.parse(frequency)
: int.parse(frequencyId),
remarks: remarks.isEmpty ? enteredRemarks : remarks,
approvalRequired: true,
icdcode10Id: "test2",
doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
duration: newDuration.isNotEmpty
? int.parse(newDuration)
: int.parse(duration),
doseStartDate: startDate));
updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure;
await model.updatePrescription(
updatePrescriptionReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('Medication has been updated');
}
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
} }

@ -0,0 +1,624 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
class UpdatePrescriptionForm extends StatefulWidget {
final String drugName;
final String doseStreangth;
final int drugId;
final String remarks;
final PatiantInformtion patient;
final String duration;
final String route;
final String dose;
final String doseUnit;
final String enteredRemarks;
final String startDate;
final String frequency;
final PrescriptionViewModel model;
UpdatePrescriptionForm(
{this.drugName,
this.doseStreangth,
this.drugId,
this.remarks,
this.patient,
this.duration,
this.route,
this.dose,
this.startDate,
this.doseUnit,
this.enteredRemarks,
this.frequency,
this.model});
@override
_UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState();
}
class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
TextEditingController strengthController = TextEditingController();
TextEditingController remarksController = TextEditingController();
int testNum = 0;
int strengthChar;
PatiantInformtion patient;
dynamic route;
dynamic doseTime;
dynamic frequencyUpdate;
dynamic updatedDuration;
dynamic units;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return StatefulBuilder(builder:
(BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<MedicineViewModel>(
onModelReady: (model) async {
await model.getMedicationList();
await model.getMedicationStrength();
await model.getMedicationDuration();
await model.getMedicationRoute();
await model.getMedicationFrequency();
await model.getMedicationDoseTime();
await model.getMedicationIndications();
route = model.getLookupById(model.medicationRouteList, widget.route);
doseTime =
model.getLookupById(model.medicationDoseTimeList, widget.dose);
updatedDuration = model.getLookupById(
model.medicationDurationList, widget.duration);
units = model.getLookupById(
model.medicationStrengthList, widget.doseUnit);
frequencyUpdate = model.getLookupById(
model.medicationFrequencyList, widget.frequency);
},
builder:
(BuildContext context, MedicineViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
initialChildSize: 0.90,
maxChildSize: 0.90,
minChildSize: 0.6,
builder:
(BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.0,
child: Form(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.0, vertical: 12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
widget.drugName.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 10.0,
),
Column(
children: [
Container(
height: MediaQuery.of(context).size.height *
0.060,
width: double.infinity,
child: Row(
children: [
Container(
width:
MediaQuery.of(context).size.width *
0.500,
child: TextFields(
inputFormatters: [
LengthLimitingTextInputFormatter(4)
],
hintText: TranslationBase.of(context)
.strength,
controller: strengthController,
keyboardType: TextInputType.number,
onChanged: (String value) {
setState(() {
strengthChar = value.length;
});
if (strengthChar >= 4) {
DrAppToastMsg.showErrorToast(
"Only 4 Digits allowed for strength");
}
},
// validator: (value) {
// if (value.isEmpty &&
// strengthController.text.length >
// 4)
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
),
),
SizedBox(
width: 10.0,
),
Container(
width:
MediaQuery.of(context).size.width *
0.3700,
child: InkWell(
onTap: model.medicationStrengthList !=
null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model
.medicationStrengthList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText: TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
units = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
'UNIT Type',
units != null
? units['nameEn']
: null,
true),
enabled: false,
),
),
),
],
),
),
SizedBox(
height: 12,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: model.medicationRouteList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.medicationRouteList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
route = selectedValue;
});
if (route == null) {
route = route['id'];
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
'Route',
route != null
? route['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: model.medicationDoseTimeList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list:
model.medicationDoseTimeList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
doseTime = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doseTime,
doseTime != null
? doseTime['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: model.medicationFrequencyList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list:
model.medicationFrequencyList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
frequencyUpdate =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).frequency,
frequencyUpdate != null
? frequencyUpdate['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: model.medicationDurationList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list:
model.medicationDurationList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
updatedDuration =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).duration,
updatedDuration != null
? updatedDuration['nameEn']
.toString()
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
controller: remarksController,
maxLines: 7,
minLines: 4,
),
),
SizedBox(
height: 12.0,
),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.12,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title:
'update prescription'.toUpperCase(),
onPressed: () {
updatePrescription(
newDoseStreangth:
strengthController
.text.isNotEmpty
? strengthController.text
: widget.doseStreangth,
newUnit: units !=
null
? units['id'].toString()
: widget.doseUnit,
doseUnit: widget.doseUnit,
doseStreangth: widget
.doseStreangth,
duration: widget.duration,
startDate: widget.startDate,
doseId: widget.dose,
frequencyId: widget.frequency,
routeId: widget.route,
patient: widget.patient,
model: widget.model,
newDuration:
updatedDuration !=
null
? updatedDuration[
'id']
.toString()
: widget.duration,
drugId: widget.drugId,
remarks: remarksController.text,
route: route !=
null
? route['id'].toString()
: widget.route,
frequency:
frequencyUpdate !=
null
? frequencyUpdate['id']
.toString()
: widget.frequency,
dose: doseTime != null
? doseTime['id'].toString()
: widget.dose,
enteredRemarks:
widget.enteredRemarks);
Navigator.pop(context);
},
),
],
),
),
],
),
],
),
),
));
}),
),
);
});
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
updatePrescription(
{PrescriptionViewModel model,
int drugId,
String frequencyId,
String remarks,
String dose,
String doseId,
String frequency,
String route,
String routeId,
String startDate,
String doseUnit,
String doseStreangth,
String newDoseStreangth,
String duration,
String newDuration,
String newUnit,
String enteredRemarks,
PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel();
PostPrescriptionReqModel updatePrescriptionReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List();
updatePrescriptionReqModel.appointmentNo = patient.appointmentNo;
updatePrescriptionReqModel.clinicID = patient.clinicId;
updatePrescriptionReqModel.episodeID = patient.episodeNo;
updatePrescriptionReqModel.patientMRN = patient.patientMRN;
sss.add(PrescriptionRequestModel(
covered: true,
dose: newDoseStreangth.isNotEmpty
? int.parse(newDoseStreangth)
: int.parse(doseStreangth),
//frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId,
doseUnitId:
newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit),
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
frequency: frequency.isNotEmpty
? int.parse(frequency)
: int.parse(frequencyId),
remarks: remarks.isEmpty ? enteredRemarks : remarks,
approvalRequired: true,
icdcode10Id: "test2",
doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
duration: newDuration.isNotEmpty
? int.parse(newDuration)
: int.parse(duration),
doseStartDate: startDate));
updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure;
await model.updatePrescription(
updatePrescriptionReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('Medication has been updated');
}
}
}
void updatePrescriptionForm(
{context,
String drugName,
int drugId,
String remarks,
PrescriptionViewModel model,
PatiantInformtion patient,
String rouat,
String frequency,
String dose,
String duration,
String doseStreangth,
String doseUnit,
String enteredRemarks,
String startDate}) {
TextEditingController remarksController = TextEditingController();
TextEditingController doseController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
TextEditingController routeController = TextEditingController();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return UpdatePrescriptionForm(
drugName: drugName,
patient: patient,
doseStreangth: doseStreangth,
remarks: remarks,
drugId: drugId,
enteredRemarks: enteredRemarks,
duration: duration,
dose: dose,
doseUnit: doseUnit,
frequency: frequency,
route: rouat,
startDate: startDate,
model: model,
);
});
}

@ -0,0 +1,323 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
postProcedure(
{ProcedureViewModel model,
String remarks,
String orderType,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List();
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
);
controls.add(
Controls(
code: "ordertype",
controlValue:
orderType.toString().isNotEmpty ? orderType.toString() : '1'),
);
});
entityList.forEach((element) {
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
}
void addSelectedProcedure(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedProcedure(
model: model,
patient: patient,
);
});
}
class AddSelectedProcedure extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedProcedure({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedProcedureState createState() =>
_AddSelectedProcedureState(patient: patient, model: model);
}
class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedProcedureState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.selectProcedures
.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 10.0,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.categoryList != null &&
model.categoryList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.categoryList,
attributeName: 'categoryName',
attributeValueId: 'categoryId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedCategory = selectedValue;
model.getProcedureCategory(
categoryName: selectedCategory[
'categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
),
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
),
),
SizedBox(
height: 15.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Row(
children: [
AppText(
TranslationBase.of(context).orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 1,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 0,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
],
),
),
SizedBox(
height: 15.0,
),
TextFields(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 3,
maxLines: 5,
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addSelectedProcedures,
onPressed: () {
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
)
],
),
),
),
);
}),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
@ -71,21 +72,23 @@ class _EntityListCheckboxSearchWidgetState
SizedBox( SizedBox(
height: 15, height: 15,
), ),
Column( items.length != 0
? Column(
children: items.map((historyInfo) { children: items.map((historyInfo) {
return Column( return Column(
children: [ children: [
Row( Row(
children: [ children: [
Checkbox( Checkbox(
value: widget value: widget.isEntityListSelected(
.isEntityListSelected(historyInfo), historyInfo),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool newValue) {
setState(() { setState(() {
if (widget.isEntityListSelected( if (widget.isEntityListSelected(
historyInfo)) { historyInfo)) {
widget.removeHistory(historyInfo); widget
.removeHistory(historyInfo);
} else { } else {
widget.addHistory(historyInfo); widget.addHistory(historyInfo);
} }
@ -95,7 +98,8 @@ class _EntityListCheckboxSearchWidgetState
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: Texts(historyInfo.procedureName, child: Texts(
historyInfo.procedureName,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,
color: Colors.black), color: Colors.black),
@ -107,7 +111,14 @@ class _EntityListCheckboxSearchWidgetState
], ],
); );
}).toList(), }).toList(),
)
: Center(
child: Container(
child: AppText(
"There's no procedures for this category",
color: Color(0xFFB9382C)),
), ),
)
], ],
), ),
)), )),

@ -1,29 +1,15 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.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/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class ProcedureScreen extends StatefulWidget { class ProcedureScreen extends StatefulWidget {
@override @override
@ -58,57 +44,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
Padding( PatientPageHeaderWidget(patient),
padding: EdgeInsets.all(12.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context).age2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Divider( Divider(
height: 1.0, height: 1.0,
thickness: 1.0, thickness: 1.0,
@ -320,7 +256,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
context) context)
.size .size
.height * .height *
0.2, 0.21,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -376,6 +312,30 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
), ),
], ],
), ),
Row(
children: [
AppText(
'Order.NO' +
" : ",
fontWeight:
FontWeight
.w700,
fontSize:
15.0,
),
AppText(
model
.procedureList[
0]
.entityList[
index]
.orderNo
.toString(),
fontSize:
13.0,
),
],
),
Row( Row(
children: [ children: [
Container( Container(
@ -438,11 +398,10 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
0.10, 0.10,
child: child:
AppText( AppText(
model model.procedureList[0].entityList[index].remarks !=
.procedureList[0] null
.entityList[index] ? model.procedureList[0].entityList[index].remarks.toString()
.remarks : "",
.toString(),
fontSize: fontSize:
11.5, 11.5,
), ),
@ -581,445 +540,4 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
)), )),
); );
} }
void updateProcedureForm(context,
{String procedureName,
PatiantInformtion patient,
String procedureId,
String remarks,
String categoreId}) {
ProcedureViewModel model = ProcedureViewModel();
TextEditingController remarksController = TextEditingController();
TextEditingController orderController = TextEditingController();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return Container(
height: MediaQuery.of(context).size.height * 0.55,
child: Form(
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
procedureName.toUpperCase(),
fontWeight: FontWeight.w700,
),
SizedBox(
height: 30.0,
),
Container(
child: Row(
children: [
AppText(TranslationBase.of(context).orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
],
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: remarks,
controller: remarksController,
maxLines: 5,
minLines: 3,
),
),
SizedBox(
height: 100.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
categorieId: categoreId,
procedureId: procedureId,
patient: patient,
model: model,
remarks: remarksController.text);
// authorizationForm(context);
},
),
],
),
),
],
),
),
));
});
}
}
postProcedure(
{ProcedureViewModel model,
String remarks,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List();
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
);
});
entityList.forEach((element) {
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
}
updateProcedure(
{ProcedureViewModel model,
String remarks,
String procedureId,
PatiantInformtion patient,
String categorieId}) async {
UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel();
List<Controls> controls = List();
ProcedureDetail controlsProcedure = new ProcedureDetail();
updateProcedureReqModel.appointmentNo = patient.appointmentNo;
updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = 0;
controls.add(
Controls(code: "02", controlValue: remarks.isEmpty ? '' : remarks),
);
controlsProcedure.procedure = procedureId;
controlsProcedure.category = categorieId;
controlsProcedure.controls = controls;
// controlsProcedure.add(ProcedureDetail(
// category: categorieId, procedure: procedureId, controls: controls));
updateProcedureReqModel.procedureDetail = controlsProcedure;
await model.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated');
}
}
void addSelectedProcedure(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedProcedure(
model: model,
patient: patient,
);
});
}
class AddSelectedProcedure extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedProcedure({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedProcedureState createState() =>
_AddSelectedProcedureState(patient: patient, model: model);
}
class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedProcedureState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.selectProcedures
.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 10.0,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.categoryList != null &&
model.categoryList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.categoryList,
attributeName: 'categoryName',
attributeValueId: 'categoryId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedCategory = selectedValue;
model.getProcedureCategory(
categoryName: selectedCategory[
'categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
),
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
),
),
SizedBox(
height: 15.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Row(
children: [
AppText(
TranslationBase.of(context).orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
],
),
),
SizedBox(
height: 15.0,
),
TextFields(
hintText: TranslationBase.of(context).remarks,
controller: remarksController,
minLines: 3,
maxLines: 5,
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addSelectedProcedures,
onPressed: () {
Navigator.pop(context);
postProcedure(
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
)
],
),
),
),
);
}),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
} }

@ -0,0 +1,347 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
void updateProcedureForm(context,
{String procedureName,
PatiantInformtion patient,
String orderType,
String procedureId,
String remarks,
String categoreId}) {
ProcedureViewModel model = ProcedureViewModel();
TextEditingController remarksController = TextEditingController();
TextEditingController orderController = TextEditingController();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return UpdateProcedureWidget(
procedureName: procedureName,
remarks: remarks,
remarksController: remarksController,
patient: patient,
model: model,
procedureId: procedureId,
categoryId: categoreId,
);
});
}
class UpdateProcedureWidget extends StatefulWidget {
final PatiantInformtion patient;
final ProcedureViewModel model;
final String procedureName;
final String remarks;
final TextEditingController remarksController;
final String procedureId;
final String categoryId;
UpdateProcedureWidget(
{this.model,
this.procedureName,
this.remarks,
this.remarksController,
this.patient,
this.procedureId,
this.categoryId});
@override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
}
class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
int selectedType = 0;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
List<EntityList> entityList = List();
dynamic selectedCategory;
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return StatefulBuilder(builder:
(BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(),
builder:
(BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: Container(
height: MediaQuery.of(context).size.height * 0.95,
child: Form(
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
widget.procedureName.toUpperCase(),
fontWeight: FontWeight.w700,
),
SizedBox(
height: 30.0,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.categoryList != null &&
model.categoryList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.categoryList,
attributeName: 'categoryName',
attributeValueId: 'categoryId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedCategory = selectedValue;
model.getProcedureCategory(
categoryName: selectedCategory[
'categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
),
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
),
),
Container(
child: Row(
children: [
AppText(TranslationBase.of(context).orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
],
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
controller: widget.remarksController,
maxLines: 5,
minLines: 3,
),
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
orderType: selectedType.toString(),
categorieId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks: widget.remarksController.text);
// authorizationForm(context);
},
),
],
),
),
],
),
),
)),
),
);
});
}
updateProcedure(
{ProcedureViewModel model,
String remarks,
String newProcedureId,
String newCategorieId,
List<EntityList> entityList,
String orderType,
String procedureId,
PatiantInformtion patient,
String categorieId}) async {
UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel();
List<Controls> controls = List();
ProcedureDetail controlsProcedure = new ProcedureDetail();
updateProcedureReqModel.appointmentNo = patient.appointmentNo;
updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = 0;
controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
);
controls.add(
Controls(code: "ordertype", controlValue: "1"),
);
entityList.isNotEmpty
? entityList.forEach((element) {
controlsProcedure.procedure = element.procedureId;
controlsProcedure.category = element.categoryID;
controlsProcedure.controls = controls;
})
: controlsProcedure.procedure = procedureId;
controlsProcedure.category = categorieId;
controlsProcedure.controls = controls;
// controlsProcedure.add(ProcedureDetail(
// category: categorieId, procedure: procedureId, controls: controls));
updateProcedureReqModel.procedureDetail = controlsProcedure;
await model.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated');
}
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DateUtils { class DateUtils {
@ -32,7 +34,7 @@ class DateUtils {
return date; return date;
} }
static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) { static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
// now = now.add(Duration(days: 400, minutes: 0)); // now = now.add(Duration(days: 400, minutes: 0));
var difference = firstDate.difference(now); var difference = firstDate.difference(now);
@ -49,12 +51,10 @@ class DateUtils {
final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day); final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day);
days = now.difference(monthAgo).inDays + 1; days = now.difference(monthAgo).inDays + 1;
} }
return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}";
return "$days Days, $months Months, $years Years";
} }
static String differenceBetweenDateAndCurrent(DateTime firstDate) { static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
// DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0)); // DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0));
var difference = now.difference(firstDate); var difference = now.difference(firstDate);
@ -67,10 +67,10 @@ class DateUtils {
double hoursInOneDay = difference.inHours / difference.inDays; double hoursInOneDay = difference.inHours / difference.inDays;
return "$days Days, $hours HR, $minutes Min"; return "$days ${TranslationBase.of(context).days}, $hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}";
} }
static String differenceBetweenServerDateAndCurrent(String str) { static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -81,7 +81,7 @@ class DateUtils {
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex))); int.parse(str.substring(startIndex + start.length, endIndex)));
return differenceBetweenDateAndCurrent(date); return differenceBetweenDateAndCurrent(date, context);
} }
/// get month by /// get month by
@ -217,7 +217,7 @@ class DateUtils {
} }
} }
static String getAgeByBirthday(dynamic birthday){ static String getAgeByBirthday(dynamic birthday, BuildContext context){
// https://leechy.dev/calculate-dates-diff-in-dart // https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);
final now = DateTime.now(); final now = DateTime.now();
@ -232,7 +232,7 @@ class DateUtils {
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
days = now.difference(monthAgo).inDays + 1; days = now.difference(monthAgo).inDays + 1;
} }
return "$years Yr $months Mnth $days Day"; return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}";
} }
} }

@ -117,6 +117,9 @@ class TranslationBase {
String get myReferredPatient => String get myReferredPatient =>
localizedValues['myReferredPatient'][locale.languageCode]; localizedValues['myReferredPatient'][locale.languageCode];
String get referredPatient =>
localizedValues['referredPatient'][locale.languageCode];
String get referredOn => localizedValues['referredOn'][locale.languageCode];
String get firstName => localizedValues['firstName'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode];
@ -1013,21 +1016,30 @@ class TranslationBase {
String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get createdBy => localizedValues['createdBy'][locale.languageCode];
String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode];
String get currentMedications => String get currentMedications =>
localizedValues['currentMedications'][locale.languageCode]; localizedValues['currentMedications'][locale.languageCode];
String get noItem => localizedValues['noItem'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode];
String get postUcafSuccessMsg => String get postUcafSuccessMsg =>
localizedValues['postUcafSuccessMsg'][locale.languageCode]; localizedValues['postUcafSuccessMsg'][locale.languageCode];
String get vitalSignDetailEmpty => String get vitalSignDetailEmpty =>
localizedValues['vitalSignDetailEmpty'][locale.languageCode]; localizedValues['vitalSignDetailEmpty'][locale.languageCode];
String get onlyOfftimeHoliday => String get onlyOfftimeHoliday =>
localizedValues['onlyOfftimeHoliday'][locale.languageCode]; localizedValues['onlyOfftimeHoliday'][locale.languageCode];
String get active => localizedValues['active'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode];
String get hold => localizedValues['hold'][locale.languageCode]; String get hold => localizedValues['hold'][locale.languageCode];
String get loading => localizedValues['loading'][locale.languageCode]; String get loading => localizedValues['loading'][locale.languageCode];
String get assessmentErrorMsg => String get assessmentErrorMsg =>
localizedValues['assessmentErrorMsg'][locale.languageCode]; localizedValues['assessmentErrorMsg'][locale.languageCode];
String get examinationErrorMsg => String get examinationErrorMsg =>
localizedValues['examinationErrorMsg'][locale.languageCode]; localizedValues['examinationErrorMsg'][locale.languageCode];
@ -1037,11 +1049,40 @@ class TranslationBase {
String get chiefComplaintErrorMsg => String get chiefComplaintErrorMsg =>
localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; localizedValues['chiefComplaintErrorMsg'][locale.languageCode];
String get ICDName => localizedValues['ICDName'][locale.languageCode]; String get ICDName => localizedValues['ICDName'][locale.languageCode];
String get referralStatus => String get referralStatus =>
localizedValues['referralStatus'][locale.languageCode]; localizedValues['referralStatus'][locale.languageCode];
String get referralRemark => String get referralRemark =>
localizedValues['referralRemark'][locale.languageCode]; localizedValues['referralRemark'][locale.languageCode];
String get offTime => localizedValues['offTime'][locale.languageCode]; String get offTime => localizedValues['offTime'][locale.languageCode];
String get icd => localizedValues['icd'][locale.languageCode];
String get days => localizedValues['days'][locale.languageCode];
String get hr => localizedValues['hr'][locale.languageCode];
String get min => localizedValues['min'][locale.languageCode];
String get months => localizedValues['months'][locale.languageCode];
String get years => localizedValues['years'][locale.languageCode];
String get referralStatusHold =>
localizedValues['referralStatusHold'][locale.languageCode];
String get referralStatusActive =>
localizedValues['referralStatusActive'][locale.languageCode];
String get referralStatusCancelled =>
localizedValues['referralStatusCancelled'][locale.languageCode];
String get referralStatusCompleted =>
localizedValues['referralStatusCompleted'][locale.languageCode];
String get referralStatusNotSeen =>
localizedValues['referralStatusNotSeen'][locale.languageCode];
String get clinicSearch =>
localizedValues['clinicSearch'][locale.languageCode];
String get doctorSearch =>
localizedValues['doctorSearch'][locale.languageCode];
String get patientName =>
localizedValues['patient-name'][locale.languageCode];
String get appointmentNumber =>
localizedValues['appointmentNumber'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -4,15 +4,18 @@ import 'package:flutter/material.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String patientName; final String patientName;
final String patientID;
final String referralStatus; final String referralStatus;
final isReferredTo; final isReferredTo;
final isSameBranch; final isSameBranch;
final String referralDoctorName; final String referralDoctorName;
final String clinicDescription; final String clinicDescription;
final String remark; final String remark;
final String referredOn;
final Widget infoIcon; final Widget infoIcon;
PatientReferralItemWidget({ PatientReferralItemWidget(
this.patientID, {
this.patientName, this.patientName,
this.referralStatus, this.referralStatus,
this.isReferredTo = false, this.isReferredTo = false,
@ -20,6 +23,7 @@ class PatientReferralItemWidget extends StatelessWidget {
this.referralDoctorName, this.referralDoctorName,
this.clinicDescription, this.clinicDescription,
this.remark, this.remark,
this.referredOn,
this.infoIcon, this.infoIcon,
}); });
@ -35,14 +39,6 @@ class PatientReferralItemWidget extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Center(
child: AppText(
patientName != null ? "${patientName}" : "",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
if (referralStatus != null) if (referralStatus != null)
Row( Row(
children: [ children: [
@ -77,7 +73,7 @@ class PatientReferralItemWidget extends StatelessWidget {
isReferredTo isReferredTo
? "${TranslationBase.of(context).referTo}: " ? "${TranslationBase.of(context).referTo}: "
: "${TranslationBase.of(context).referredFrom}: ", : "${TranslationBase.of(context).referredFrom}: ",
color: Colors.black, color: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
@ -85,8 +81,8 @@ class PatientReferralItemWidget extends StatelessWidget {
isSameBranch isSameBranch
? TranslationBase.of(context).sameBranch ? TranslationBase.of(context).sameBranch
: TranslationBase.of(context).otherBranch, : TranslationBase.of(context).otherBranch,
color: Colors.grey, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
], ],
@ -107,7 +103,7 @@ class PatientReferralItemWidget extends StatelessWidget {
child: AppText( child: AppText(
referralDoctorName != null referralDoctorName != null
? "${TranslationBase.of(context).dr} $referralDoctorName" ? "${TranslationBase.of(context).dr} $referralDoctorName"
: "", : "-",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
@ -123,14 +119,52 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).clinic}: ", "${TranslationBase.of(context).clinic}: ",
color: Colors.black, color: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
AppText( AppText(
clinicDescription, clinicDescription,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).patientID}: ",
color: Colors.grey, color: Colors.grey,
fontWeight: FontWeight.normal, fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
patientID ?? '-',
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).patientName}: ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
patientName ?? '-',
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
], ],
@ -148,8 +182,27 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
AppText( AppText(
remark, remark,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
TranslationBase.of(context).referredOn,
color: Colors.grey, color: Colors.grey,
fontWeight: FontWeight.normal, fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
referredOn ?? '-',
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
], ],

@ -117,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget {
height: 4, height: 4,
), ),
AppText( AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
), ),
@ -297,7 +297,7 @@ class PatientProfileWidget extends StatelessWidget {
patient.createdOn != null patient.createdOn != null
? DateUtils ? DateUtils
.differenceBetweenServerDateAndCurrent( .differenceBetweenServerDateAndCurrent(
patient.createdOn) patient.createdOn, context)
: "", : "",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

@ -62,20 +62,24 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Container(
decoration: BoxDecoration( CircleAvatar(
color: Theme.of(context).backgroundColor,
borderRadius: BorderRadius.all( // radius: (52)
Radius.circular(10.0), child: ClipRRect(
), borderRadius:BorderRadius.circular(10),
),
height: 50,
width: 60,
child: Image.network( child: Image.network(
authProvider.doctorProfile.doctorImageURL, authProvider
// fit: BoxFit.fill, .doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 70,
height: 60,
), ),
), ),
backgroundColor: Colors.transparent,
)
], ],
), ),
), ),

@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -140,14 +139,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).myReferral, nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'note.png'), icon: 'note.png'),
if (selectedPatientType != 0 && selectedPatientType != 5)
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_ORDERS,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).list,
icon: 'radiology-1.png'),
if (int.parse(patientType) == 7 || int.parse(patientType) == 6) if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,

@ -75,7 +75,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"SUBJECTIVE", "SUBJECTIVE",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: 14,
), ),
], ],
), ),
@ -125,7 +125,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"OBJECTIVE", "OBJECTIVE",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:SizeConfig.textMultiplier * 2.0, fontSize:14,
), ),
], ],
), ),
@ -178,7 +178,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"ASSESSMENT", "ASSESSMENT",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:SizeConfig.textMultiplier * 2.0, fontSize:14,
), ),
], ],
), ),
@ -230,7 +230,7 @@ class StepsWidget extends StatelessWidget {
"PLAN", "PLAN",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize:SizeConfig.textMultiplier * 2.0, fontSize:14,
), ),
), ),
], ],
@ -347,7 +347,7 @@ class StepsWidget extends StatelessWidget {
AppText( AppText(
"هدف", "هدف",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:SizeConfig.textMultiplier * 2.0, fontSize:14,
), ),
], ],
), ),
@ -400,7 +400,7 @@ class StepsWidget extends StatelessWidget {
child: AppText( child: AppText(
"تقدير", "تقدير",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:SizeConfig.textMultiplier * 2.0, fontSize:14,
), ),
), ),
], ],
@ -453,7 +453,7 @@ class StepsWidget extends StatelessWidget {
child: AppText( child: AppText(
"خطة", "خطة",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:SizeConfig.textMultiplier * 2.0, fontSize:14,
), ),
), ),
], ],

@ -31,9 +31,6 @@ class UpdateAllergiesWidget extends StatefulWidget {
} }
class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> { class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
TextEditingController remarkController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -120,14 +117,26 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Container( child: Row(
width: MediaQuery.of(context).size.width * 0.6, children: [
AppText(
selectedAllergy.remark != null &&
selectedAllergy.remark != ''
? TranslationBase.of(context).remarks + " : "
: '',
fontWeight: FontWeight.bold,
fontSize: 13,
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: AppText( child: AppText(
selectedAllergy.remark ?? '', selectedAllergy.remark ?? '',
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
), ),
), ),
],
),
), ),
DividerWithSpacesAround() DividerWithSpacesAround()
], ],
@ -225,6 +234,9 @@ class _AddAllergiesState extends State<AddAllergies> {
MasterKeyModel _selectedAllergySeverity; MasterKeyModel _selectedAllergySeverity;
MasterKeyModel _selectedAllergy; MasterKeyModel _selectedAllergy;
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController severityController = TextEditingController();
TextEditingController allergyController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@ -232,23 +244,27 @@ class _AddAllergiesState extends State<AddAllergies> {
String hintText, String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown,
{IconData icon}) { {IconData icon}) {
return InputDecoration( return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14, fontSize: 10,
color: Colors.grey.shade600, color: Theme
.of(context)
.hintColor,
fontWeight: FontWeight.w700
), ),
); );
} }
@ -302,6 +318,7 @@ class _AddAllergiesState extends State<AddAllergies> {
? () { ? () {
setState(() { setState(() {
_selectedAllergy = null; _selectedAllergy = null;
allergyController.text = null;
}); });
} }
: null, : null,
@ -314,7 +331,15 @@ class _AddAllergiesState extends State<AddAllergies> {
? _selectedAllergy.nameEn ? _selectedAllergy.nameEn
: null, true, icon: EvaIcons.search), : null, true, icon: EvaIcons.search),
itemSubmitted: (item) => itemSubmitted: (item) =>
setState(() => _selectedAllergy = item), setState(() {
_selectedAllergy = item;
allergyController.text =
projectViewModel.isArabic
? _selectedAllergy
.nameAr
: _selectedAllergy
.nameEn;
}),
key: key, key: key,
suggestions: model.allergiesList, suggestions: model.allergiesList,
itemBuilder: (context, suggestion) => itemBuilder: (context, suggestion) =>
@ -322,27 +347,44 @@ class _AddAllergiesState extends State<AddAllergies> {
child: Texts( child: Texts(
projectViewModel.isArabic ? suggestion projectViewModel.isArabic ? suggestion
.nameAr : suggestion.nameEn), .nameAr : suggestion.nameEn),
padding: EdgeInsets.all(8.0)), padding: EdgeInsets.all(2.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
suggestion.nameAr.toLowerCase().startsWith( suggestion.nameAr.toLowerCase().startsWith(
input.toLowerCase()) || input.toLowerCase()) ||
suggestion.nameEn.toLowerCase() suggestion.nameEn.toLowerCase()
.startsWith(input.toLowerCase()), .startsWith(input.toLowerCase()),
) : TextField( ) :
decoration: textFieldSelectorDecoration( TextFields(
TranslationBase onTapTextFields: model.allergiesList != null
? () {
setState(() {
_selectedAllergy = null;
allergyController.text = null;
});
}
: null,
hasLabelText: allergyController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context) .of(context)
.selectAllergy, .selectAllergy,
_selectedAllergy != null fontSize: 13.5,
? projectViewModel.isArabic readOnly: true,
? _selectedAllergy.nameAr fontWeight: FontWeight.w600,
: _selectedAllergy.nameEn maxLines: 2,
: null, minLines: 1,
true, controller: allergyController,
icon: EvaIcons.search), suffixIcon: EvaIcons.search,
enabled: false, validator: (value) {
), if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
})
), ),
), ),
if(isFormSubmitted && _selectedAllergy == null) if(isFormSubmitted && _selectedAllergy == null)
@ -350,10 +392,9 @@ class _AddAllergiesState extends State<AddAllergies> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( TextFields(
height: screenSize.height * 0.070, onTapTextFields: model
child: InkWell( .allergySeverityList != null
onTap: model.allergySeverityList != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.allergySeverityList, list: model.allergySeverityList,
@ -364,6 +405,13 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() { setState(() {
_selectedAllergySeverity = _selectedAllergySeverity =
selectedValue; selectedValue;
severityController.text =
projectViewModel.isArabic
? _selectedAllergySeverity
.nameAr
: _selectedAllergySeverity
.nameEn;
}); });
}, },
); );
@ -376,21 +424,33 @@ class _AddAllergiesState extends State<AddAllergies> {
); );
} }
: null, : null,
child: TextField( hasLabelText: severityController.text !=
decoration: textFieldSelectorDecoration( '' ? true : false,
TranslationBase showLabelText: true,
hintText: TranslationBase
.of(context) .of(context)
.selectSeverity, .selectSeverity,
_selectedAllergySeverity != null fontSize: 13.5,
? projectViewModel.isArabic?_selectedAllergySeverity.nameAr:_selectedAllergySeverity.nameEn readOnly: true,
: null, // hintColor: Colors.black,
true), fontWeight: FontWeight.w600,
enabled: false, maxLines: 2,
), minLines: 1,
), controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}), SizedBox(
height: 5,
), ),
if(isFormSubmitted && _selectedAllergySeverity == null) if(isFormSubmitted &&
_selectedAllergySeverity == null)
CustomValidationError(), CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -398,6 +458,8 @@ class _AddAllergiesState extends State<AddAllergies> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: remarkController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,

@ -267,19 +267,21 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase hasLabelText: complaintsController.text != ''
.of(context) ? true
: false,
hintText: TranslationBase.of(context)
.addChiefComplaints, .addChiefComplaints,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
showLabelText: true,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 13, minLines: 13,
controller: complaintsController, controller: complaintsController,
validator: (value) { validator: (value) {
if (value == null || value == "") if (value == null || value == "")
return TranslationBase return TranslationBase.of(context)
.of(context)
.emptyMessage; .emptyMessage;
else if (value.length < 25) else if (value.length < 25)
return TranslationBase return TranslationBase
@ -296,6 +298,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hasLabelText: illnessController.text != ''
? true
: false,
showLabelText: true,
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.historyOfPresentIllness, .historyOfPresentIllness,
@ -322,17 +328,23 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context) hasLabelText: medicationController.text != ''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.currentMedications, .currentMedications,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 2, maxLines: 23,
minLines: 1, minLines: 1,
controller: medicationController, controller: medicationController,
validator: (value) { validator: (value) {
if (value == null || value == "") if (value == null || value == "")
return TranslationBase.of(context) return TranslationBase
.of(context)
.emptyMessage; .emptyMessage;
else else
return null; return null;

@ -342,9 +342,11 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
height: 6, height: 6,
), ),
AppText( AppText(
TranslationBase.of(context).remarks + " : ", assessment.remark != null ||
fontWeight: FontWeight assessment.remark == ''
.bold, ? TranslationBase.of(context).remarks + " : "
: '',
fontWeight: FontWeight.bold,
fontSize: 13, fontSize: 13,
), ),
Container( Container(
@ -567,9 +569,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: "Appointment Number", hintText: TranslationBase.of(context).appointmentNumber,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
hasLabelText: appointmentIdController.text != ''?true:false,
showLabelText: true,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
readOnly: true, readOnly: true,
controller: appointmentIdController, controller: appointmentIdController,
@ -733,6 +737,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 18, maxLines: 18,
minLines: 5, minLines: 5,
hasLabelText: remarkController.text != ''?true:false,
showLabelText: true,
controller: remarkController, controller: remarkController,
onChanged:(value) { onChanged:(value) {
widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment.remark = remarkController.text;

@ -319,6 +319,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: remarksController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,

@ -137,6 +137,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.addProgressNote, .addProgressNote,
@ -361,6 +362,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hasLabelText: progressNoteController.text != ''?true:false,
showLabelText: true,
hintText: TranslationBase.of(context).addProgressNote, hintText: TranslationBase.of(context).addProgressNote,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,

@ -37,7 +37,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
changeLoadingState(true); if (pageIndex != _currentIndex) changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
} }

@ -74,7 +74,9 @@ class TextFields extends StatefulWidget {
this.autoValidate = false, this.autoValidate = false,
this.fillColor, this.fillColor,
this.hintColor, this.hintColor,
this.onTapTextFields}) this.hasBorder = true,
this.onTapTextFields,
this.hasLabelText = false, this.showLabelText= false})
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -111,6 +113,9 @@ class TextFields extends StatefulWidget {
final bool borderOnlyError; final bool borderOnlyError;
final Color hintColor; final Color hintColor;
final Color fillColor; final Color fillColor;
final bool hasBorder;
final bool showLabelText;
bool hasLabelText;
@override @override
_TextFieldsState createState() => _TextFieldsState(); _TextFieldsState createState() => _TextFieldsState();
@ -208,7 +213,9 @@ class _TextFieldsState extends State<TextFields> {
offset: Offset(0.0, 13.0), offset: Offset(0.0, 13.0),
blurRadius: focus ? 34.0 : 12.0) blurRadius: focus ? 34.0 : 12.0)
]), ]),
child: TextFormField( child: Column(
children: [
TextFormField(
onTap: widget.onTapTextFields, onTap: widget.onTapTextFields,
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
@ -226,7 +233,22 @@ class _TextFieldsState extends State<TextFields> {
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, maxLengthEnforced: widget.maxLengthEnforced,
initialValue: widget.initialValue, initialValue: widget.initialValue,
onChanged: widget.onChanged, onChanged: (value){
if(widget.showLabelText) {
if((value== null || value =='' )) {
setState(() {
widget.hasLabelText = false;
});
}else{
setState(() {
widget.hasLabelText = true;
});
}
}
widget.onChanged(value);
} ,
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
controller: widget.controller, controller: widget.controller,
@ -247,12 +269,23 @@ class _TextFieldsState extends State<TextFields> {
] ]
: widget.inputFormatters, : widget.inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hasLabelText ? widget.hintText : null,
labelStyle: TextStyle(
fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme
.of(context)
.hintColor,
),
counterText: "", counterText: "",
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme.of(context).hintColor, color: widget.hintColor ?? Theme
.of(context)
.hintColor,
), ),
contentPadding: widget.padding != null contentPadding: widget.padding != null
? widget.padding ? widget.padding
@ -262,7 +295,9 @@ class _TextFieldsState extends State<TextFields> {
filled: true, filled: true,
fillColor: widget.bare fillColor: widget.bare
? Colors.transparent ? Colors.transparent
: Theme.of(context).backgroundColor, : Theme
.of(context)
.backgroundColor,
suffixIcon: _buildSuffixIcon(), suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.prefixIcon, prefixIcon: widget.prefixIcon,
errorStyle: TextStyle( errorStyle: TextStyle(
@ -270,31 +305,48 @@ class _TextFieldsState extends State<TextFields> {
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
height: widget.borderOnlyError ? 0.0 : null), height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: widget.hasBorder ? BorderSide(
color: Theme.of(context) color: Theme
.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0), width: 1.0) : BorderSide(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: widget.hasBorder ? BorderSide(
color: Theme.of(context) color: Theme
.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0), width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0), borderSide: widget.hasBorder ? BorderSide(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), color: Colors.grey, width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0), borderSide: widget.hasBorder ? BorderSide(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), color: Colors.grey, width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0), borderSide: widget.hasBorder ? BorderSide(
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0), color: Colors.grey, width: 1.0) : BorderSide(
color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular(
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),
), ),
), ),
), ),
],
),
)); ));
} }
} }

@ -83,32 +83,32 @@ class _AppDrawerState extends State<AppDrawer> {
children: [ children: [
authProvider.doctorProfile != null authProvider.doctorProfile != null
? CircleAvatar( ? CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12, radius:
backgroundImage: NetworkImage( SizeConfig.imageSizeMultiplier * 12,
authProvider.doctorProfile.doctorImageURL), // radius: (52)
backgroundColor: Colors.white, child: ClipRRect(
borderRadius:BorderRadius.circular(50),
child: Image.network(
authProvider
.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 700,
),
),
backgroundColor: Colors.transparent,
) )
: SizedBox(), : SizedBox(),
authProvider.doctorProfile != null authProvider.doctorProfile != null
? Padding( ? Padding(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
child: AppText( child: AppText(
authProvider.doctorProfile?.doctorName, TranslationBase.of(context).dr +authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
)) ))
: SizedBox(), : SizedBox(),
AppText(
projectsProvider.isArabic
? authProvider
.doctorProfile.titleDescriptionN ??
""
: authProvider
.doctorProfile?.titleDescription ??
"",
fontWeight: FontWeight.normal,
color: Colors.black87),
], ],
), ),
), ),

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ListSelectDialog extends StatefulWidget { class ListSelectDialog extends StatefulWidget {
@ -12,24 +14,32 @@ class ListSelectDialog extends StatefulWidget {
final Function(dynamic) okFunction; final Function(dynamic) okFunction;
dynamic selectedValue; dynamic selectedValue;
final Widget searchWidget; final Widget searchWidget;
final bool usingSearch;
final String hintSearchText;
ListSelectDialog( ListSelectDialog({
{@required this.list, @required this.list,
@required this.attributeName, @required this.attributeName,
@required this.attributeValueId, @required this.attributeValueId,
@required this.okText, @required this.okText,
@required this.okFunction, @required this.okFunction,
this.searchWidget}); this.searchWidget,
this.usingSearch = false,
this.hintSearchText,
});
@override @override
_ListSelectDialogState createState() => _ListSelectDialogState(); _ListSelectDialogState createState() => _ListSelectDialogState();
} }
class _ListSelectDialogState extends State<ListSelectDialog> { class _ListSelectDialogState extends State<ListSelectDialog> {
List<dynamic> items = List();
@override @override
void initState() { void initState() {
super.initState();
widget.selectedValue = widget.selectedValue ?? widget.list[0]; widget.selectedValue = widget.selectedValue ?? widget.list[0];
items.addAll(widget.list);
super.initState();
} }
@override @override
@ -47,8 +57,8 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
Widget continueButton = FlatButton( Widget continueButton = FlatButton(
child: Text(this.widget.okText), child: Text(this.widget.okText),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue);
Navigator.of(context).pop(); Navigator.of(context).pop();
this.widget.okFunction(widget.selectedValue);
}); });
// set up the AlertDialog // set up the AlertDialog
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
@ -69,7 +79,21 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
child: Column( child: Column(
children: [ children: [
if (widget.searchWidget != null) widget.searchWidget, if (widget.searchWidget != null) widget.searchWidget,
...widget.list if(widget.usingSearch)
Container(
height: MediaQuery.of(context).size.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase
.of(context)
.search, null, false, suffixIcon: Icon(Icons.search,)),
enabled: true,
keyboardType: TextInputType.text,
onChanged: (value) {
filterSearchResults(value);
},
)),
...items
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"), title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId] groupValue: widget.selectedValue[widget.attributeValueId]
@ -95,4 +119,27 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
static closeAlertDialog(BuildContext context) { static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
void filterSearchResults(String query) {
List<dynamic> dummySearchList = List();
dummySearchList.addAll(widget.list);
if (query.isNotEmpty) {
List<dynamic> dummyListData = List();
dummySearchList.forEach((item) {
if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
setState(() {
items.clear();
items.addAll(dummyListData);
});
return;
} else {
setState(() {
items.clear();
items.addAll(widget.list);
});
}
}
} }

@ -35,10 +35,20 @@ class ProfileImageWidget extends StatelessWidget {
height: height, height: height,
width: width, width: width,
child:CircleAvatar( child:CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12, radius:
backgroundImage: NetworkImage(url), SizeConfig.imageSizeMultiplier * 12,
backgroundColor: Colors.transparent, // radius: (52)
child: ClipRRect(
borderRadius:BorderRadius.circular(50),
child: Image.network(
url,
fit: BoxFit.fill,
width: 700,
),
), ),
backgroundColor: Colors.transparent,
)
), ),
name == null || des == null name == null || des == null
? SizedBox() ? SizedBox()

@ -105,7 +105,7 @@ packages:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.13" version: "1.11.0"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
@ -559,7 +559,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -713,7 +713,7 @@ packages:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.3.2+4" version: "4.3.3"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -783,7 +783,7 @@ packages:
name: shared_preferences_windows name: shared_preferences_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+3" version: "0.0.2+2"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
@ -830,7 +830,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -942,7 +942,7 @@ packages:
name: web_socket_channel name: web_socket_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@ -965,5 +965,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

@ -62,8 +62,9 @@ dependencies:
#chart #chart
fl_chart: ^0.12.1 fl_chart: ^0.12.1
#firebase # Firebase
firebase_messaging: ^7.0.0 firebase_messaging: ^7.0.3
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1

Loading…
Cancel
Save