diff --git a/android/app/build.gradle b/android/app/build.gradle index 96428f49..ab88f580 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -28,6 +28,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 30 +// signingConfigs { +// release { +// storeFile file('C:\\Users\\admin\\Downloads\\DQKey.jks') +// storePassword 'HmGsa123' +// keyAlias 'key' +// keyPassword 'HmGsa123' +// } +// } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -50,10 +59,25 @@ android { buildTypes { release { // TODO: Add your own signing config for the release build. + signingConfig signingConfigs.debug + } + debug { // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } + +// flavorDimensions 'environment' +// productFlavors { +// production { +// dimension 'environment' +// } +// } +// +// configurations { +// productionDebugImplementation +// productionReleaseImplementation +// } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -84,6 +108,8 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp:4.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1' + implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0' + implementation 'com.google.firebase:firebase-analytics:17.4.1' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/android/app/google-services.json b/android/app/google-services.json index db548786..e6560790 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,34 +1,77 @@ { "project_info": { - "project_number": "157373154094", - "project_id": "hmg-doctor-app-1553688619744", - "storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" + "project_number": "934365232760", + "project_id": "hmg-dr-app", + "storage_bucket": "hmg-dr-app.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", + "mobilesdk_app_id": "1:934365232760:android:024b3569972f1c09f9778d", + "android_client_info": { + "package_name": "COM.HMG.HMGDR" + } + }, + "oauth_client": [ + { + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "COM.HMG.HMGDR" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:934365232760:android:e0e185e68c0d7690f9778d", "android_client_info": { "package_name": "com.hmg.hmgDr" } }, "oauth_client": [ { - "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" + "current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "COM.HMG.HMGDR" + } } ] } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 317d0290..00000000 --- a/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index bf0d3766..9cd98ee3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,22 +10,30 @@ FlutterApplication and put your custom class here. --> - + + + - + + + + + + + 60dp 54dp - 52dp + 48dp 24dp @@ -33,9 +33,15 @@ 4dp - 8sp + 8dp 16dp 24dp + 36dp + 60dp + 80dp + 40dp + + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index bc694f7c..ed85970e 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -4,7 +4,6 @@ الوقت المتبقي بالثانيه: Settings Cancel - - Hello blank fragment + An unexpected error has occurred.\nHelp developers by providing error details.\nThank you for your support. \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index e13b5b14..e5b2f6d2 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,10 +1,12 @@ - + @@ -25,12 +27,17 @@ true - true + true + true + false @null match_parent match_parent + + @android:style/Animation.Dialog + diff --git a/android/app/src/main/res/xml/provider_paths.xml b/android/app/src/main/res/xml/provider_paths.xml new file mode 100644 index 00000000..8d13fa17 --- /dev/null +++ b/android/app/src/main/res/xml/provider_paths.xml @@ -0,0 +1,4 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle index 4cb72d20..51c49a99 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.2' + classpath 'com.google.gms:google-services:4.3.3' } } diff --git a/android/google-services.json b/android/google-services.json index db548786..e6560790 100644 --- a/android/google-services.json +++ b/android/google-services.json @@ -1,34 +1,77 @@ { "project_info": { - "project_number": "157373154094", - "project_id": "hmg-doctor-app-1553688619744", - "storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" + "project_number": "934365232760", + "project_id": "hmg-dr-app", + "storage_bucket": "hmg-dr-app.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", + "mobilesdk_app_id": "1:934365232760:android:024b3569972f1c09f9778d", + "android_client_info": { + "package_name": "COM.HMG.HMGDR" + } + }, + "oauth_client": [ + { + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "COM.HMG.HMGDR" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:934365232760:android:e0e185e68c0d7690f9778d", "android_client_info": { "package_name": "com.hmg.hmgDr" } }, "oauth_client": [ { - "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" + "current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", + "client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "COM.HMG.HMGDR" + } } ] } diff --git a/assets/images/patient_register.png b/assets/images/patient_register.png new file mode 100644 index 00000000..c55935bc Binary files /dev/null and b/assets/images/patient_register.png differ diff --git a/ios/GoogleService-Info .plist b/ios/GoogleService-Info .plist index 81c3af44..a29eac6d 100644 --- a/ios/GoogleService-Info .plist +++ b/ios/GoogleService-Info .plist @@ -3,21 +3,21 @@ CLIENT_ID - 1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com + 934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5.apps.googleusercontent.com REVERSED_CLIENT_ID - com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre + com.googleusercontent.apps.934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5 API_KEY - AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo + AIzaSyBtA8-oCZ5T4gkuTG7CucGr_d_7lakp4MM GCM_SENDER_ID - 1097451043303 + 934365232760 PLIST_VERSION 1 BUNDLE_ID - com.hmg.doctorApp + com.hmg.hmgDr PROJECT_ID - doctor-app-35ddc + hmg-dr-app STORAGE_BUCKET - doctor-app-35ddc.appspot.com + hmg-dr-app.appspot.com IS_ADS_ENABLED IS_ANALYTICS_ENABLED @@ -29,6 +29,6 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:1097451043303:ios:0e9b87e77dcf397d866542 + 1:934365232760:ios:61e01db91b41502bf9778d \ No newline at end of file diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist index 81c3af44..a29eac6d 100644 --- a/ios/Runner/GoogleService-Info.plist +++ b/ios/Runner/GoogleService-Info.plist @@ -3,21 +3,21 @@ CLIENT_ID - 1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com + 934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5.apps.googleusercontent.com REVERSED_CLIENT_ID - com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre + com.googleusercontent.apps.934365232760-en86g42ch3fgu7odnv5ka6kec8irg8d5 API_KEY - AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo + AIzaSyBtA8-oCZ5T4gkuTG7CucGr_d_7lakp4MM GCM_SENDER_ID - 1097451043303 + 934365232760 PLIST_VERSION 1 BUNDLE_ID - com.hmg.doctorApp + com.hmg.hmgDr PROJECT_ID - doctor-app-35ddc + hmg-dr-app STORAGE_BUCKET - doctor-app-35ddc.appspot.com + hmg-dr-app.appspot.com IS_ADS_ENABLED IS_ANALYTICS_ENABLED @@ -29,6 +29,6 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:1097451043303:ios:0e9b87e77dcf397d866542 + 1:934365232760:ios:61e01db91b41502bf9778d \ No newline at end of file diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 5286a54b..1414c78f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -26,7 +26,8 @@ class BaseAppClient { required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure, bool isAllowAny = false, - bool isLiveCare = false}) async { + bool isLiveCare = false, + bool isFallLanguage = false}) async { String url; if (isLiveCare) url = BASE_URL_LIVE_CARE + endPoint; @@ -59,17 +60,22 @@ class BaseAppClient { body['TokenID'] = token; } // body['TokenID'] = "@dm!n" ?? ''; - String lang = await sharedPref.getString(APP_Language); - if (lang != null && lang == 'ar') - body['LanguageID'] = 1; - else - body['LanguageID'] = 2; - - body['stamp'] = STAMP; + if (!isFallLanguage) { + String lang = await sharedPref.getString(APP_Language); + if (lang != null && lang == 'ar') + body['LanguageID'] = 1; + else + body['LanguageID'] = 2; + } + body['stamp'] = DateTime.now().toIso8601String(); // if(!body.containsKey("IPAdress")) body['IPAdress'] = IP_ADDRESS; - body['VersionID'] = VERSION_ID; - body['Channel'] = CHANNEL; + if (body['VersionID'] == null) { + body['VersionID'] = VERSION_ID; + } + if (body['Channel'] == null) { + body['Channel'] = CHANNEL; + } body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; @@ -83,7 +89,10 @@ class BaseAppClient { int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) body['PatientOutSA'] = true; - else if (body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) + else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || + body['facilityId'] == 3) || + body['ProjectID'] == 2 || + body['ProjectID'] == 3) body['PatientOutSA'] = true; else body['PatientOutSA'] = false; @@ -205,7 +214,8 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - + var asd = json.encode(body); + var asd2; if (await Helpers.checkConnection()) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; diff --git a/lib/config/config.dart b/lib/config/config.dart index 8241b36c..ce9b3c5c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -9,85 +9,118 @@ const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_ORDERS_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = + "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = + "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_ORDERS_URL = + "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_REFER_TO_DOCTOR_URL = + "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = + "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = + "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = + 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = + "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = + "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = + 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = + 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = + 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = + 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; -const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = + 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = + 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = + 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = + 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; -const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = + 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = + 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = + 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = + 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = + 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = + 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; @@ -95,138 +128,261 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = + 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = + 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = + 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const UPDATE_RESCHDEULE = + 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = + 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_PATIENT_ARRIVAL_LIST = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; -const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = + 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = + 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = + 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = + 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; +const POST_EPISODE_FOR_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = + '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = + 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const GET_ORDER_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; +const GET_LIST_CATEGORISE = + 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = + 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = + 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = + 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = + 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = + 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = + 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = + 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = + 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; +const GET_MY_REFERRAL_OUT_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; -const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = + "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = + 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = + "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = + "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; -const GET_PRESCRIPTION_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const GET_INSURANCE_IN_PATIENT = + "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = + "Services/DoctorApplication.svc/REST/GetMyOutPatient"; -const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_LIST = + "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = + "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = + "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = + "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; -const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_PROCEDURE_TEMPLETE = + 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; -const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; +const GET_PROCEDURE_TEMPLETE_DETAILS = + "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; -const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const DOCTOR_CHECK_HAS_LIVE_CARE = + "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; -const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; -const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; -const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; +const ADD_REFERRED_REMARKS_NEW = + "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; +const GET_SPECIAL_CLINICAL_CARE_LIST = + "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; +const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = + "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; + +const INSERT_MEDICAL_REPORT = + "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; + +const UPDATE_MEDICAL_REPORT = + "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; +const GET_SICK_LEAVE_DOCTOR_APP = + "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; +const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; +const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; +const CREATE_DOCTOR_RESPONSE = + "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; +const GET_DOCTOR_NOT_REPLIED_COUNTS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; +const ALL_SPECIAL_LAB_RESULT = + "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; +const GET_MEDICATION_FOR_IN_PATIENT = + "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; +const GET_EPISODE_FOR_INPATIENT = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; + + +///Operation Details Services + +const GET_RESERVATIONS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_OPERATION_DETAILS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; +const UPDATE_OPERATION_REPORT = + "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; + +const NURSING_PROGRESS_NOTE = + "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; +const GET_DIAGNOSIS_FOR_IN_PATIENT = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; + +const GET_DIABETIC_CHART_VALUES = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; + +const GET_PENDING_ORDERS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; + +const GET_ADMISSION_ORDERS = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; + +///Patient Registration Services +const CHECK_PATIENT_FOR_REGISTRATION = + "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = + "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; +const CHECK_ACTIVATION_CODE_FOR_PATIENT = + "Services/Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; +const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo"; + + +/// Discharge Summary +const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; var selectedPatientType = 1; @@ -272,14 +428,13 @@ var SERVICES_PATIANT_HEADER_AR = [ "المريض الواصل" ]; -var DEVICE_TOKEN = ""; const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 6.1; +const VERSION_ID = 6.4; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; @@ -291,6 +446,8 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; +const Color IN_PROGRESS_COLOR = Color(0xFFCC9B14); + /// Timer Info const TIMER_MIN = 10; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e6ded47a..9c40e638 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,216 +1,216 @@ const Map> localizedValues = { - 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, - 'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, - 'areYouSureYouWantTo': {'en': 'Are you sure you want to', 'ar': 'هل انت متاكد من انك تريد أن'}, - 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, - 'lanEnglish': {'en': 'English', 'ar': 'English'}, - 'lanArabic': {'en': 'العربية', 'ar': 'العربية'}, - 'theDoctor': {'en': 'Doctor', 'ar': 'الطبيب'}, - 'reply': {'en': 'Reply', 'ar': 'رد'}, - 'time': {'en': 'Time', 'ar': 'الوقت'}, - 'fileNo': {'en': 'File No : ', 'ar': 'رقم الملف :'}, - 'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'}, - 'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'}, - 'mySchedule': {'en': 'Schedule', 'ar': 'جدولي'}, - 'errorNoSchedule': {'en': 'You don\'t have any Schedule', 'ar': 'ليس لديك أي جدول زمني'}, - 'verify': {'en': 'VERIFY', 'ar': 'تحقق'}, - 'referralDoctor': {'en': 'Referral Doctor', 'ar': 'الطبيب المُحول إليه'}, - 'referringClinic': {'en': 'Referring Clinic', 'ar': 'العيادة المُحول إليها'}, - 'frequency': {'en': 'Frequency', 'ar': 'نوع التحويلا'}, - 'priority': {'en': 'Priority', 'ar': 'الأولوية'}, - 'maxResponseTime': {'en': 'Max Response Time', 'ar': 'الوقت الأقصى للرد'}, - 'clinicDetailsandRemarks': {'en': 'Clinic Details and Remarks', 'ar': 'ملاحضات وتفاصيل العيادة'}, - 'answerSuggestions': {'en': 'Answer/Suggestions', 'ar': 'ملاحضات وتفاصيل العيادة'}, - 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, - 'myOutPatient': {'en': 'My OutPatients', 'ar': 'المريض الخارجي'}, - 'myOutPatient_2lines': {'en': 'My\nOutPatients', 'ar': 'المريض\nالخارجي'}, - - 'searchPatient': {'en': 'Search Patients', 'ar': 'البحث عن مريض'}, - 'searchPatientDashBoard': {'en': 'Search\nPatients', 'ar': 'البحث\nعن مريض'}, - 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, - 'patient': {'en': 'Patient', 'ar': ' مريض'}, - 'patients': {'en': "Patient's", 'ar': ' مريض'}, - 'labResult': {'en': 'Lab Result', 'ar': 'نتيجة المختبر'}, - 'lab': {'en': 'Lab', 'ar': 'المختبر'}, - 'result': {'en': 'Result', 'ar': 'نتيجة'}, - 'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'}, - 'arrived': {'en': 'Arrival Patients', 'ar': ' المرضى الواصلين'}, - 'er': {'en': 'ER', 'ar': 'حالة طوارئ'}, - 'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'}, - 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, - 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, - 'service': {'en': 'Service', 'ar': 'خدمة'}, - 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'}, - 'myInPatient': {'en': 'My\nInPatients', 'ar': 'مرضاي\nالداخليين'}, - 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, - 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, - 'operations': {'en': 'Operations', 'ar': 'عمليات'}, - 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, - 'searchMedicineDashboard': {'en': 'Search\nMedicines', 'ar': 'بحث\nعن الدواء'}, - 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحثعن الدواء'}, - 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, - 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, - 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, - 'myReferredPatient': {'en': 'Referred', 'ar': 'المحالين'}, - 'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'}, - 'referredOn': {'en': 'referred On : ', 'ar': ' : تمت الإحالة في'}, - 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, - 'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'}, - 'lastName': {'en': 'Last Name', 'ar': 'اسم العائلة'}, - 'phoneNumber': {'en': "Patient's Phone Number ", 'ar': 'رقم الجوال'}, - 'patientID': {'en': 'Patient ID', 'ar': 'رقم المريض'}, - 'patientFile': {'en': 'Patient File', 'ar': 'ملف المريض'}, - 'familyMedicine': {'en': 'Family Medicine Clinic', 'ar': 'عيادة طب الأسرة'}, - 'search': {'en': 'Search', 'ar': 'بحث '}, - 'onlyArrivedPatient': {'en': 'Only Arrived Patient', 'ar': 'المريض الذي حضر للموعد'}, - 'searchMedicineNameHere': {'en': 'Search Medicine ', 'ar': 'ابحث هنا'}, - 'youCanFind': {'en': 'You Can Find ', 'ar': 'تستطيع ان تجد '}, - 'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'}, - 'qr': {'en': 'QR', 'ar': 'QR'}, - 'reader': {'en': 'Reader', 'ar': 'قارىء رمز ال'}, - 'startScanning': {'en': 'Start Scanning', 'ar': 'بدء المسح'}, - 'scanQrCode': {'en': 'scan Qr code to retrieve patient profile', 'ar': 'مسح رمزاال QR لاسترداد ملف تعريف المريض '}, - 'scanQr': {'en': 'Scan Qr', 'ar': 'اقراء ال QR'}, - 'profile': {'en': 'Profile', 'ar': 'ملفي الشخصي'}, - 'gender': {'en': 'Gender', 'ar': 'الجنس'}, - 'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, - 'hospital': {'en': 'Hospital', 'ar': 'المستشفى'}, - 'speciality': {'en': 'Speciality', 'ar': 'التخصص'}, - 'errorMessage': {'en': 'Something went wrong', 'ar': 'حدث خطأ ما'}, - 'patientProfile': {'en': 'Patient Profile', 'ar': 'ملف المريض'}, - 'vitalSign': {'en': 'Vital Signs', 'ar': 'المؤشرات الحيوية'}, - 'vital': {'en': 'Vital', 'ar': 'الحيوية'}, - 'signs': {'en': 'Signs', 'ar': 'المؤشرات'}, - 'labOrder': {'en': 'Lab Order', 'ar': 'نتائج التحاليل'}, - 'medicines': {'en': 'Medicines', 'ar': 'الأدوية'}, - 'prescription': {'en': 'Prescription', 'ar': 'وصفات'}, - 'insuranceApprovals': {'en': 'Insurance Approvals', 'ar': 'موافقات التأمين'}, - 'insurance': {'en': 'Insurance', 'ar': 'التأمين'}, - 'approvals': {'en': 'Approvals', 'ar': 'موافقات'}, - 'bodyMeasurements': {'en': 'Body Measurements', 'ar': 'قياسات الجسم'}, - 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, - 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, - 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, - 'bloodPressure': {'en': 'Blood Pressure', 'ar': 'ضغط الدم'}, - 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, - 'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'}, - 'errorNoVitalSign': {'en': 'You don\'t have any Vital Sign', 'ar': 'ليس لديك اي اعراض حيوية'}, - 'labOrders': {'en': 'Lab Orders', 'ar': 'الفحوصات الطبية'}, - 'errorNoLabOrders': {'en': 'You don\'t have any lab orders', 'ar': 'ليس لديك اي فحوصات طبية'}, - 'answerThePatient': {'en': 'answer the patient', 'ar': 'اجب المريض '}, - 'pleaseEnterAnswer': {'en': 'please enter answer', 'ar': 'الرجاء ادخال اجابة '}, - 'replay': {'en': 'Reply', 'ar': 'تاكيد'}, - 'progressNote': {'en': 'Progress Note', 'ar': 'ملاحظة التقدم'}, - 'progress': {'en': 'Progress', 'ar': 'التقدم'}, - 'note': {'en': 'Note', 'ar': 'ملاحظة'}, - 'searchNote': {'en': 'Search Note', 'ar': 'بحث عن ملاحظة'}, - 'errorNoProgressNote': {'en': 'You don\'t have any Progress Note', 'ar': 'ليس لديك اي ملاحظة تقدم '}, - 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, - 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'}, - 'description': {'en': 'Description', 'ar': 'الوصف'}, - 'value': {'en': 'Value', 'ar': 'القيمة'}, - 'range': {'en': 'Range', 'ar': 'النطاق'}, - 'enterId': {'en': 'User ID', 'ar': 'معرف المستخدم'}, - 'pleaseEnterYourID': {'en': 'Please enter your ID', 'ar': 'الرجاء ادخال الهوية'}, - 'enterPassword': {'en': 'Password', 'ar': 'كلمه السر'}, - 'pleaseEnterPassword': {'en': 'Please Enter Password', 'ar': 'الرجاء ادخال الرقم السري'}, - 'selectYourProject': {'en': 'Branch', 'ar': 'فرع'}, - 'pleaseEnterYourProject': {'en': 'Please Enter Your Project', 'ar': 'الرجاء ادخال مستشفى'}, - 'login': {'en': 'Login', 'ar': 'تسجيل دخول'}, - 'drSulaimanAlHabib': {'en': 'Dr Sulaiman Al Habib', 'ar': 'د.سليمان الحبيب'}, - 'welcomeTo': {'en': 'Welcome to', 'ar': 'مرحبا بك'}, - 'welcomeBackTo': {'en': 'Welcome Back to', 'ar': 'مرحبًا بعودتك الى '}, - 'home': {'en': 'Home', 'ar': 'الرئيسية'}, - 'services': {'en': 'Services', 'ar': 'الخدمات'}, - 'sms': {'en': 'SMS', 'ar': 'رسالة قصيرة'}, - 'fingerprint': {'en': 'Fingerprint', 'ar': 'بصمة'}, - 'faceId': {'en': 'Face ID', 'ar': 'معرف الوجه'}, - 'whatsAppBy': {'en': 'by WhatsApp', 'ar': 'عن طريق واتس اب'}, - 'whatsApp': {'en': 'WhatsApp', 'ar': 'واتس اب'}, - 'pleaseChoose': { - 'en': 'Please choose one of the Following option to verify', - 'ar': 'يرجى اختيار أحد الخيارات التالية للتحقق' + "dashboardScreenToolbarTitle": {"ar": "الرئيسة", "en": "Home"}, + "settings": {"en": "Settings", "ar": "الاعدادات"}, + "areYouSureYouWantTo": {"en": "Are you sure you want to", "ar": "هل انت متاكد من انك تريد أن"}, + "language": {"en": "App Language", "ar": "لغة التطبيق"}, + "lanEnglish": {"en": "English", "ar": "English"}, + "lanArabic": {"en": "العربية", "ar": "العربية"}, + "theDoctor": {"en": "Doctor", "ar": "الطبيب"}, + "reply": {"en": "Reply", "ar": "رد"}, + "time": {"en": "Time", "ar": "الوقت"}, + "fileNo": {"en": "File No : ", "ar": "رقم الملف :"}, + "mobileNo": {"en": "Mobile No", "ar": "رقم الجوال"}, + "messagesScreenToolbarTitle": {"en": "Messages", "ar": "الرسائل"}, + "mySchedule": {"en": "Schedule", "ar": "جدولي"}, + "errorNoSchedule": {"en": "You don't have any Schedule", "ar": "ليس لديك أي جدول"}, + "verify": {"en": "VERIFY", "ar": "تحقق"}, + "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, + "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, + "frequency": {"en": "Frequency", "ar": "تكرر"}, + "priority": {"en": "Priority", "ar": "الأولوية"}, + "maxResponseTime": {"en": "Max Response Time", "ar": "الوقت الأقصى للرد"}, + "clinicDetailsandRemarks": {"en": "Clinic Details and Remarks", "ar": "ملاحضات وتفاصيل العيادة"}, + "answerSuggestions": {"en": "Answer/Suggestions", "ar": "الرد / الاقتراحات"}, + "outPatients": {"en": "Out Patient", "ar": "العيادات الخارجية"}, + "myOutPatient": {"en": "My OutPatients", "ar": "مرضى العيادات الخارجية"}, + "myOutPatient_2lines": {"en": "My\nOutPatients", "ar": "مريض\nالعيادات الخارجية"}, + "searchPatient": {"en": "Search Patients", "ar": "البحث عن مريض"}, + "searchPatientDashBoard": {"en": "Search\nPatients", "ar": "البحث\nعن مريض"}, + "searchAbout": {"en": "Search", "ar": "البحث عن"}, + "patient": {"en": "Patient", "ar": " مريض"}, + "patients": {"en": "Patients", "ar": "مرضى"}, + "labResult": {"en": "Lab Result", "ar": "نتيجة المختبر"}, + "lab": {"en": "Lab", "ar": "المختبر"}, + "result": {"en": "Result", "ar": "نتيجة"}, + "todayStatistics": {"en": "Today Statistics", "ar": "إحصائيات اليوم"}, + "arrived": {"en": "Arrival Patients", "ar": " المرضى الحاضرين"}, + "er": {"en": "ER", "ar": "حالة طوارئ"}, + "walkIn": {"en": "Walk-in", "ar": "ادخل"}, + "notArrived": {"en": "Not Arrived", "ar": "لم يحضر"}, + "radiology": {"en": "Radiology", "ar": "الأشعة"}, + "service": {"en": "Service", "ar": "خدمة"}, + "referral": {"en": "Referral", "ar": "الإحالة"}, + "inPatient": {"en": "InPatients", "ar": "مرضاي"}, + "myInPatient": {"en": "My\nInPatients", "ar": "مرضاي\nالمنومين"}, + "myInPatientTitle": {"en": "My InPatients", "ar": "مرضاي المنومين"}, + "inPatientLabel": {"en": "InPatients", "ar": "المريض المنوم"}, + "inPatientAll": {"en": "All InPatients", "ar": "جميع المرضى المنومين"}, + "operations": {"en": "Operations", "ar": "عمليات"}, + "patientServices": {"en": "Patient Services", "ar": "خدمات المرضى"}, + "searchMedicineDashboard": {"en": "Search\nMedicines", "ar": "بحث\nعن الدواء"}, + "searchMedicine": {"en": "Search Medicines", "ar": "بحث عن الدواء"}, + "myReferralPatient": {"en": "My Referral Patient", "ar": "مرضى الاحالة"}, + "referPatient": {"en": "Referral Patient", "ar": "إحالة مريض"}, + "myReferral": {"en": "My Referral", "ar": "إحالة"}, + "myReferredPatient": {"en": "Referred", "ar": "المحالين"}, + "referredPatient": {"en": "Referred Patient", "ar": "المرضى المحالين"}, + "referredOn": {"en": "referred On : ", "ar": " : تمت الإحالة في"}, + "firstName": {"en": "First Name", "ar": "الاسم الاول"}, + "middleName": {"en": "Middle Name", "ar": "اسم الاب"}, + "lastName": {"en": "Last Name", "ar": "اسم العائلة"}, + "phoneNumber": {"en": "Patients Phone Number ", "ar": "رقم الجوال"}, + "patientID": {"en": "Patient ID", "ar": "رقم المريض"}, + "patientFile": {"en": "Patient File", "ar": "ملف المريض"}, + "familyMedicine": {"en": "Family Medicine Clinic", "ar": "عيادة طب الأسرة"}, + "search": {"en": "Search", "ar": "بحث "}, + "onlyArrivedPatient": {"en": "Only Arrived Patient", "ar": "المريض الذي حضر للموعد"}, + "searchMedicineNameHere": {"en": "Search Medicine ", "ar": "ابحث هنا"}, + "youCanFind": {"en": "You Can Find ", "ar": "تستطيع ان تجد "}, + "itemsInSearch": {"en": "items in search", "ar": "عناصر في البحث"}, + "qr": {"en": "QR", "ar": "QR"}, + "reader": {"en": "Reader", "ar": "قارىء رمز ال"}, + "startScanning": {"en": "Start Scanning", "ar": "بدء المسح"}, + "scanQrCode": {"en": "scan Qr code to retrieve patient profile", "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض"}, + "scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"}, + "profile": {"en": "Profile", "ar": "ملفي الشخصي"}, + "gender": {"en": "Gender", "ar": "الجنس"}, + "clinic": {"en": "Clinic", "ar": "العيادة"}, + "hospital": {"en": "Hospital", "ar": "المستشفى"}, + "speciality": {"en": "Speciality", "ar": "التخصص"}, + "errorMessage": {"en": "Something went wrong", "ar": "حدث خطأ ما"}, + "patientProfile": {"en": "Patient Profile", "ar": "ملف المريض"}, + "vitalSign": {"en": "Vital Signs", "ar": "المؤشرات الحيوية"}, + "vital": {"en": "Vital", "ar": "الحيوية"}, + "signs": {"en": "Signs", "ar": "المؤشرات"}, + "labOrder": {"en": "Lab Order", "ar": "نتائج التحاليل"}, + "medicines": {"en": "Medicines", "ar": "الأدوية"}, + "prescription": {"en": "Prescription", "ar": "الوصفات"}, + "insuranceApprovals": {"en": "Insurance Approvals", "ar": "موافقات التأمين"}, + "insurance": {"en": "Insurance", "ar": "التأمين"}, + "approvals": {"en": "Approvals", "ar": "موافقات"}, + "bodyMeasurements": {"en": "Body Measurements", "ar": "قياسات الجسم"}, + "temperature": {"en": "Temperature", "ar": "درجة الحرارة"}, + "pulse": {"en": "Pulse", "ar": "النبض"}, + "respiration": {"en": "Respiration", "ar": "التنفس"}, + "bloodPressure": {"en": "Blood Pressure", "ar": "ضغط الدم"}, + "oxygenation": {"en": "Oxygenation", "ar": "الأوكسجين"}, + "painScale": {"en": "Pain Scale", "ar": "مقياس الألم"}, + "errorNoVitalSign": {"en": "You don't have any Vital Sign", "ar": "ليس لديك اي مؤشرات حيوية"}, + "labOrders": {"en": "Lab Orders", "ar": "طلبات المختبر"}, + "errorNoLabOrders": {"en": "You don\"t have any lab orders", "ar": "ليس لديك اي طلبات للمختبر"}, + "answerThePatient": {"en": "answer the patient", "ar": "الرد على المريض "}, + "pleaseEnterAnswer": {"en": "please enter answer", "ar": "الرجاء ادخال الرد"}, + "replay": {"en": "Reply", "ar": "تاكيد"}, + "progressNote": {"en": "Progress Note", "ar": "ملاحظات التقدم"}, + "progress": {"en": "Progress", "ar": "التقدم"}, + "note": {"en": "Note", "ar": "ملاحظة"}, + "searchNote": {"en": "Search Note", "ar": "بحث عن ملاحظة"}, + "errorNoProgressNote": {"en": "You don\"t have any Progress Note", "ar": "ليس لديك اي ملاحظة تقدم"}, + "invoiceNo:": {"en": "Invoice No :", "ar": "رقم الفاتورة"}, + "generalResult": {"en": "General Result ", "ar": "النتيجة العامة"}, + "description": {"en": "Description", "ar": "الوصف"}, + "value": {"en": "Value", "ar": "القيمة"}, + "range": {"en": "Range", "ar": "النطاق"}, + "enterId": {"en": "User ID", "ar": "معرف المستخدم"}, + "pleaseEnterYourID": {"en": "Please enter your ID", "ar": "الرجاء ادخال الهوية"}, + "enterPassword": {"en": "Password", "ar": "كلمه السر"}, + "pleaseEnterPassword": {"en": "Please Enter Password", "ar": "الرجاء ادخال الرقم السري"}, + "selectYourProject": {"en": "Branch", "ar": "فرع"}, + "pleaseEnterYourProject": {"en": "Please Enter Your Project", "ar": "الرجاء ادخال مستشفى"}, + "login": {"en": "Login", "ar": "تسجيل دخول"}, + "drSulaimanAlHabib": {"en": "Dr Sulaiman Al Habib", "ar": "د.سليمان الحبيب"}, + "welcomeTo": {"en": "Welcome to", "ar": "مرحبا بك"}, + "welcomeBackTo": {"en": "Welcome Back to", "ar": "مرحبًا بعودتك الى "}, + "home": {"en": "Home", "ar": "الرئيسية"}, + "services": {"en": "Services", "ar": "الخدمات"}, + "sms": {"en": "SMS", "ar": "رسالة قصيرة"}, + "fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, + "faceId": {"en": "Face ID", "ar": "معرف الوجه"}, + "whatsAppBy": {"en": "by WhatsApp", "ar": "عن طريق واتس اب"}, + "whatsApp": {"en": "WhatsApp", "ar": "واتس اب"}, + "pleaseChoose": { + "en": "Please choose one of the Following option to verify", + "ar": "يرجى اختيار أحد الخيارات التالية للتحقق" }, - 'choose': {'en': 'Choose', 'ar': 'اختر'}, - 'verification': {'en': 'Verification', 'ar': 'طريقة التحقق'}, - 'firstStep': { - 'en': 'As a first step, you need to verify by one of those methods', - 'ar': 'كخطوة أولى ، تحتاج إلى التحقق بإحدى هذه الطرق' + "choose": {"en": "Choose", "ar": "اختر"}, + "verification": {"en": "Verification", "ar": "طريقة التحقق"}, + "firstStep": { + "en": "As a first step, you need to verify by one of those methods", + "ar": "كخطوة أولى ، تحتاج إلى التحقق بإحدى هذه الطرق" }, - 'yourAccount!': {'en': 'Your Account!', 'ar': 'حسابك!'}, - 'verify1': {'en': 'Verify', 'ar': 'ثبت'}, - 'youWillReceiveA': {'en': 'You will receive a', 'ar': 'سوف تتلقى '}, - 'loginCode': {'en': 'Login Code', 'ar': 'رمز تسجيل دخول'}, - 'smsBy': {'en': 'By SMS', 'ar': 'عن طريق رسالة قصيرة'}, - 'pleaseEnterTheCode': {'en': 'Please enter the code', 'ar': 'الرجاء ادخال الرمز'}, - 'youDon\'tHaveAnyPatient': { - 'en': 'No data found for the selected search criteria', - 'ar': 'لا توجد بيانات لمعايير البحث المختارة' + "yourAccount!": {"en": "Your Account!", "ar": "حسابك!"}, + "verify1": {"en": "Verify", "ar": "ثبت"}, + "youWillReceiveA": {"en": "You will receive a", "ar": "سوف تتلقى "}, + "loginCode": {"en": "Login Code", "ar": "رمز تسجيل دخول"}, + "smsBy": {"en": "By SMS", "ar": "عن طريق رسالة قصيرة"}, + "pleaseEnterTheCode": {"en": "Please enter the code", "ar": "الرجاء ادخال الرمز"}, + "youDontHaveAnyPatient": { + "en": "No data found for the selected search criteria", + "ar": "لا توجد بيانات لمعايير البحث المختارة" }, - 'age': {'en': 'Age', 'ar': 'العمر'}, - 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, - 'today': {'en': 'Today', 'ar': 'اليوم'}, - 'yesterday': {'en': 'Yesterday', 'ar': 'الأمس'}, - 'tomorrow': {'en': 'Tomorrow', 'ar': 'الغد'}, - 'nextWeek': {'en': 'Next Week', 'ar': 'الاسبوع القادم'}, - 'all': {'en': 'All', 'ar': 'الجميع'}, - 'errorNoInsuranceApprovals': {'en': 'You don\'t have any Insurance Approvals', 'ar': 'ليس لديك اي موفقات تأمين'}, - 'searchInsuranceApprovals': {'en': 'Search InsuranceApprovals', 'ar': 'بحث عن موافقات التأمين'}, - 'status': {'en': 'STATUS', 'ar': 'الحالة'}, - 'expiryDate': {'en': 'EXPIRY DATE', 'ar': 'تاريخ الانتهاء'}, - 'producerName': {'en': 'PRODUCER NAME', 'ar': 'اسم المنتج'}, - 'receiptOn': {'en': 'RECEIPT ON', 'ar': 'تاريخ الاستلام'}, - 'approvalNo': {'en': 'Approval No:', 'ar': 'رقم الموافقة:'}, - 'doctor': {'en': 'Doctor', 'ar': 'الدكتور'}, - 'ext': {'en': 'Ext#', 'ar': 'رقم التحويلة'}, - 'veryUrgent': {'en': 'Very Urgent', 'ar': 'عاجل جدا'}, - 'urgent': {'en': 'Urgent', 'ar': 'عاجل'}, - 'routine': {'en': 'Routine', 'ar': 'روتيني'}, - 'send': {'en': 'Send', 'ar': 'ارسال'}, - 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, - 'selectReferralFrequency': {'en': 'Select Referral Frequency:', 'ar': 'اختار تواتر الحالة:'}, - 'clinicalDetailsAndRemarks': {'en': 'Clinical Details and Remarks', 'ar': 'التفاصيل السرسرية والملاحظات'}, - 'remarks': {'en': 'Remarks', 'ar': 'ملاحظات'}, - 'pleaseFill': {'en': 'Please fill all fields..!', 'ar': 'الرجاء ملأ جميع الحقول..!'}, - 'replay2': {'en': 'Reply', 'ar': 'رد الطبيب'}, - 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, - 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'}, - 'price': {'en': 'Price', 'ar': 'السعر'}, - 'youCanFindItIn': {'en': 'You can Find it in', 'ar': 'تستطيع ان تجده هنا '}, - 'radiologyReport': {'en': 'Radiology Report', 'ar': 'تقرير الاشعة'}, - 'orders': {'en': 'Orders', 'ar': 'الطلبات'}, - 'list': {'en': 'List', 'ar': 'قائمة'}, - 'searchOrders': {'en': 'Search Orders', 'ar': ' بحث عن الطلبات'}, - 'prescriptionDetails': {'en': 'Prescription Details', 'ar': 'تفاصبل الوصفة'}, - 'prescriptionInfo': {'en': 'Prescription Info', 'ar': 'معلومات الوصفة'}, - 'errorNoOrders': {'en': 'You don\'t have any Orders', 'ar': 'لا يوجد لديك اي طلبات'}, - 'livecare': {'en': 'Live Care', 'ar': 'Live Care'}, - 'beingBad': {'en': 'being bad', 'ar': 'سيء'}, - 'beingGreat': {'en': 'being great', 'ar': 'رائع'}, - 'cancel': {'en': 'CANCEL', 'ar': 'الغاء'}, - 'ok': {'en': 'OK', 'ar': 'موافق'}, - 'done': {'en': 'DONE', 'ar': 'تأكيد'}, - 'resumecall': {'en': 'Resume call', 'ar': 'استئناف المكالمة'}, - 'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'}, - 'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'}, - 'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'}, - "searchMedicineImageCaption": {'en': 'Type the medicine name to search', 'ar': ' اكتب اسم الدواء للبحث'}, - "type": {'en': 'Type ', 'ar': 'اكتب'}, - "fromDate": {'en': 'From Date', 'ar': 'من تاريخ'}, - "toDate": {'en': 'To Date', 'ar': 'الى تاريخ'}, - "searchPatientImageCaptionTitle": {'en': 'SEARCH PATIENT', 'ar': 'البحث عن المريض'}, - "searchPatientImageCaptionBody": {'en': 'Add Details Of Patient To search', 'ar': ' أضف تفاصيل المريض للبحث'}, - "welcome": {'en': 'Welcome', 'ar': ' أهلا بك'}, - 'youDoNotHaveAnyItem': {'en': 'You don\'t have any Items', 'ar': 'لا يوجد اي نتائج'}, - 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, - 'moreThan3Letter': { - 'en': 'Medicine Name Should Be More Than 3 letter', - 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' + "age": {"en": "Age", "ar": "العمر"}, + "nationality": {"en": "Nationality", "ar": "الجنسية"}, + "today": {"en": "Today", "ar": "اليوم"}, + "yesterday": {"en": "Yesterday", "ar": "الأمس"}, + "tomorrow": {"en": "Tomorrow", "ar": "الغد"}, + "nextWeek": {"en": "Next Week", "ar": "الاسبوع القادم"}, + "all": {"en": "All", "ar": "الجميع"}, + "errorNoInsuranceApprovals": {"en": "You don\"t have any Insurance Approvals", "ar": "ليس لديك اي موفقات تأمين"}, + "searchInsuranceApprovals": {"en": "Search InsuranceApprovals", "ar": "بحث عن موافقات التأمين"}, + "status": {"en": "STATUS", "ar": "الحالة"}, + "expiryDate": {"en": "EXPIRY DATE", "ar": "تاريخ الانتهاء"}, + "producerName": {"en": "PRODUCER NAME", "ar": "اسم المنتج"}, + "receiptOn": {"en": "RECEIPT ON", "ar": "تاريخ الاستلام"}, + "approvalNo": {"en": "Approval No:", "ar": "رقم الموافقة:"}, + "doctor": {"en": "Doctor", "ar": "الدكتور"}, + "ext": {"en": "Ext#", "ar": "رقم التحويلة"}, + "veryUrgent": {"en": "Very Urgent", "ar": "عاجل جدا"}, + "urgent": {"en": "Urgent", "ar": "عاجل"}, + "routine": {"en": "Routine", "ar": "روتيني"}, + "send": {"en": "Send", "ar": "ارسال"}, + "referralFrequency": {"en": "Referral Frequency:", "ar": "تواتر الحالة:"}, + "selectReferralFrequency": {"en": "Select Referral Frequency:", "ar": "اختار تواتر الحالة:"}, + "clinicalDetailsAndRemarks": {"en": "Clinical Details and Remarks", "ar": "التفاصيل السرسرية والملاحظات"}, + "remarks": {"en": "Remarks", "ar": "ملاحظات"}, + "pleaseFill": {"en": "Please fill all fields..!", "ar": "الرجاء ملأ جميع الحقول..!"}, + "replay2": {"en": "Reply", "ar": "رد الطبيب"}, + "logout": {"en": "Logout", "ar": "تسجيل خروج"}, + "pharmaciesList": {"en": "Pharmacies List", "ar": "قائمة الصيدليات"}, + "price": {"en": "Price", "ar": "السعر"}, + "youCanFindItIn": {"en": "You can Find it in", "ar": "تستطيع ان تجده هنا "}, + "radiologyReport": {"en": "Radiology Report", "ar": "تقرير الاشعة"}, + "orders": {"en": "Orders", "ar": "الطلبات"}, + "list": {"en": "List", "ar": "قائمة"}, + "searchOrders": {"en": "Search Orders", "ar": " بحث عن الطلبات"}, + "prescriptionDetails": {"en": "Prescription Details", "ar": "تفاصبل الوصفة"}, + "prescriptionInfo": {"en": "Prescription Info", "ar": "معلومات الوصفة"}, + "errorNoOrders": {"en": "You don\"t have any Orders", "ar": "لا يوجد لديك اي طلبات"}, + "livecare": {"en": "Live Care", "ar": "Live Care"}, + "beingBad": {"en": "being bad", "ar": "سيء"}, + "beingGreat": {"en": "being great", "ar": "رائع"}, + "cancel": {"en": "CANCEL", "ar": "الغاء"}, + "ok": {"en": "OK", "ar": "موافق"}, + "done": {"en": "DONE", "ar": "تأكيد"}, + "resumecall": {"en": "Resume call", "ar": "استئناف المكالمة"}, + "endcallwithcharge": {"en": "End with charge", "ar": "انهاء مع خصم المبلغ"}, + "endcall": {"en": "End Call", "ar": "إنهاء المكالمة"}, + "transfertoadmin": {"en": "Transfer to admin", "ar": "تحويل للمشرف"}, + "searchMedicineImageCaption": {"en": "Type the medicine name to search", "ar": " اكتب اسم الدواء للبحث"}, + "type": {"en": "Type", "ar": "اكتب"}, + "fromDate": {"en": "From Date", "ar": "من تاريخ"}, + "toDate": {"en": "To Date", "ar": "الى تاريخ"}, + "searchPatientImageCaptionTitle": {"en": "SEARCH PATIENT", "ar": "البحث عن المريض"}, + "searchPatientImageCaptionBody": {"en": "Add Details Of Patient To search", "ar": " أضف تفاصيل المريض للبحث"}, + "welcome": {"en": "Welcome", "ar": "أهلا بك"}, + "youDoNotHaveAnyItem": {"en": "You don\"t have any Items", "ar": "لا يوجد اي نتائج"}, + "typeMedicineName": {"en": "Type Medicine Name", "ar": "اكتب اسم الدواء"}, + "moreThan3Letter": { + "en": "Medicine Name Should Be More Than 3 letter", + "ar": "يجب أن يكون اسم الدواء أكثر من 3 أحرف" }, - 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, - 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, - 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, + "gender2": {"en": "Gender: ", "ar": "الجنس: "}, + "age2": {"en": "Age: ", "ar": "العمر: "}, + "replySuccessfully": {"en": "Reply Successfully", "ar": "تم الرد بنجاح"}, "sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"}, "patient-sick": {"en": "Patient Sick", "ar": "مرضية"}, "leave": {"en": "Leave", "ar": "مغادره"}, @@ -219,207 +219,204 @@ const Map> localizedValues = { "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."}, "sick-leave-days": {"en": "Leave Days: ", "ar": " :أيام الإجازة"}, - 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, - 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, - 'date': {'en': 'Date', 'ar': 'التاريخ'}, - 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, - 'losNo': {'en': 'LOS #:', 'ar': 'LOS #:'}, - 'area': {'en': 'AREA:', 'ar': 'المنطقة'}, - 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, - 'bed': {'en': 'BED:', 'ar': 'السرير'}, - 'next': {'en': 'Next', 'ar': 'التالي'}, - 'previous': {'en': 'Previous', 'ar': 'السابق'}, - 'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'}, + "admissionDetail": {"en": "ADMISSION DETAIL: ", "ar": "تفاصيل القبول: "}, + "dateTime": {"en": "DATE / TIME:", "ar": "التاريخ / الوقت:"}, + "date": {"en": "Date", "ar": "التاريخ"}, + "admissionNo": {"en": "ADMISSION #: ", "ar": "قبول #:"}, + "losNo": {"en": "LOS #:", "ar": "LOS #:"}, + "area": {"en": "AREA:", "ar": "المنطقة"}, + "room": {"en": "ROOM:", "ar": "الغرفة"}, + "bed": {"en": "BED:", "ar": "السرير"}, + "next": {"en": "Next", "ar": "التالي"}, + "previous": {"en": "Previous", "ar": "السابق"}, + "healthRecordInformation": {"en": "HEALTH RECORD INFORMATION", "ar": "معلومات السجل الصحي"}, "prevoius-sickleave-issed": { "en": "Total previous sick leave issued by the doctor", "ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب" }, - 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, - 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, + "clinicSelect": {"en": "Select Clinic", "ar": "اختر عيادة"}, + "doctorSelect": {"en": "Select Doctor", "ar": "اختر طبيب"}, "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, - 'no-sickleve-applied': { - 'en': "No sick leave available, apply Now", - 'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن' + "no-sickleve-applied": { + "en": "No sick leave available, apply Now", + "ar": "لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن" }, - 'no-sickleve': {'en': "No sick leave available", 'ar': 'لا توجد إجازة مرضية'}, - 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, - 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, - 'add': {'en': "Add", 'ar': 'أضف'}, - 'approved': {'en': "Approved", 'ar': 'وافق'}, - 'extended': {'en': "Extended", 'ar': 'وسعوا'}, - 'pending': {'en': "Pending", 'ar': 'قيد الانتظار'}, - 'leave-start-date': {'en': "Leave start date", 'ar': 'تاريخ بدء المغادرة'}, - 'days-sick-leave': {'en': "DAYS OF SICK LEAVE", 'ar': 'أيام الإجازة المرضية'}, - 'extend': {'en': "Extend", 'ar': 'تمديد'}, - 'extend-sickleave': {'en': "EXTEND SICK LEAVE", 'ar': 'قم بتمديد الإجازة المرضية'}, + "no-sickleve": {"en": "No sick leave available", "ar": "لا توجد إجازة مرضية"}, + "applynow": {"en": "Apply Now", "ar": "التقدم بطلب الآن"}, + "add-sickleave": {"en": "Add Sick Leave", "ar": "أضف إجازة مرضية"}, + "add": {"en": "Add", "ar": "أضف"}, + "approved": {"en": "Approved", "ar": "موافق"}, + "extended": {"en": "Extended", "ar": "تمديد"}, + "pending": {"en": "Pending", "ar": "قيد الانتظار"}, + "leave-start-date": {"en": "Leave start date", "ar": "تاريخ بدء المغادرة"}, + "days-sick-leave": {"en": "Leave Days: ", "ar": "أيام الإجازة "}, + "extend": {"en": "Extend", "ar": "تمديد"}, + "extend-sickleave": {"en": "Extend Sick Leave", "ar": "قم بتمديد الإجازة المرضية"}, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", - "ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25" + "ar": "يجب أن يكون طول شكوى الرئيسية أكبر من 25" }, - 'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'}, - 'no-priscription-listed': {'en': 'No Prescription Listed', 'ar': 'لا وصفة طبية مدرجة'}, - 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, - 'referredFrom': {'en': "From : ", 'ar': ' : من'}, - 'branch': {'en': "Branch", 'ar': 'الفرع'}, - 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, - 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, - 'refer': {'en': "Refer", 'ar': 'إحالة'}, - 'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, - 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, - 'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'}, - 'dr': {'en': "DR.", 'ar': 'د.'}, - 'previewHealth': {'en': "Health", 'ar': 'الصحة'}, - 'summaryReport': {'en': "Summary", 'ar': 'موجز'}, - 'accept': {'en': "ACCEPT", 'ar': 'قبول'}, - 'reject': {'en': "REJECT", 'ar': 'رفض'}, - 'noAppointmentsErrorMsg': {'en': "There is no appointments for at this date", 'ar': 'لا توجد مواعيد في هذا التاريخ'}, - 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, - 'noPrescriptionListed': {'en': 'NO PRESCRIPTION LISTED', 'ar': 'لم يتم سرد أي وصف'}, - 'addNow': {'en': 'ADD Now', 'ar': 'اضف الآن'}, - 'orderType': {'en': 'Order Type', 'ar': 'نوع الطلب'}, - 'strength': {'en': 'Strength', 'ar': 'شدة'}, - 'doseTime': {'en': 'Dose Time', 'ar': 'وقت الجرعة'}, - 'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'}, - 'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'}, - 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, - 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, - 'route': {'en': 'Route', 'ar': 'المسار'}, - 'reschedule-leave': {'en': 'Reschedule and leaves', 'ar': 'إعادة الجدولة والأوراق'}, - 'no-reschedule-leave': {'en': 'No Reschedule and leaves', 'ar': 'لا إعادة جدولة ويغادر'}, - 'weight': {'en': "Weight", 'ar': 'الوزن'}, - 'kg': {'en': "kg", 'ar': 'كغ'}, - 'height': {'en': "Height", 'ar': 'الطول'}, - 'cm': {'en': "cm", 'ar': 'سم'}, - 'idealBodyWeight': {'en': "Ideal Body Weight", 'ar': 'وزن الجسم المثالي'}, - 'waistSize': {'en': "Waist Size", 'ar': 'مقاس الخصر'}, - 'inch': {'en': "Inch", 'ar': 'إنش'}, - 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, - 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, - 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': {'en': "Body Mass Index is", 'ar': 'مؤشر كتلة الجسم هو'}, - 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, - 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, - 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, - 'bmiObese': {'en': "Obese", 'ar': 'سمين'}, - 'bmiObeseExtreme': {'en': "Extreme Obese", 'ar': 'سمنة مفرطة'}, - 'method': {'en': "Method", 'ar': 'الطريقة'}, - 'pulseBeats': {'en': 'Pulse(beats/minute)', 'ar': ' (دقة/دقيقة)النبض'}, - 'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'}, - 'respBeats': {'en': 'RESP (beats/minute)', 'ar': ' (دقة/دقيقة)التنفس'}, - 'patternOfRespiration': {'en': "Pattern Of Respiration", 'ar': 'نمط التنفس'}, - 'bloodPressureDiastoleAndSystole': {'en': 'Blood Pressure (Sys, Dias)', 'ar': 'ضغط الدم (العظمى, الصغرى)'}, - 'cuffLocation': {'en': "Cuff Location", 'ar': 'موقع الكف'}, - 'cuffSize': {'en': "Cuff Size", 'ar': 'حجم الكف'}, - 'patientPosition': {'en': "Patient Position", 'ar': 'موقع المريض'}, - 'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'}, - 'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'}, - 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, - 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, - 'to': {'en': "To", 'ar': 'إلى'}, - 'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'}, - 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, - 'pleaseEnterDate': {'en': 'Please enter leave start date', 'ar': 'الرجاء إدخال تاريخ بدء الإجازة'}, - 'pleaseEnterNoOfDays': {'en': 'Please enter sick leave days', 'ar': 'الرجاء إدخال أيام الإجازة المرضية'}, - 'pleaseEnterRemarks': {'en': 'Please enter remarks', 'ar': 'الرجاء إدخال الملاحظات'}, - 'update': {'en': 'Update', 'ar': 'تحديث'}, - 'admission': {'en': "Admission", 'ar': 'قبول'}, - 'request': {'en': "Request", 'ar': 'طلب'}, - 'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'}, - 'patientDetails': {'en': "Patient Details", 'ar': 'تفاصيل المريض'}, - 'specialityAndDoctorDetail': {'en': "SPECIALITY AND DOCTOR DETAILS", 'ar': 'تفاصيل التخصص والطبيب'}, - 'referringDate': {'en': "Referring Date", 'ar': 'تاريخ الإحالة'}, - 'referringDoctor': {'en': "Referring Doctor", 'ar': 'دكتور الإحالة'}, - 'otherInformation': {'en': "Other Information", 'ar': 'معلومات أخرى'}, - 'expectedDays': {'en': "Expected Days", 'ar': 'الأيام المتوقعة'}, - 'expectedAdmissionDate': {'en': "Expected Admission Date", 'ar': 'تاريخ القبول المتوقع'}, - 'admissionDate': {'en': "Admission Date", 'ar': 'تاريخ القبول'}, - // 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, - 'isSickLeaveRequired': {'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة'}, - 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'المريض حامل'}, - 'treatmentLine': {'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج'}, - 'ward': {'en': "Ward", 'ar': 'رعاية'}, - 'preAnesthesiaReferred': {'en': "PRE ANESTHESIA REFERRED", 'ar': 'الاحالة قبل التخدير'}, - 'admissionType': {'en': "Admission Type", 'ar': 'نوع القبول'}, - 'diagnosis': {'en': "Diagnosis", 'ar': 'التشخيص'}, - 'allergies': {'en': "Allergies", 'ar': 'الحساسية'}, - 'preOperativeOrders': {'en': "Pre Operative Orders", 'ar': 'أوامر ما قبل العملية'}, - 'elementForImprovement': {'en': "Element For Improvement", 'ar': 'عنصر للتحسين'}, - 'dischargeDate': {'en': "Discharge Date", 'ar': 'تاريخ التفريغ'}, - 'dietType': {'en': "Diet Type", 'ar': 'نوع النظام الغذائي'}, - 'dietTypeRemarks': {'en': "Remarks on diet type", 'ar': 'ملاحظات على نوع النظام الغذائي'}, - 'save': {'en': "SAVE", 'ar': 'حفظ'}, - 'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, - 'postPlans': {'en': "POST PLANS", 'ar': 'خطط البريد'}, - 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, - 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, - 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, - 'chiefComplaintsAndSymptoms': { - 'en': "CHIEF COMPLAINTS", - 'ar': 'شكاوى الرئيس' - // 'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS", - // 'ar': 'شكاوى الرئيس وأعراض أخرى' + "patient-target": {"en": "Target Patient", "ar": "المريض المستدف"}, + "no-priscription-listed": {"en": "No Prescription Listed", "ar": "لا يوجد وصفة طبية مدرجة"}, + "referTo": {"en": "Refer To", "ar": "محال إلى"}, + "referredFrom": {"en": "From : ", "ar": " : من"}, + "branch": {"en": "Branch", "ar": "الفرع"}, + "chooseAppointment": {"en": "Choose Appointment", "ar": "اختر موعد"}, + "appointmentNo": {"en": "Appointment # : ", "ar": "# الموعد:"}, + "refer": {"en": "Refer", "ar": "إحالة"}, + "rejected": {"en": "Rejected", "ar": "مرفوض"}, + "sameBranch": {"en": "Same Branch", "ar": "نفس الفرع"}, + "otherBranch": {"en": "Other Branch", "ar": "فرع آخر"}, + "dr": {"en": "DR.", "ar": "د."}, + "previewHealth": {"en": "Health", "ar": "الصحة"}, + "summaryReport": {"en": "Summary", "ar": "ملخص"}, + "accept": {"en": "ACCEPT", "ar": "قبول"}, + "reject": {"en": "REJECT", "ar": "رفض"}, + "noAppointmentsErrorMsg": {"en": "There is no appointments for at this date", "ar": "لا توجد مواعيد في هذا التاريخ"}, + "referralPatient": {"en": "Referral Patient", "ar": "المريض المحال "}, + "noPrescriptionListed": {"en": "NO PRESCRIPTION LISTED", "ar": "لأيوجد وصفة طبية"}, + "addNow": {"en": "ADD Now", "ar": "اضف الآن"}, + "orderType": {"en": "Order Type", "ar": "نوع الطلب"}, + "strength": {"en": "Strength", "ar": "شديد"}, + "doseTime": {"en": "Dose Time", "ar": "وقت الجرعة"}, + "indication": {"en": "Indication", "ar": "دواعي الاستخدام"}, + "duration": {"en": "Duration", "ar": "الفترة"}, + "instruction": {"en": "Instructions", "ar": "إرشادات"}, + "addMedication": {"en": "Add Medication", "ar": "اضف دواء"}, + "route": {"en": "Route", "ar": "طريقة الاستخدام"}, + "reschedule-leave": {"en": "Reschedule and leaves", "ar": "إعادة الجدولة والمغادرة"}, + "no-reschedule-leave": {"en": "No Reschedule and leaves", "ar": "لايوجد طلبات اعادة جدولة او مغادرة"}, + "weight": {"en": "Weight", "ar": "الوزن"}, + "kg": {"en": "kg", "ar": "كغ"}, + "height": {"en": "Height", "ar": "الطول"}, + "cm": {"en": "cm", "ar": "سم"}, + "idealBodyWeight": {"en": "Ideal Body Weight", "ar": "وزن الجسم المثالي"}, + "waistSize": {"en": "Waist Size", "ar": "مقاس الخصر"}, + "inch": {"en": "Inch", "ar": "إنش"}, + "headCircum": {"en": "Head Circum", "ar": "محيط الرأس"}, + "leanBodyWeight": {"en": "Lean Body Weight", "ar": "وزن الجسم هزيل"}, + "bodyMassIndex": {"en": "Body Mass Index", "ar": "مؤشر كتلة الجسم"}, + "yourBodyMassIndex": {"en": "Body Mass Index is", "ar": "مؤشر كتلة الجسم هو"}, + "bmiUnderWeight": {"en": "UnderWeight", "ar": "اقل من الوزن المثالي"}, + "bmiHealthy": {"en": "Healthy", "ar": "صحي"}, + "bmiOverWeight": {"en": "OverWeight", "ar": "اعلى من الوزن المثالي"}, + "bmiObese": {"en": "Obese", "ar": "سمين"}, + "bmiObeseExtreme": {"en": "Extreme Obese", "ar": "سمنة مفرطة"}, + "method": {"en": "Method", "ar": "الطريقة"}, + "pulseBeats": {"en": "Pulse(beats/minute)", "ar": " (دقة/دقيقة)النبض"}, + "rhythm": {"en": "Rhythm", "ar": "الإيقاع"}, + "respBeats": {"en": "RESP (beats/minute)", "ar": " (دقة/دقيقة)التنفس"}, + "patternOfRespiration": {"en": "Pattern Of Respiration", "ar": "نمط التنفس"}, + "bloodPressureDiastoleAndSystole": {"en": "Blood Pressure (Sys, Dias)", "ar": "ضغط الدم (الانقباض, الإنبساط)"}, + "cuffLocation": {"en": "Cuff Location", "ar": "موقع الكف"}, + "cuffSize": {"en": "Cuff Size", "ar": "حجم الكف"}, + "patientPosition": {"en": "Patient Position", "ar": "موقع المريض"}, + "fio2": {"en": "FIO2(%)", "ar": "FIO2(%)"}, + "sao2": {"en": "SAO2(%)", "ar": "SAO2(%)"}, + "painManagement": {"en": "Pain Management", "ar": "إدارة الألم"}, + "holiday": {"en": "Holiday", "ar": "عطلة"}, + "to": {"en": "To", "ar": "إلى"}, + "coveringDoctor": {"en": "Covering Doctor: ", "ar": " :تغطية دكتور"}, + "requestLeave": {"en": "Request Leave", "ar": "طلب إجازة"}, + "pleaseEnterDate": {"en": "Please enter leave start date", "ar": "الرجاء إدخال تاريخ بدء الإجازة"}, + "pleaseEnterNoOfDays": {"en": "Please enter sick leave days", "ar": "الرجاء إدخال أيام الإجازة المرضية"}, + "pleaseEnterRemarks": {"en": "Please enter remarks", "ar": "الرجاء إدخال الملاحظات"}, + "update": {"en": "Update", "ar": "تحديث"}, + "admission": {"en": "Admission", "ar": "تنويم"}, + "request": {"en": "Request", "ar": "طلب"}, + "admissionRequest": {"en": "Admission Request", "ar": "طلب تنويم"}, + "patientDetails": {"en": "Patient Details", "ar": "تفاصيل المريض"}, + "specialityAndDoctorDetail": {"en": "SPECIALITY AND DOCTOR DETAILS", "ar": "تفاصيل التخصص والطبيب"}, + "referringDate": {"en": "Referring Date", "ar": "تاريخ الإحالة"}, + "referringDoctor": {"en": "Referring Doctor", "ar": "دكتور الإحالة"}, + "otherInformation": {"en": "Other Information", "ar": "معلومات أخرى"}, + "expectedDays": {"en": "Expected Days", "ar": "الأيام المتوقعة"}, + "expectedAdmissionDate": {"en": "Expected Admission Date", "ar": "تاريخ التنويم المتوقع"}, + "admissionDate": {"en": "Admission Date", "ar": "تاريخ التنويم"}, + "isSickLeaveRequired": {"en": "Is Sick Leave Required", "ar": "هل الإجازة المرضية مطلوبة"}, + "patientPregnant": {"en": "Patient Pregnant", "ar": "المريض حامل"}, + "treatmentLine": {"en": "Main line of treatment", "ar": "الخط الرئيسي للعلاج"}, + "ward": {"en": "Ward", "ar": "جناح"}, + "preAnesthesiaReferred": {"en": "PRE ANESTHESIA REFERRED", "ar": "الاحالة قبل التخدير"}, + "admissionType": {"en": "Admission Type", "ar": "نوع التنويم"}, + "diagnosis": {"en": "Diagnosis", "ar": "التشخيص"}, + "allergies": {"en": "Allergies", "ar": "الحساسية"}, + "preOperativeOrders": {"en": "Pre Operative Orders", "ar": "أوامر ما قبل العملية"}, + "elementForImprovement": {"en": "Element For Improvement", "ar": "عنصر للتحسين"}, + "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ الخروج"}, + "dietType": {"en": "Diet Type", "ar": "نوع النظام الغذائي"}, + "dietTypeRemarks": {"en": "Remarks on diet type", "ar": "ملاحظات على نوع النظام الغذائي"}, + "save": {"en": "SAVE", "ar": "حفظ"}, + "postPlansEstimatedCost": {"en": "POST PLANS & ESTIMATED COST", "ar": "خطط ما بعد العملية والتكلفة المقدرة"}, + "postPlans": {"en": "POST PLANS", "ar": "ما بعد العملية"}, + "ucaf": {"en": "UCAF", "ar": "UCAF"}, + "emergencyCase": {"en": "Emergency Case", "ar": "حالة طارئة"}, + "durationOfIllness": {"en": "duration Of Illness", "ar": "مدة المرض"}, + "chiefComplaintsAndSymptoms": {"en": "CHIEF COMPLAINTS", "ar": "الشكوى الرئيسية"}, + "patientFeelsPainInHisBackAndCough": { + "en": "Patient Feels pain in his back and cough", + "ar": "يشعر المريض بألم في ظهره ويسعل" }, - 'patientFeelsPainInHisBackAndCough': { - 'en': "Patient Feels pain in his back and cough", - 'ar': 'يشعر المريض بألم في ظهره ويسعل' + "additionalTextComplaints": { + "en": "Additional text to add about Complaints", + "ar": "ملاحظات اخرى لإضافتها حول الشكوى" }, - 'additionalTextComplaints': {'en': "Additional text to add about Complaints", 'ar': 'نص إضافي لإضافته حول الشكاوى'}, - 'otherConditions': {'en': "OTHER CONDITIONS", 'ar': 'شروط أخرى'}, - 'other': {'en': "Other", 'ar': 'أخرى'}, - 'how': {'en': "How", 'ar': 'كيف'}, - 'when': {'en': "When", 'ar': 'متى'}, - 'where': {'en': "Where", 'ar': 'أين'}, - 'specifyPossibleLineManagement': {'en': "Specify possible line of management", 'ar': 'حدد خط الإدارة المحتمل'}, - 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, - 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, - 'reasons': {'en': "Reasons", 'ar': 'الأسباب'}, - 'createNew': {'en': "Create", 'ar': 'انشاء '}, - 'episode': {'en': "Episode", 'ar': 'Episode'}, - 'chiefComplaints': {'en': "Chief Complaints", 'ar': 'الشكاوى'}, - 'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'}, - 'histories': {'en': "Histories", 'ar': 'التاريخ المرضي'}, - 'allergiesSoap': {'en': "Allergies", 'ar': 'الحساسية'}, - 'historyOfPresentIllness': {'en': "History of Present Illness", 'ar': 'تاريخ المرض الحالي'}, - 'requiredMsg': {'en': "Please add required field correctly", 'ar': "الرجاء إضافة الحقل المطلوب بشكل صحيح"}, - 'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"}, - 'searchHistory': {'en': "Search History", 'ar': " البحث"}, - 'addSelectedHistories': {'en': "Add Selected Histories", 'ar': " اضافه تاريخ مرضي"}, - 'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"}, - 'itemExist': {'en': "This item already exist", 'ar': "هذا العنصر موجود"}, - 'selectAllergy': {'en': "Select Allergy", 'ar': "أختر الحساسية"}, - 'selectSeverity': {'en': "Select Severity", 'ar': "أختر الدرجه"}, - 'leaveCreated': {'en': "Leave has been created", 'ar': "تم إنشاء الإجازة"}, - 'medications': {'en': "Medications", 'ar': "الأدوية"}, - 'procedures': {'en': "Procedures", 'ar': "الإجراءات"}, - 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar': "لا توجد علامات حيوية لهذا المريض"}, - 'referralEmptyMsg': {'en': "There is no referral data", 'ar': "لا توجد بيانات إحالة"}, - 'referralSuccessMsg': {'en': "You make referral successfully", 'ar': "You make referral successfully"}, - 'fromTime': {'en': "From Time", 'ar': "من وقت"}, - 'toTime': {'en': "To Time", 'ar': "الى وقت"}, - 'diagnoseType': {'en': "Diagnose Type", 'ar': "نوع التشخيص"}, - 'condition': {'en': "Condition", 'ar': "الحالة"}, - 'id': {'en': "ID", 'ar': "بطاقة هوية"}, - 'quantity': {'en': "Quantity", 'ar': "الكمية"}, - 'durDays': {'en': "Dur.(days)", 'ar': "الفترة(أيام)"}, - 'codeNo': {'en': "Code #", 'ar': "# الرمز"}, - 'covered': {'en': "Covered", 'ar': "مغطى"}, - 'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"}, - 'uncoveredByDoctor': {'en': "Uncovered By Doctor", 'ar': "غير مغطى من قبل الدكتور"}, - 'chiefComplaintEmptyMsg': {'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس"}, - "more-verify": {"en": "More Verification \n Options", "ar": "المزيد من خيارات التحقق"}, - "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, + "otherConditions": {"en": "OTHER CONDITIONS", "ar": "شروط أخرى"}, + "other": {"en": "Other", "ar": "أخرى"}, + "how": {"en": "How", "ar": "كيف"}, + "when": {"en": "When", "ar": "متى"}, + "where": {"en": "Where", "ar": "أين"}, + "specifyPossibleLineManagement": {"en": "Specify possible line of management", "ar": "حدد خط الإدارة المحتمل"}, + "significantSigns": {"en": "SIGNIFICANT SIGNS", "ar": "علامات مهمة"}, + "backAbdomen": {"en": "Back : Abdomen", "ar": "الظهر: البطن"}, + "reasons": {"en": "Reasons", "ar": "الأسباب"}, + "createNew": {"en": "Create", "ar": "انشاء "}, + "episode": {"en": "Episode", "ar": "الحدث"}, + "chiefComplaints": {"en": "Chief Complaints", "ar": "الشكاوى"}, + "addChiefComplaints": {"en": "Add Chief Complaints", "ar": " اضافه الشكاوى"}, + "histories": {"en": "Histories", "ar": "التاريخ المرضي"}, + "allergiesSoap": {"en": "Allergies", "ar": "الحساسية"}, + "historyOfPresentIllness": {"en": "History of Present Illness", "ar": "تاريخ المرض الحالي"}, + "requiredMsg": {"en": "Please add required field correctly", "ar": "الرجاء إضافة الحقل المطلوب بشكل صحيح"}, + "addHistory": {"en": "Add History", "ar": "اضافه تاريخ مرضي"}, + "searchHistory": {"en": "Search History", "ar": " البحث"}, + "addSelectedHistories": {"en": "Add Selected Histories", "ar": " اضافه تاريخ مرضي"}, + "addAllergies": {"en": "Add Allergies", "ar": "أضف الحساسية"}, + "itemExist": {"en": "This item already exist", "ar": "هذا العنصر موجود"}, + "selectAllergy": {"en": "Select Allergy", "ar": "أختر الحساسية"}, + "selectSeverity": {"en": "Select Severity", "ar": "حدد الخطورة"}, + "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, + "medications": {"en": "Medications", "ar": "الأدوية"}, + "procedures": {"en": "Procedures", "ar": "الإجراءات"}, + "vitalSignEmptyMsg": {"en": "There is no vital signs for this patient", "ar": "لا توجد علامات حيوية لهذا المريض"}, + "referralEmptyMsg": {"en": "There is no referral data", "ar": "لا توجد بيانات إحالة"}, + "referralSuccessMsg": {"en": "You make referral successfully", "ar": "تمت الاحالة بنجاح"}, + "fromTime": {"en": "From Time", "ar": "من وقت"}, + "toTime": {"en": "To Time", "ar": "الى وقت"}, + "diagnoseType": {"en": "Diagnose Type", "ar": "نوع التشخيص"}, + "condition": {"en": "Condition", "ar": "الحالة"}, + "id": {"en": "ID", "ar": "بطاقة هوية"}, + "quantity": {"en": "Quantity", "ar": "الكمية"}, + "durDays": {"en": "Dur.(days)", "ar": "الفترة(أيام)"}, + "codeNo": {"en": "Code #", "ar": "# الرمز"}, + "covered": {"en": "Covered", "ar": "مغطى"}, + "approvalRequired": {"en": "Approval Required", "ar": "الموافقة مطلوبة"}, + "uncoveredByDoctor": {"en": "Uncovered By Doctor", "ar": "غير مغطى من قبل الدكتور"}, + "chiefComplaintEmptyMsg": {"en": "There is no Chief Complaint", "ar": "ليس هناك شكوى رئيسية"}, + "more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"}, + "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بك!"}, "account-info": { "en": "Would you like to login with current username?", "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟" }, - "another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"}, + "another-acc": {"en": "Use Another Account", "ar": "استخدم حساب آخر"}, "verify-login-with": { "en": "Please choose one of the following options to verify", - "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" + "ar": "الرجاء اختيار احدى الخيارات التالية لعملية التحقق" }, "register-user": {"en": "Register", "ar": "تسجيل"}, - "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, - "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, + "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة الاصبع"}, + "verify-with-faceid": {"en": "Face ID", "ar": "بصمة الوجه"}, "verify-with-sms": {"en": " SMS", "ar": "الرسائل القصيرة"}, "verify-with-whatsapp": {"en": "WhatsApp", "ar": " الواتس اب"}, "verify-with": {"en": "Verify through ", "ar": " الواتس اب"}, @@ -427,24 +424,24 @@ const Map> localizedValues = { "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { "en": "To activate the fingerprint login service, please verify data by using one of the following options.", - "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" + "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية" }, "verification_message": { "en": "Please enter the Verification Code sent to", "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" }, "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, - 'addAssessment': {'en': "Add Assessment", 'ar': "أضف التقييم"}, - 'assessment': {'en': "Assessment", 'ar': " التقييم"}, - 'physicalSystemExamination': {'en': "Physical System / Examination", 'ar': "الفحص البدني / النظام"}, - 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, - 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, - 'doc': {'en': "Doc : ", 'ar': " د : "}, - 'patientNoDetailErrMsg': {'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض"}, - 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, - 'normal': {'en': "Normal", 'ar': "عادي"}, - 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, - 'notExamined': {'en': "Not Examined", 'ar': "لم يتم الفحص"}, + "addAssessment": {"en": "Add Assessment", "ar": "أضف التقييم"}, + "assessment": {"en": "Assessment", "ar": " التقييم"}, + "physicalSystemExamination": {"en": "Physical System / Examination", "ar": "الفحص البدني / النظام"}, + "searchExamination": {"en": "Search Examination", "ar": "بحث عن فحص"}, + "addExamination": {"en": "Add Examination", "ar": "اضافة فحص"}, + "doc": {"en": "Doc : ", "ar": " د : "}, + "patientNoDetailErrMsg": {"en": "There is no detail for this patient", "ar": "لا توجد تفاصيل لهذا المريض"}, + "allergicTO": {"en": "ALLERGIC TO ", "ar": "حساس من"}, + "normal": {"en": "Normal", "ar": "عادي"}, + "abnormal": {"en": "Abnormal", "ar": " غير عادي"}, + "notExamined": {"en": "Not Examined", "ar": "لم يتم الفحص"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, @@ -453,139 +450,134 @@ const Map> localizedValues = { "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, - 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, - 'heart': {'en': 'Heart rate', 'ar': 'معدل ضربات القلب'}, - 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, - 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, - 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, - 'regular': {'en': "Regular", 'ar': "اعتيادي"}, - 'addMoreProcedure': {'en': "Add More Procedures", 'ar': "اضف المزيد من العمليات"}, - 'searchProcedures': {'en': "Search Procedures", 'ar': "البحث في العمليات"}, - 'selectProcedures': {'en': "Select procedure", 'ar': "اختر العملية"}, - 'procedureCategorise': {'en': "Select Procedure Category", 'ar': "اختر صنف العمليات "}, - 'addSelectedProcedures': {'en': "add Selected Procedures", 'ar': "اضافة العمليات المختارة "}, - 'addProcedures': {'en': "Add Procedure", 'ar': "اضافة العمليات"}, - 'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"}, - 'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"}, - 'nameOrICD': {'en': "Name or ICD", 'ar': "الاسم او  ICD"}, - 'dType': {'en': "Type", 'ar': "النوع"}, - 'addAssessmentDetails': {'en': "Add Assessment Details", 'ar': "أضف تفاصيل التقييم"}, - 'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"}, - 'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"}, - 'createdBy': {'en': "Created By :", 'ar': "أضيفت من قبل : "}, - 'editedBy': {'en': "Edited By :", 'ar': "عدلت من قبل : "}, - 'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"}, - 'noItem': {'en': "No items exists in this list", 'ar': "لا توجد عناصر في هذه القائمة"}, - 'postUcafSuccessMsg': {'en': "UCAF request send successfully", 'ar': "تم ارسال طلب UCAF بنجاح"}, - 'vitalSignDetailEmpty': {'en': "There is no data for this vital sign", 'ar': "لا توجد بيانات لهذه العلامة الحيوية"}, - 'onlyOfftimeHoliday': { - 'en': "You can only apply holiday or offtime from mobile app", - 'ar': "يمكنك فقط تطبيق عطلة أو إجازة من تطبيق الهاتف" + "respirationRate": {"en": "Respiration Rate", "ar": "معدل التنفس"}, + "heart": {"en": "Heart rate", "ar": "معدل ضربات القلب"}, + "medicalReport": {"en": "medical Report", "ar": "تقرير طبي"}, + "visitDate": {"en": "Visit Date", "ar": "تاريخ الزيارة"}, + "test": {"en": "Procedures/Test", "ar": "اجراءات/تحاليل"}, + "regular": {"en": "Regular", "ar": "اعتيادي"}, + "addMoreProcedure": {"en": "Add More Procedures", "ar": "اضف المزيد من اجراءات"}, + "searchProcedures": {"en": "Search Procedures", "ar": "البحث في اجراءات"}, + "selectProcedures": {"en": "Select procedure", "ar": "اختر الاجراء"}, + "procedureCategorise": {"en": "Select Procedure Category", "ar": "اختر نوع الاجراء "}, + "addSelectedProcedures": {"en": "add Selected Procedures", "ar": "اضافة الاجراءات المختارة "}, + "addProcedures": {"en": "Add Procedure", "ar": "اضافة اجراء"}, + "updateProcedure": {"en": "Update Procedure", "ar": "تحديث الاجراء"}, + "orderProcedure": {"en": "order procedure", "ar": "طلب اجراء"}, + "nameOrICD": {"en": "Name or ICD", "ar": "Name or ICD"}, + "dType": {"en": "Type", "ar": "النوع"}, + "addAssessmentDetails": {"en": "Add Assessment Details", "ar": "أضف تفاصيل التقييم"}, + "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, + "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, + "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, + "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, + "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, + "noItem": {"en": "No items exists in this list", "ar": "لا توجد عناصر في هذه القائمة"}, + "postUcafSuccessMsg": {"en": "UCAF request send successfully", "ar": "تم ارسال طلب UCAF بنجاح"}, + "vitalSignDetailEmpty": {"en": "There is no data for this vital sign", "ar": "لا توجد بيانات لهذه العلامة الحيوية"}, + "onlyOfftimeHoliday": { + "en": "You can only apply holiday or offtime from mobile app", + "ar": "يمكنك تقديم عطلة أو إجازة فقط" }, - 'active': {'en': "Active", 'ar': "نشيط"}, - 'hold': {'en': "Hold", 'ar': "معلق"}, - 'loading': {'en': "Loading...", 'ar': "جار التحميل..."}, - 'assessmentErrorMsg': { - 'en': "You have to add at least one assessment.", - 'ar': "يجب عليك إضافة تقييم واحد على الأقل." + "active": {"en": "Active", "ar": "نشيط"}, + "hold": {"en": "Hold", "ar": "معلق"}, + "loading": {"en": "Loading...", "ar": "جار التحميل..."}, + "assessmentErrorMsg": { + "en": "You have to add at least one assessment.", + "ar": "يجب عليك إضافة تقييم واحد على الأقل." }, - 'examinationErrorMsg': { - 'en': "You have to add at least one examination.", - 'ar': "يجب عليك إضافة الفحص واحد على الأقل." + "examinationErrorMsg": { + "en": "You have to add at least one examination.", + "ar": "يجب عليك إضافة فحص واحد على الأقل." }, - 'progressNoteErrorMsg': {'en': "You have to add progress Note.", 'ar': "يجب عليك إضافة ملاحظة التقدم."}, - 'chiefComplaintErrorMsg': { - 'en': "You have to add chief complaint fields correctly .", - 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" + "progressNoteErrorMsg": {"en": "You have to add progress Note.", "ar": "يجب عليك إضافة ملاحظة التقدم."}, + "chiefComplaintErrorMsg": { + "en": "You have to add chief complaint fields correctly .", + "ar": "يجب عليك إضافة الشكوى الرئيسية بشكل صحيح" }, - 'referralStatus': {'en': "Referral Status : ", 'ar': "حالة الإحالة :"}, - 'referralRemark': {'en': "Referral Remark : ", 'ar': "ملاحظة الإحالة :"}, - 'ICDName': {'en': "ICDName", 'ar': "اسم ال ICD"}, - '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': "بحث عن طبيب"}, - 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, - 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, - 'diagnosisDetail': {'en': "Diagnosis Details", 'ar': "تفاصيل التشخيص"}, - 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, - 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, - 'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"}, - 'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"}, - 'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"}, - 'complications': {'en': "Complications", 'ar': "المضاعفات"}, - 'floor': {'en': "Floor", 'ar': "الطابق"}, - 'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"}, - 'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"}, - 'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"}, - 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"}, - // 'icd': {'en': "ICD", 'ar': " "}, - 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, - 'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"}, - 'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"}, - 'sickleaveonhold': { - 'en': "A Sick leave is on Hold status for this patient", - 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" + "referralStatus": {"en": "Referral Status : ", "ar": "حالة الإحالة :"}, + "referralRemark": {"en": "Referral Remark : ", "ar": "ملاحظة الإحالة :"}, + "ICDName": {"en": "ICDName", "ar": "اسم ال ICD"}, + "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": "بحث عن طبيب"}, + "referralResponse": {"en": "Referral Response : ", "ar": " : استجابة الإحالة"}, + "estimatedCost": {"en": "Estimated Cost", "ar": "التكلفة المتوقعة"}, + "diagnosisDetail": {"en": "Diagnosis Details", "ar": "تفاصيل التشخيص"}, + "referralSuccessMsgAccept": {"en": "Referral Accepted Successfully", "ar": "تم قبول الإحالة بنجاح"}, + "referralSuccessMsgReject": {"en": "Referral Rejected Successfully", "ar": "تم رفض الإحالة بنجاح"}, + "sickLeaveComments": {"en": "Sick leave comments", "ar": "ملاحظات الإجازة المرضية"}, + "pastMedicalHistory": {"en": "Past medical history", "ar": "التاريخ الطبي"}, + "pastSurgicalHistory": {"en": "Past surgical history", "ar": "التاريخ الجراحي"}, + "complications": {"en": "Complications", "ar": "المضاعفات"}, + "floor": {"en": "Floor", "ar": "الطابق"}, + "roomCategory": {"en": "Room category", "ar": "فئة الغرفة"}, + "otherDepartmentsInterventions": {"en": "Other departments interventions", "ar": "ملاحظات الأقسام الأخرى"}, + "otherProcedure": {"en": "Other procedure", "ar": "إجراء آخر"}, + "admissionRequestSuccessMsg": {"en": "Admission Request Created Successfully", "ar": "تم إنشاء طلب التنويم بنجاح"}, + "orderNo": {"en": "Order No : ", "ar": "رقم الطلب"}, + "infoStatus": {"en": "Info Status", "ar": "حالة المعلومات"}, + "doctorResponse": {"en": "Doctor Response", "ar": "استجابة الطبيب"}, + "sickleaveonhold": { + "en": "A Sick leave is on Hold status for this patient", + "ar": "الإجازة المرضية في حالة الانتظار لهذا المريض" }, - 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, - 'otherStatistic': {'en': "Other Statistics", 'ar': "إحصائيات أخرى"}, - 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "إحالات المريض"}, - 'myPatientsReferral': {'en': "Patient's\nReferrals", 'ar': "إحالات\nالمريض"}, - 'arrivalpatient': {'en': "Arrival Patients", 'ar': "المرضى القادمون"}, - 'searchmedicinepatient': {'en': "Search patient or Medicines", 'ar': "ابحث عن المريض أو الأدوية"}, - 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, - 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, - 'details': {'en': 'Details', 'ar': 'التفاصيل'}, + "no-clinic": {"en": "No Clinic", "ar": "لايوجد عيادة"}, + "otherStatistic": {"en": "Other Statistics", "ar": "إحصائيات أخرى"}, + "ptientsreferral": {"en": "Patients Referrals", "ar": "إحالات المريض"}, + "myPatientsReferral": {"en": "Patient's\nReferrals", "ar": "إحالات\nالمريض"}, + "arrivalpatient": {"en": "Arrival Patients", "ar": "المرضى الواصلون"}, + "searchmedicinepatient": {"en": "Search patient or Medicines", "ar": "ابحث عن المريض أو الأدوية"}, + "appointmentDate": {"en": "Appointment Date", "ar": "تاريخ الموعد"}, + "arrived_p": {"en": "Arrived", "ar": "وصل"}, + "details": {"en": "Details", "ar": "التفاصيل"}, "liveCare": {"en": "LiveCare", "ar": "لايف كير"}, "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "sendSuc": {"en": "A copy has been sent to the email", "ar": "تم إرسال نسخة إلى البريد الإلكتروني"}, - "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, + "SpecialResult": {"en": "Special Result", "ar": "نتيجة خاصة"}, "noDataAvailable": {"en": "No data available", "ar": " لا يوجد بيانات متاحة "}, - "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - + "show-more-btn": {"en": "Flowchart", "ar": "النتائج التراكمية"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, - - 'fileNumber': {'en': "File Number: ", 'ar': "رقم الملف : "}, - 'searchPatient-name': {'en': 'Search Name, Medical File, Phone Number', 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف"}, - 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة الجدولة'}, - 'leaves': {'en': 'Leaves', 'ar': 'يغادر'}, + "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, + "searchPatient-name": {"en": "Search Name, Medical File, Phone Number", "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف"}, + "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, + "leaves": {"en": "Leaves", "ar": "يغادر"}, "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, - "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, + "usageStatus": {"en": "Usage Status", "ar": "حالة الاستخدام"}, "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, - "searchWithOther": {"en": "Search With Other Criteria", "ar": "البحث بمعايير أخرى"}, - "hideOtherCriteria": {"en": "Hide Other Criteria", "ar": "إخفاء المعايير الأخرى"}, + "searchWithOther": {"en": "Search With Other Criteria", "ar": "المزيد من خيارات البحث"}, + "hideOtherCriteria": {"en": "Hide Other Criteria", "ar": "إخفاء الخيارات الأخرى"}, "applyForReschedule": {"en": "Apply for leave or reschedule", "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة"}, "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, - "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, "addSickLeaveRequest": {"en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية"}, "extendSickLeaveRequest": {"en": "Extend Sick Leave Request", "ar": "تمديد طلب الإجازة المرضية"}, - "accepted": {"en": "Accepted", "ar": "وافقت"}, - "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, + "accepted": {"en": "Accepted", "ar": "موافق"}, + "cancelled": {"en": "Cancelled", "ar": "ألغي"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, "searchHere": {"en": "Search here", "ar": "إبحث هنا"}, "replied": {"en": "Replied", "ar": " تم الرد"}, @@ -593,7 +585,7 @@ const Map> localizedValues = { "remove": {"en": "Remove", "ar": "حذف"}, "changeOfSchedule": {"en": "Change of Schedule", "ar": "تغيير الجدول"}, "newSchedule": {"en": "New Schedule", "ar": "جدول جديد"}, - "enter_credentials": {"en": "Enter the user credentials below", "ar": "أدخل بيانات اعتماد المستخدم أدناه"}, + "enter_credentials": {"en": "Enter the user credentials below", "ar": "أدخل بيانات المستخدم أدناه"}, "step": {"en": "Step", "ar": "خطوة"}, "fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"}, "applyOrRescheduleLeave": {"en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة"}, @@ -604,48 +596,45 @@ const Map> localizedValues = { }, "updateNow": {"en": "Update Now", "ar": "تحديث الان"}, "updateTheApp": {"en": "Update The App", "ar": "تحديث التطبيق"}, - "admission-date": {"en": "Admission Date", "ar": "تاريخ القبول"}, + "admission-date": {"en": "Admission Date", "ar": "تاريخ التنويم"}, "noOfDays": {"en": "No of days", "ar": "عدد الأيام"}, "numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"}, "replayBefore": {"en": "Replay Before", "ar": "رد قبل"}, - "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, + "try-saying": {"en": "Try saying something", "ar": "حاول قول شيء ما"}, "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, "didntCatch": {"en": "Didn't catch that. Try Speaking again", "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى"}, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, "pleaseEnterProcedure": {"en": "Please Enter Procedure", "ar": "الرجاء إدخال الإجراء "}, - "fillTheMandatoryProcedureDetails": { - "en": "Fill The Mandatory Procedure Details", - "ar": "املأ تفاصيل الإجراء الإلزامي" - }, + "fillTheMandatoryProcedureDetails": {"en": "Fill The Mandatory Procedure Details", "ar": "املأ تفاصيل الإجراء"}, "atLeastThreeCharacters": {"en": "At least three Characters", "ar": "ثلاثة أحرف على الأقل "}, "searchProcedureHere": {"en": "Search Procedure here...", "ar": "إجراء البحث هنا ... "}, "noInsuranceApprovalFound": {"en": "No Insurance Approval Found", "ar": "لم يتم العثور على موافقة التأمين"}, - "procedure": {"en": "Procedure", "ar": "عملية"}, + "procedure": {"en": "Procedure", "ar": "اجراء"}, "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, "processed": {"en": "processed", "ar": "معالجتها"}, - "direction": {"en": "Direction", "ar": "إشراف"}, + "direction": {"en": "Direction", "ar": "توجيه"}, "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, "medicationHasBeenAdded": {"en": "Medication has been added", "ar": "تمت إضافة الدواء"}, "newPrescriptionOrder": {"en": "New Prescription Order", "ar": "طلب وصفة طبية جديد "}, - "pleaseFillAllFields": {"en": "Please Fill All Fields", "ar": "لو سمحت أملأ كل الحقول"}, + "pleaseFillAllFields": {"en": "Please Fill All Fields", "ar": "الرجاء أملأ جميع الحقول"}, "narcoticMedicineCanOnlyBePrescribedFromVida": { "en": "Narcotic medicine can only be prescribed from VIDA", "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " }, "only5DigitsAllowedForStrength": {"en": "Only 5 Digits allowed for strength", "ar": "يسمح فقط بـ 5 أرقام للقوة"}, "unit": {"en": "Unit", "ar": "وحدة"}, - "boxQuantity": {"en": "Box Quantity", "ar": "كمية الصندوق "}, + "boxQuantity": {"en": "Box Quantity", "ar": "كمية العبوة "}, "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, "applyForRadiologyOrder": {"en": "Apply for Radiology Order", "ar": "التقدم بطلب للحصول على طلب الأشعة "}, "applyForNewLabOrder": {"en": "Apply for New Lab Order", "ar": "تقدم بطلب جديد للمختبر الأشعة"}, - "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب معمل"}, + "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب مختبر"}, "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشعة"}, - "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, + "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب أشعة جديد"}, "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, - "health": {"en": "Health", "ar": "الصحي"}, + "health": {"en": "Health", "ar": "صحي"}, "summary": {"en": "Summary", "ar": "التقرير"}, "applyForNewPrescriptionsOrder": { "en": "Apply for New Prescriptions Order", @@ -657,28 +646,28 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, - "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, + "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف طلب جديد"}, + "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة جديدة"}, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, - "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, + "noteCanceled": {"en": "Canceled", "ar": "ألغي"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, - 'noteVerify': {'en': 'Verify', 'ar': 'تحقق'}, - 'noteConfirm': {'en': 'Confirm', 'ar': 'تاكيد'}, - 'noteAdd': {'en': 'Add ', 'ar': 'اضف '}, - 'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'}, - 'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'}, - 'order': {'en': 'Order', 'ar': 'الطلب'}, - 'sheet': {'en': 'Sheet', 'ar': 'ورقة'}, - 'medical': {'en': 'Medical', 'ar': 'الطبي'}, - 'report': {'en': 'Report', 'ar': 'التقرير'}, - 'discharge': {'en': 'Discharge', 'ar': 'discharge'}, - "discharged": {"en": "Discharged", "ar": "المفرغين"}, + "noteVerify": {"en": "Verify", "ar": "تحقق"}, + "noteConfirm": {"en": "Confirm", "ar": "تاكيد"}, + "noteAdd": {"en": "Add ", "ar": "اضف "}, + "noteUpdate": {"en": "Update ", "ar": "تحديث"}, + "orderSheet": {"en": "Order Sheet", "ar": "ورقة الطلب"}, + "order": {"en": "Order", "ar": "الطلب"}, + "sheet": {"en": "Sheet", "ar": "ورقة"}, + "medical": {"en": "Medical", "ar": "الطبي"}, + "report": {"en": "Report", "ar": "التقرير"}, + "discharge": {"en": "Discharge", "ar": "مغادرة"}, + "discharged": {"en": "Discharged", "ar": "المغادرين"}, "none": {"en": "None", "ar": "لا شيء"}, - "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, + "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يتم الرد بعد"}, "clearText": {"en": "Clear Text", "ar": "نص واضح"}, "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, - "comments": {"en": "Comments", "ar": "تعليقات"}, + "comments": {"en": "Comments", "ar": "ملاحظات"}, "initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, "transferTo": {"en": "Transfer To ", "ar": "حول إلى"}, "admin": {"en": "Admin", "ar": "مشرف"}, @@ -689,8 +678,8 @@ const Map> localizedValues = { "resume": {"en": "Resume", "ar": "استأنف"}, "theCall": {"en": "The Call", "ar": "الاتصال"}, "createNewMedicalReport": {"en": "Create New Medical Report", "ar": "إنشاء تقرير طبي جديد"}, - "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ والاكتشاف المادي"}, - "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المعامل والبيانات الفيزيائية"}, + "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ"}, + "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المختبرات والبيانات الفيزيائية"}, "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, "onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, "verified": {"en": "Verified", "ar": "تم التحقق"}, @@ -702,5 +691,30 @@ const Map> localizedValues = { "allPrescription": {"en": "All Prescription", "ar": "جميع الوصفات"}, "addPrescription": {"en": "Add prescription", "ar": "إضافة الوصفات"}, "edit": {"en": "Edit", "ar": "تعديل"}, - "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, + "summeryReply": {"en": "Summary Reply", "ar": "ملخص الرد"}, + "finish": {"en": "Finish", "ar": "انهاء"}, + "severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"}, + "inProgress": {"en": "inProgress", "ar": "تحت المعالجه"}, + "Completed": {"en": "Completed", "ar": "مكتمل"}, + "Locked": {"en": "Locked", "ar": "مقفل"}, + "textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"}, + "roomNo": {"en": "Room No", "ar": "رقم الغرفة"}, + "replayCallStatus": {"en": "Called", "ar": "تم الاتصال"}, + "patientArrived": {"en": "Patient Arrived", "ar": "وصل المريض"}, + "calledAndNoResponse": {"en": "Called And No Response", "ar": "تم الاتصال ولا يوجد رد"}, + "underProcess": {"en": "Under Process", "ar": "تحت التجهيز"}, + "textResponse": {"en": "Text Response", "ar": "استجابة النص"}, + "notReplied": {"en": "Not Replied", "ar": "لم يتم يرد"}, + "requestType":{ + "en":"Request Type", + "ar":"نوع الطلب"}, + "special": {"en": "Special", "ar": "خاص"}, + "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , + "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, + "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, + "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, + "occupation": {"en": "Occupation", "ar": "مهنة"}, + "healthID": {"en": "Health ID", "ar": "معرف الصحة"}, + "identityNumber": {"en": "Identity Number", "ar": "رقم الهوية"}, + "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index eea2ce76..628f5a0e 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -1,16 +1,16 @@ -final TOKEN = 'token'; -final PROJECT_ID = 'projectID'; -final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID'; -final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID'; -final LOGIN_TOKEN_ID = 'LogInToken'; -final DOCTOR_ID = 'doctorID'; -final SLECTED_PATIENT_TYPE = 'slectedPatientType'; -final APP_Language = 'language'; -final DOCTOR_PROFILE = 'doctorProfile'; -final LIVE_CARE_PATIENT = 'livecare-patient-profile'; -final LOGGED_IN_USER = 'loggedUser'; -final DASHBOARD_DATA = 'dashboard-data'; -final OTP_TYPE = 'otp-type'; -final LAST_LOGIN_USER = 'last-login-user'; -final PASSWORD = 'password'; -final CLINIC_NAME = 'clinic-name'; +const TOKEN = 'token'; +const PROJECT_ID = 'projectID'; +const VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID'; +const VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID'; +const LOGIN_TOKEN_ID = 'LogInToken'; +const DOCTOR_ID = 'doctorID'; +const SLECTED_PATIENT_TYPE = 'slectedPatientType'; +const APP_Language = 'language'; +const DOCTOR_PROFILE = 'doctorProfile'; +const LIVE_CARE_PATIENT = 'livecare-patient-profile'; +const LOGGED_IN_USER = 'loggedUser'; +const EMPLOYEE_ID = 'EmployeeID'; +const DASHBOARD_DATA = 'dashboard-data'; +const OTP_TYPE = 'otp-type'; +const LAST_LOGIN_USER = 'last-login-user'; +const CLINIC_NAME = 'clinic-name'; diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 2cbec3eb..3e07990b 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -22,7 +22,6 @@ class SizeConfig { static bool isHeightMiddle = false; static bool isHeightLarge = false; static bool isWidthLarge = false; - void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; @@ -73,9 +72,11 @@ class SizeConfig { print('widthMultiplier $widthMultiplier'); print('isPortrait $isPortrait'); print('isMobilePortrait $isMobilePortrait'); + + } - static getTextMultiplierBasedOnWidth({double? width}) { + static getTextMultiplierBasedOnWidth({double width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -83,7 +84,7 @@ class SizeConfig { return widthMultiplier; } - static getWidthMultiplier({double? width}) { + static getWidthMultiplier({double width}) { // TODO handel LandScape case if (width != null) { return width / 100; diff --git a/lib/core/enum/CalenderType.dart b/lib/core/enum/CalenderType.dart new file mode 100644 index 00000000..51f98512 --- /dev/null +++ b/lib/core/enum/CalenderType.dart @@ -0,0 +1,4 @@ +enum CalenderType{ + Gregorian, + Hijri, +} \ No newline at end of file diff --git a/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart new file mode 100644 index 00000000..4b95c1b0 --- /dev/null +++ b/lib/core/model/PatientRegistration/CheckActivationCodeModel.dart @@ -0,0 +1,112 @@ +class CheckActivationCodeModel { + int patientMobileNumber; + String mobileNo; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + int nationalID; + int patientIdentificationID; + bool forRegisteration; + String activationCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String dOB; + int isHijri; + String healthId; + + CheckActivationCodeModel( + {this.patientMobileNumber, + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.forRegisteration, + this.activationCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); + + CheckActivationCodeModel.fromJson(Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + forRegisteration = json['ForRegisteration']; + activationCode = json['activationCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + healthId = json['HealthId']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['ForRegisteration'] = this.forRegisteration; + data['activationCode'] = this.activationCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['HealthId'] = this.healthId; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart new file mode 100644 index 00000000..3465cf8d --- /dev/null +++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart @@ -0,0 +1,80 @@ +class CheckPatientForRegistrationModel { + int patientIdentificationID; + int patientMobileNumber; + String zipCode; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + int patientID; + bool isRegister; + String dOB; + int isHijri; + + CheckPatientForRegistrationModel( + {this.patientIdentificationID, + this.patientMobileNumber, + this.zipCode, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.isRegister, + this.dOB, + this.isHijri}); + + CheckPatientForRegistrationModel.fromJson(Map json) { + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + zipCode = json['ZipCode']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + isRegister = json['isRegister']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['ZipCode'] = this.zipCode; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['isRegister'] = this.isRegister; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart new file mode 100644 index 00000000..f05131ef --- /dev/null +++ b/lib/core/model/PatientRegistration/GetPatientInfoRequestModel.dart @@ -0,0 +1,60 @@ +class GetPatientInfoRequestModel { + String patientIdentificationID; + String dOB; + int isHijri; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + GetPatientInfoRequestModel( + {this.patientIdentificationID, + this.dOB, + this.isHijri, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + GetPatientInfoRequestModel.fromJson(Map json) { + patientIdentificationID = json['PatientIdentificationID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientIdentificationID'] = this.patientIdentificationID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart new file mode 100644 index 00000000..158bd1e2 --- /dev/null +++ b/lib/core/model/PatientRegistration/GetPatientInfoResponseModel.dart @@ -0,0 +1,374 @@ +class GetPatientInfoResponseModel { + dynamic date; + int languageID; + int serviceName; + dynamic time; + dynamic androidLink; + dynamic authenticationTokenID; + dynamic data; + bool dataw; + int dietType; + dynamic errorCode; + dynamic errorEndUserMessage; + dynamic errorEndUserMessageN; + dynamic errorMessage; + int errorType; + int foodCategory; + dynamic iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + dynamic patientBlodType; + dynamic successMsg; + dynamic successMsgN; + dynamic vidaUpdatedResponse; + dynamic accessTokenObject; + int age; + dynamic clientIdentifierId; + int createdBy; + String dateOfBirth; + String firstNameAr; + String firstNameEn; + String gender; + dynamic genderAr; + dynamic genderEn; + String healthId; + String idNumber; + String idType; + bool isHijri; + int isInstertedOrUpdated; + int isNull; + int isPatientExistNHIC; + bool isRecordLockedByCurrentUser; + String lastNameAr; + String lastNameEn; + dynamic listActiveAccessToken; + String maritalStatus; + String maritalStatusCode; + String nationalDateOfBirth; + String nationality; + String nationalityCode; + String occupation; + dynamic pCDTransactionDataResultList; + dynamic pCDGetVidaPatientForManualVerificationList; + dynamic pCDNHICHMGPatientDetailsMatchCalulationList; + int pCDReturnValue; + String patientStatus; + String placeofBirth; + dynamic practitionerStatusCode; + dynamic practitionerStatusDescAr; + dynamic practitionerStatusDescEn; + int rowCount; + String secondNameAr; + String secondNameEn; + String thirdNameAr; + String thirdNameEn; + dynamic yakeenVidaPatientDataStatisticsByPatientIdList; + dynamic yakeenVidaPatientDataStatisticsList; + dynamic yakeenVidaPatientDataStatisticsPrefferedList; + dynamic accessToken; + int categoryCode; + dynamic categoryNameAr; + dynamic categoryNameEn; + int constraintCode; + dynamic constraintNameAr; + dynamic constraintNameEn; + dynamic content; + dynamic errorList; + dynamic licenseExpiryDate; + dynamic licenseIssuedDate; + dynamic licenseStatusCode; + dynamic licenseStatusDescAr; + dynamic licenseStatusDescEn; + dynamic organizations; + dynamic registrationNumber; + int specialtyCode; + dynamic specialtyNameAr; + dynamic specialtyNameEn; + + GetPatientInfoResponseModel( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.vidaUpdatedResponse, + this.accessTokenObject, + this.age, + this.clientIdentifierId, + this.createdBy, + this.dateOfBirth, + this.firstNameAr, + this.firstNameEn, + this.gender, + this.genderAr, + this.genderEn, + this.healthId, + this.idNumber, + this.idType, + this.isHijri, + this.isInstertedOrUpdated, + this.isNull, + this.isPatientExistNHIC, + this.isRecordLockedByCurrentUser, + this.lastNameAr, + this.lastNameEn, + this.listActiveAccessToken, + this.maritalStatus, + this.maritalStatusCode, + this.nationalDateOfBirth, + this.nationality, + this.nationalityCode, + this.occupation, + this.pCDTransactionDataResultList, + this.pCDGetVidaPatientForManualVerificationList, + this.pCDNHICHMGPatientDetailsMatchCalulationList, + this.pCDReturnValue, + this.patientStatus, + this.placeofBirth, + this.practitionerStatusCode, + this.practitionerStatusDescAr, + this.practitionerStatusDescEn, + this.rowCount, + this.secondNameAr, + this.secondNameEn, + this.thirdNameAr, + this.thirdNameEn, + this.yakeenVidaPatientDataStatisticsByPatientIdList, + this.yakeenVidaPatientDataStatisticsList, + this.yakeenVidaPatientDataStatisticsPrefferedList, + this.accessToken, + this.categoryCode, + this.categoryNameAr, + this.categoryNameEn, + this.constraintCode, + this.constraintNameAr, + this.constraintNameEn, + this.content, + this.errorList, + this.licenseExpiryDate, + this.licenseIssuedDate, + this.licenseStatusCode, + this.licenseStatusDescAr, + this.licenseStatusDescEn, + this.organizations, + this.registrationNumber, + this.specialtyCode, + this.specialtyNameAr, + this.specialtyNameEn}); + + GetPatientInfoResponseModel.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + vidaUpdatedResponse = json['VidaUpdatedResponse']; + accessTokenObject = json['AccessTokenObject']; + age = json['Age']; + clientIdentifierId = json['ClientIdentifierId']; + createdBy = json['CreatedBy']; + dateOfBirth = json['DateOfBirth']; + firstNameAr = json['FirstNameAr']; + firstNameEn = json['FirstNameEn']; + gender = json['Gender']; + genderAr = json['GenderAr']; + genderEn = json['GenderEn']; + healthId = json['HealthId']; + idNumber = json['IdNumber']; + idType = json['IdType']; + isHijri = json['IsHijri']; + isInstertedOrUpdated = json['IsInstertedOrUpdated']; + isNull = json['IsNull']; + isPatientExistNHIC = json['IsPatientExistNHIC']; + isRecordLockedByCurrentUser = json['IsRecordLockedByCurrentUser']; + lastNameAr = json['LastNameAr']; + lastNameEn = json['LastNameEn']; + listActiveAccessToken = json['List_ActiveAccessToken']; + maritalStatus = json['MaritalStatus']; + maritalStatusCode = json['MaritalStatusCode']; + nationalDateOfBirth = json['NationalDateOfBirth']; + nationality = json['Nationality']; + nationalityCode = json['NationalityCode']; + occupation = json['Occupation']; + pCDTransactionDataResultList = json['PCDTransactionDataResultList']; + pCDGetVidaPatientForManualVerificationList = + json['PCD_GetVidaPatientForManualVerificationList']; + pCDNHICHMGPatientDetailsMatchCalulationList = + json['PCD_NHIC_HMG_PatientDetailsMatchCalulationList']; + pCDReturnValue = json['PCD_ReturnValue']; + patientStatus = json['PatientStatus']; + placeofBirth = json['PlaceofBirth']; + practitionerStatusCode = json['PractitionerStatusCode']; + practitionerStatusDescAr = json['PractitionerStatusDescAr']; + practitionerStatusDescEn = json['PractitionerStatusDescEn']; + rowCount = json['RowCount']; + secondNameAr = json['SecondNameAr']; + secondNameEn = json['SecondNameEn']; + thirdNameAr = json['ThirdNameAr']; + thirdNameEn = json['ThirdNameEn']; + yakeenVidaPatientDataStatisticsByPatientIdList = + json['YakeenVidaPatientDataStatisticsByPatientIdList']; + yakeenVidaPatientDataStatisticsList = + json['YakeenVidaPatientDataStatisticsList']; + yakeenVidaPatientDataStatisticsPrefferedList = + json['YakeenVidaPatientDataStatisticsPrefferedList']; + accessToken = json['accessToken']; + categoryCode = json['categoryCode']; + categoryNameAr = json['categoryNameAr']; + categoryNameEn = json['categoryNameEn']; + constraintCode = json['constraintCode']; + constraintNameAr = json['constraintNameAr']; + constraintNameEn = json['constraintNameEn']; + content = json['content']; + errorList = json['errorList']; + licenseExpiryDate = json['licenseExpiryDate']; + licenseIssuedDate = json['licenseIssuedDate']; + licenseStatusCode = json['licenseStatusCode']; + licenseStatusDescAr = json['licenseStatusDescAr']; + licenseStatusDescEn = json['licenseStatusDescEn']; + organizations = json['organizations']; + registrationNumber = json['registrationNumber']; + specialtyCode = json['specialtyCode']; + specialtyNameAr = json['specialtyNameAr']; + specialtyNameEn = json['specialtyNameEn']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['VidaUpdatedResponse'] = this.vidaUpdatedResponse; + data['AccessTokenObject'] = this.accessTokenObject; + data['Age'] = this.age; + data['ClientIdentifierId'] = this.clientIdentifierId; + data['CreatedBy'] = this.createdBy; + data['DateOfBirth'] = this.dateOfBirth; + data['FirstNameAr'] = this.firstNameAr; + data['FirstNameEn'] = this.firstNameEn; + data['Gender'] = this.gender; + data['GenderAr'] = this.genderAr; + data['GenderEn'] = this.genderEn; + data['HealthId'] = this.healthId; + data['IdNumber'] = this.idNumber; + data['IdType'] = this.idType; + data['IsHijri'] = this.isHijri; + data['IsInstertedOrUpdated'] = this.isInstertedOrUpdated; + data['IsNull'] = this.isNull; + data['IsPatientExistNHIC'] = this.isPatientExistNHIC; + data['IsRecordLockedByCurrentUser'] = this.isRecordLockedByCurrentUser; + data['LastNameAr'] = this.lastNameAr; + data['LastNameEn'] = this.lastNameEn; + data['List_ActiveAccessToken'] = this.listActiveAccessToken; + data['MaritalStatus'] = this.maritalStatus; + data['MaritalStatusCode'] = this.maritalStatusCode; + data['NationalDateOfBirth'] = this.nationalDateOfBirth; + data['Nationality'] = this.nationality; + data['NationalityCode'] = this.nationalityCode; + data['Occupation'] = this.occupation; + data['PCDTransactionDataResultList'] = this.pCDTransactionDataResultList; + data['PCD_GetVidaPatientForManualVerificationList'] = + this.pCDGetVidaPatientForManualVerificationList; + data['PCD_NHIC_HMG_PatientDetailsMatchCalulationList'] = + this.pCDNHICHMGPatientDetailsMatchCalulationList; + data['PCD_ReturnValue'] = this.pCDReturnValue; + data['PatientStatus'] = this.patientStatus; + data['PlaceofBirth'] = this.placeofBirth; + data['PractitionerStatusCode'] = this.practitionerStatusCode; + data['PractitionerStatusDescAr'] = this.practitionerStatusDescAr; + data['PractitionerStatusDescEn'] = this.practitionerStatusDescEn; + data['RowCount'] = this.rowCount; + data['SecondNameAr'] = this.secondNameAr; + data['SecondNameEn'] = this.secondNameEn; + data['ThirdNameAr'] = this.thirdNameAr; + data['ThirdNameEn'] = this.thirdNameEn; + data['YakeenVidaPatientDataStatisticsByPatientIdList'] = + this.yakeenVidaPatientDataStatisticsByPatientIdList; + data['YakeenVidaPatientDataStatisticsList'] = + this.yakeenVidaPatientDataStatisticsList; + data['YakeenVidaPatientDataStatisticsPrefferedList'] = + this.yakeenVidaPatientDataStatisticsPrefferedList; + data['accessToken'] = this.accessToken; + data['categoryCode'] = this.categoryCode; + data['categoryNameAr'] = this.categoryNameAr; + data['categoryNameEn'] = this.categoryNameEn; + data['constraintCode'] = this.constraintCode; + data['constraintNameAr'] = this.constraintNameAr; + data['constraintNameEn'] = this.constraintNameEn; + data['content'] = this.content; + data['errorList'] = this.errorList; + data['licenseExpiryDate'] = this.licenseExpiryDate; + data['licenseIssuedDate'] = this.licenseIssuedDate; + data['licenseStatusCode'] = this.licenseStatusCode; + data['licenseStatusDescAr'] = this.licenseStatusDescAr; + data['licenseStatusDescEn'] = this.licenseStatusDescEn; + data['organizations'] = this.organizations; + data['registrationNumber'] = this.registrationNumber; + data['specialtyCode'] = this.specialtyCode; + data['specialtyNameAr'] = this.specialtyNameAr; + data['specialtyNameEn'] = this.specialtyNameEn; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart new file mode 100644 index 00000000..83ff53d7 --- /dev/null +++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart @@ -0,0 +1,185 @@ +class PatientRegistrationModel { + Patientobject patientobject; + String patientIdentificationID; + String patientMobileNumber; + String logInTokenID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + String dOB; + int isHijri; + String healthId; + String zipCode; + + PatientRegistrationModel( + {this.patientobject, + this.patientIdentificationID, + this.patientMobileNumber, + this.logInTokenID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.dOB, + this.isHijri, + this.healthId, + this.zipCode}); + + PatientRegistrationModel.fromJson(Map json) { + patientobject = json['Patientobject'] != null + ? new Patientobject.fromJson(json['Patientobject']) + : null; + patientIdentificationID = json['PatientIdentificationID']; + patientMobileNumber = json['PatientMobileNumber']; + logInTokenID = json['LogInTokenID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + healthId = json['HealthId']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + if (this.patientobject != null) { + data['Patientobject'] = this.patientobject.toJson(); + } + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['LogInTokenID'] = this.logInTokenID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['HealthId'] = this.healthId; + data['ZipCode'] = this.zipCode; + return data; + } +} + +class Patientobject { + bool tempValue; + int patientIdentificationType; + String patientIdentificationNo; + int mobileNumber; + int patientOutSA; + String firstNameN; + String middleNameN; + String lastNameN; + String firstName; + String middleName; + String lastName; + String strDateofBirth; + String dateofBirth; + int gender; + String nationalityID; + String dateofBirthN; + String emailAddress; + String sourceType; + String preferredLanguage; + String marital; + String eHealthIDField; + + Patientobject( + {this.tempValue, + this.patientIdentificationType, + this.patientIdentificationNo, + this.mobileNumber, + this.patientOutSA, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.firstName, + this.middleName, + this.lastName, + this.strDateofBirth, + this.dateofBirth, + this.gender, + this.nationalityID, + this.dateofBirthN, + this.emailAddress, + this.sourceType, + this.preferredLanguage, + this.marital, + this.eHealthIDField}); + + Patientobject.fromJson(Map json) { + tempValue = json['TempValue']; + patientIdentificationType = json['PatientIdentificationType']; + patientIdentificationNo = json['PatientIdentificationNo']; + mobileNumber = json['MobileNumber']; + patientOutSA = json['PatientOutSA']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + strDateofBirth = json['StrDateofBirth']; + dateofBirth = json['DateofBirth']; + gender = json['Gender']; + nationalityID = json['NationalityID']; + dateofBirthN = json['DateofBirthN']; + emailAddress = json['EmailAddress']; + sourceType = json['SourceType']; + preferredLanguage = json['PreferredLanguage']; + marital = json['Marital']; + eHealthIDField = json['eHealthIDField']; + } + + Map toJson() { + final Map data = new Map(); + data['TempValue'] = this.tempValue; + data['PatientIdentificationType'] = this.patientIdentificationType; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['MobileNumber'] = this.mobileNumber; + data['PatientOutSA'] = this.patientOutSA; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['StrDateofBirth'] = this.strDateofBirth; + data['DateofBirth'] = this.dateofBirth; + data['Gender'] = this.gender; + data['NationalityID'] = this.nationalityID; + data['DateofBirthN'] = this.dateofBirthN; + data['EmailAddress'] = this.emailAddress; + data['SourceType'] = this.sourceType; + data['PreferredLanguage'] = this.preferredLanguage; + data['Marital'] = this.marital; + data['eHealthIDField'] = this.eHealthIDField; + return data; + } +} diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart new file mode 100644 index 00000000..8244a95f --- /dev/null +++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart @@ -0,0 +1,109 @@ +class SendActivationCodeByOTPNotificationTypeForRegistrationModel { + int patientMobileNumber; + String mobileNo; + int projectOutSA; + int loginType; + String zipCode; + bool isRegister; + String logInTokenID; + int searchType; + int patientID; + int nationalID; + int patientIdentificationID; + int oTPSendType; + int languageID; + double versionID; + int channel; + String iPAdress; + String generalid; + int patientOutSA; + Null sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String dOB; + int isHijri; + String healthId; + + SendActivationCodeByOTPNotificationTypeForRegistrationModel( + {this.patientMobileNumber, + this.mobileNo, + this.projectOutSA, + this.loginType, + this.zipCode, + this.isRegister, + this.logInTokenID, + this.searchType, + this.patientID, + this.nationalID, + this.patientIdentificationID, + this.oTPSendType, + this.languageID, + this.versionID, + this.channel, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.dOB, + this.isHijri, + this.healthId}); + + SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( + Map json) { + patientMobileNumber = json['PatientMobileNumber']; + mobileNo = json['MobileNo']; + projectOutSA = json['ProjectOutSA']; + loginType = json['LoginType']; + zipCode = json['ZipCode']; + isRegister = json['isRegister']; + logInTokenID = json['LogInTokenID']; + searchType = json['SearchType']; + patientID = json['PatientID']; + nationalID = json['NationalID']; + patientIdentificationID = json['PatientIdentificationID']; + oTPSendType = json['OTP_SendType']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + channel = json['Channel']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + dOB = json['DOB']; + isHijri = json['IsHijri']; + healthId = json['HealthId']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMobileNumber'] = this.patientMobileNumber; + data['MobileNo'] = this.mobileNo; + data['ProjectOutSA'] = this.projectOutSA; + data['LoginType'] = this.loginType; + data['ZipCode'] = this.zipCode; + data['isRegister'] = this.isRegister; + data['LogInTokenID'] = this.logInTokenID; + data['SearchType'] = this.searchType; + data['PatientID'] = this.patientID; + data['NationalID'] = this.nationalID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['OTP_SendType'] = this.oTPSendType; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['DOB'] = this.dOB; + data['IsHijri'] = this.isHijri; + data['HealthId'] = this.healthId; + return data; + } +} diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart new file mode 100644 index 00000000..8ba07f2a --- /dev/null +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart @@ -0,0 +1,157 @@ +class GetMedicationForInPatientModel { + String setupID; + int projectID; + int admissionNo; + int patientID; + int orderNo; + int prescriptionNo; + int lineItemNo; + String prescriptionDatetime; + int itemID; + int directionID; + int refillID; + String dose; + int unitofMeasurement; + String startDatetime; + String stopDatetime; + int noOfDoses; + int routeId; + String comments; + int reviewedPharmacist; + dynamic reviewedPharmacistDatetime; + dynamic discountinueDatetime; + dynamic rescheduleDatetime; + int status; + String statusDescription; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedOn; + dynamic strength; + String pHRItemDescription; + String pHRItemDescriptionN; + String doctorName; + String uomDescription; + String routeDescription; + String directionDescription; + String refillDescription; + + GetMedicationForInPatientModel( + {this.setupID, + this.projectID, + this.admissionNo, + this.patientID, + this.orderNo, + this.prescriptionNo, + this.lineItemNo, + this.prescriptionDatetime, + this.itemID, + this.directionID, + this.refillID, + this.dose, + this.unitofMeasurement, + this.startDatetime, + this.stopDatetime, + this.noOfDoses, + this.routeId, + this.comments, + this.reviewedPharmacist, + this.reviewedPharmacistDatetime, + this.discountinueDatetime, + this.rescheduleDatetime, + this.status, + this.statusDescription, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.strength, + this.pHRItemDescription, + this.pHRItemDescriptionN, + this.doctorName, + this.uomDescription, + this.routeDescription, + this.directionDescription, + this.refillDescription}); + + GetMedicationForInPatientModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + doctorName = json['DoctorName']; + refillDescription = json['RefillDescription']; + directionDescription = json['DirectionDescription']; + routeDescription = json['RouteDescription']; + + uomDescription = json['UOMDescription']; + admissionNo = json['AdmissionNo']; + patientID = json['PatientID']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + lineItemNo = json['LineItemNo']; + prescriptionDatetime = json['PrescriptionDatetime']; + itemID = json['ItemID']; + directionID = json['DirectionID']; + refillID = json['RefillID']; + dose = json['Dose']; + unitofMeasurement = json['UnitofMeasurement']; + startDatetime = json['StartDatetime']; + stopDatetime = json['StopDatetime']; + noOfDoses = json['NoOfDoses']; + routeId = json['RouteId']; + comments = json['Comments']; + reviewedPharmacist = json['ReviewedPharmacist']; + reviewedPharmacistDatetime = json['ReviewedPharmacistDatetime']; + discountinueDatetime = json['DiscountinueDatetime']; + rescheduleDatetime = json['RescheduleDatetime']; + status = json['Status']; + statusDescription = json['StatusDescription']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + strength = json['Strength']; + pHRItemDescription = json['PHRItemDescription']; + pHRItemDescriptionN = json['PHRItemDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['DoctorName'] = this.doctorName; + data['RefillDescription'] = this.refillDescription; + data['RouteDescription'] = this.routeDescription; + data['DirectionDescription'] = this.directionDescription; + data['UOMDescription'] = this.uomDescription; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['PatientID'] = this.patientID; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['LineItemNo'] = this.lineItemNo; + data['PrescriptionDatetime'] = this.prescriptionDatetime; + data['ItemID'] = this.itemID; + data['DirectionID'] = this.directionID; + data['RefillID'] = this.refillID; + data['Dose'] = this.dose; + data['UnitofMeasurement'] = this.unitofMeasurement; + data['StartDatetime'] = this.startDatetime; + data['StopDatetime'] = this.stopDatetime; + data['NoOfDoses'] = this.noOfDoses; + data['RouteId'] = this.routeId; + data['Comments'] = this.comments; + data['ReviewedPharmacist'] = this.reviewedPharmacist; + data['ReviewedPharmacistDatetime'] = this.reviewedPharmacistDatetime; + data['DiscountinueDatetime'] = this.discountinueDatetime; + data['RescheduleDatetime'] = this.rescheduleDatetime; + data['Status'] = this.status; + data['StatusDescription'] = this.statusDescription; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['Strength'] = this.strength; + data['PHRItemDescription'] = this.pHRItemDescription; + data['PHRItemDescriptionN'] = this.pHRItemDescriptionN; + return data; + } +} diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart new file mode 100644 index 00000000..7c906643 --- /dev/null +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart @@ -0,0 +1,60 @@ +class GetMedicationForInPatientRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + + GetMedicationForInPatientRequestModel( + {this.isDentalAllowedBackend, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.admissionNo, + this.sessionID, + this.projectID}); + + GetMedicationForInPatientRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart index e3a6eec8..4b5d574a 100644 --- a/lib/core/model/Prescriptions/prescription_report.dart +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -1,13 +1,13 @@ class PrescriptionReport { - String ? address; - int ? appointmentNo; - String? clinic; - String ?companyName; - int ?days; - String ?doctorName; + String? address; + dynamic? appodynamicmentNo; + String? clinic; + String? companyName; + dynamic? days; + String? doctorName; var doseDailyQuantity; String? frequency; - int ?frequencyNumber; + dynamic? frequencyNumber; String? image; String? imageExtension; String? imageSRCUrl; @@ -15,38 +15,38 @@ class PrescriptionReport { String? imageThumbUrl; String? isCovered; String? itemDescription; - int? itemID; + dynamic? itemID; String? orderDate; - int ?patientID; - String ?patientName; - String ?phoneOffice1; - String ?prescriptionQR; - int ?prescriptionTimes; + dynamic? patientID; + String? patientName; + String? phoneOffice1; + String? prescriptionQR; + dynamic? prescriptionTimes; String? productImage; String? productImageBase64; String? productImageString; - int? projectID; - String?projectName; - String?remarks; - String?route; - String?sKU; - int ?scaleOffset; + dynamic? projectID; + String? projectName; + String? remarks; + String? route; + String? sKU; + dynamic? scaleOffset; String? startDate; - String ? patientAge; - String ? patientGender; - String ? phoneOffice; - int ?doseTimingID; - int ?frequencyID; - int ?routeID; - String ? name; - String ? itemDescriptionN; - String ? routeN; - String ? frequencyN; + String? patientAge; + String? patientGender; + String? phoneOffice; + dynamic? doseTimingID; + dynamic? frequencyID; + dynamic? routeID; + String? name; + String? itemDescriptionN; + String? routeN; + String? frequencyN; PrescriptionReport({ this.address, - this.appointmentNo, + this.appodynamicmentNo, this.clinic, this.companyName, this.days, @@ -92,7 +92,7 @@ class PrescriptionReport { PrescriptionReport.fromJson(Map json) { address = json['Address']; - appointmentNo = json['AppointmentNo']; + appodynamicmentNo = json['AppodynamicmentNo']; clinic = json['Clinic']; companyName = json['CompanyName']; days = json['Days']; @@ -141,7 +141,7 @@ class PrescriptionReport { final Map data = new Map(); data['Address'] = this.address; - data['AppointmentNo'] = this.appointmentNo; + data['AppodynamicmentNo'] = this.appodynamicmentNo; data['Clinic'] = this.clinic; data['CompanyName'] = this.companyName; data['Days'] = this.days; diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart index a51cdc7b..96f811de 100644 --- a/lib/core/model/Prescriptions/prescription_report_enh.dart +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -1,5 +1,6 @@ class PrescriptionReportEnh { String ? address; + dynamic appodynamicmentNo; int ? appointmentNo; String ? clinic; dynamic companyName; @@ -15,27 +16,27 @@ class PrescriptionReportEnh { String ? imageThumbUrl; String ? isCovered; String ? itemDescription; - int ? itemID; + dynamic ? itemID; String ? orderDate; - int ? patientID; + dynamic ? patientID; String ? patientName; String ? phoneOffice1; dynamic prescriptionQR; - int ? prescriptionTimes; + dynamic ? prescriptionTimes; dynamic productImage; dynamic productImageBase64; String ? productImageString; - int ? projectID; + dynamic ? projectID; String ? projectName; String ? remarks; String ? route; String ? sKU; - int ? scaleOffset; + dynamic ? scaleOffset; String ? startDate; PrescriptionReportEnh( {this.address, - this.appointmentNo, + this.appodynamicmentNo, this.clinic, this.companyName, this.days, @@ -70,7 +71,7 @@ class PrescriptionReportEnh { PrescriptionReportEnh.fromJson(Map json) { address = json['Address']; - appointmentNo = json['AppointmentNo']; + appodynamicmentNo = json['AppodynamicmentNo']; clinic = json['Clinic']; companyName = json['CompanyName']; days = json['Days']; @@ -107,7 +108,7 @@ class PrescriptionReportEnh { Map toJson() { final Map data = new Map(); data['Address'] = this.address; - data['AppointmentNo'] = this.appointmentNo; + data['AppodynamicmentNo'] = this.appodynamicmentNo; data['Clinic'] = this.clinic; data['CompanyName'] = this.companyName; data['Days'] = this.days; diff --git a/lib/core/model/auth/activation_Code_req_model.dart b/lib/core/model/auth/activation_Code_req_model.dart index 1ef02c02..13d64f6a 100644 --- a/lib/core/model/auth/activation_Code_req_model.dart +++ b/lib/core/model/auth/activation_Code_req_model.dart @@ -1,52 +1,43 @@ class ActivationCodeModel { - late String? mobileNumber; - late String? zipCode; late int? channel; + late int? loginDoctorID; late int? languageID; late double? versionID; late int? memberID; - late String? password; late int? facilityId; late String? generalid; late String? otpSendType; ActivationCodeModel( - {this.mobileNumber, - this.zipCode, - this.channel, + {this.channel, this.languageID, this.versionID, this.memberID, - this.password, this.facilityId, this.otpSendType, - this.generalid}); + this.generalid,this.loginDoctorID}); ActivationCodeModel.fromJson(Map json) { - mobileNumber = json['MobileNumber']; - zipCode = json['ZipCode']; channel = json['Channel']; languageID = json['LanguageID']; versionID = json['VersionID']; memberID = json['MemberID']; - password = json['Password']; facilityId = json['facilityId']; otpSendType = json['OTP_SendType']; generalid = json['generalid']; + loginDoctorID = json['LoginDoctorID']; } Map toJson() { final Map data = new Map(); - data['MobileNumber'] = this.mobileNumber; - data['ZipCode'] = this.zipCode; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; data['VersionID'] = this.versionID; data['MemberID'] = this.memberID; - data['Password'] = this.password; data['facilityId'] = this.facilityId; data['OTP_SendType'] = otpSendType; data['generalid'] = this.generalid; + data['LoginDoctorID'] = this.loginDoctorID; return data; } } diff --git a/lib/core/model/auth/activation_code_for_verification_screen_model.dart b/lib/core/model/auth/activation_code_for_verification_screen_model.dart index f7aba9f0..51fb5ab3 100644 --- a/lib/core/model/auth/activation_code_for_verification_screen_model.dart +++ b/lib/core/model/auth/activation_code_for_verification_screen_model.dart @@ -3,6 +3,7 @@ class ActivationCodeForVerificationScreenModel { late String? mobileNumber; late String? zipCode; late int? channel; + late int? loginDoctorID; late int? languageID; late double? versionID; late int? memberID; @@ -26,7 +27,7 @@ class ActivationCodeForVerificationScreenModel { this.isMobileFingerPrint, this.vidaAuthTokenID, this.vidaRefreshTokenID, - this.iMEI}); + this.iMEI,this.loginDoctorID}); ActivationCodeForVerificationScreenModel.fromJson(Map json) { oTPSendType = json['OTP_SendType']; @@ -42,6 +43,7 @@ class ActivationCodeForVerificationScreenModel { vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; iMEI = json['IMEI']; + loginDoctorID = json['LoginDoctorID']; } Map toJson() { @@ -56,9 +58,8 @@ class ActivationCodeForVerificationScreenModel { data['facilityId'] = this.facilityId; data['generalid'] = this.generalid; data['IsMobileFingerPrint'] = this.isMobileFingerPrint; - data['VidaAuthTokenID'] = this.vidaAuthTokenID; - data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['IMEI'] = this.iMEI; + data['LoginDoctorID'] = this.loginDoctorID; return data; } } diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index 0ae3008e..b30413e5 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -5,9 +5,14 @@ class CheckActivationCodeForDoctorAppResponseModel { late List? listDoctorsClinic; List? listDoctorProfile; late MemberInformation? memberInformation; + String vidaAuthTokenID; + String vidaRefreshTokenID; CheckActivationCodeForDoctorAppResponseModel( - {this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation}); + {this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, + this.listDoctorProfile, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); CheckActivationCodeForDoctorAppResponseModel.fromJson(Map json) { authenticationTokenID = json['AuthenticationTokenID']; @@ -24,6 +29,8 @@ class CheckActivationCodeForDoctorAppResponseModel { listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); }); } + vidaAuthTokenID = json['VidaAuthTokenID']; + vidaRefreshTokenID = json['VidaRefreshTokenID']; memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; diff --git a/lib/core/model/auth/check_activation_code_request_model.dart b/lib/core/model/auth/check_activation_code_request_model.dart index 187c989c..fee596fe 100644 --- a/lib/core/model/auth/check_activation_code_request_model.dart +++ b/lib/core/model/auth/check_activation_code_request_model.dart @@ -1,19 +1,24 @@ class CheckActivationCodeRequestModel { - late String? mobileNumber; - late String? zipCode; - late int? doctorID; - late String? iPAdress; - late int? channel; - late int? languageID; - late int? projectID; - late double? versionID; - late String? generalid; - late String? logInTokenID; - late String? activationCode; - late String? vidaAuthTokenID; - late String? vidaRefreshTokenID; - late int? oTPSendType; - + String? mobileNumber; + String? zipCode; + int? doctorID; + int? memberID; + int? loginDoctorID; + String? password; + String? facilityId; + String? iPAdress; + int? channel; + int? languageID; + int? projectID; + double? versionID; + String? generalid; + String? logInTokenID; + String? activationCode; + String? vidaAuthTokenID; + String? vidaRefreshTokenID; + String? iMEI; + bool? isForSilentLogin; + int? oTPSendType; CheckActivationCodeRequestModel( {this.mobileNumber, this.zipCode, @@ -28,7 +33,7 @@ class CheckActivationCodeRequestModel { this.activationCode, this.vidaAuthTokenID, this.vidaRefreshTokenID, - this.oTPSendType}); + this.oTPSendType,this.password,this.facilityId,this.memberID,this.isForSilentLogin=false,this.iMEI,this.loginDoctorID}); CheckActivationCodeRequestModel.fromJson(Map json) { mobileNumber = json['MobileNumber']; @@ -45,6 +50,7 @@ class CheckActivationCodeRequestModel { vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; oTPSendType = json['OTP_SendType']; + loginDoctorID = json['LoginDoctorID']; } Map toJson() { @@ -63,6 +69,12 @@ class CheckActivationCodeRequestModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['OTP_SendType'] = this.oTPSendType; + data['facilityId'] = this.facilityId; + data['MemberID'] = this.memberID; + data['Password'] = this.password; + data['IMEI'] = this.iMEI; + data['IsForSilentLogin'] = this.isForSilentLogin; + data['LoginDoctorID'] = this.loginDoctorID; return data; } } diff --git a/lib/core/model/diabetic_chart/DiabeticType.dart b/lib/core/model/diabetic_chart/DiabeticType.dart new file mode 100644 index 00000000..26641e61 --- /dev/null +++ b/lib/core/model/diabetic_chart/DiabeticType.dart @@ -0,0 +1,21 @@ +class DiabeticType { + int value; + String nameEn; + String nameAr; + + DiabeticType({this.value, this.nameEn, this.nameAr}); + + DiabeticType.fromJson(Map json) { + value = json['value']; + nameEn = json['nameEn']; + nameAr = json['nameAr']; + } + + Map toJson() { + final Map data = new Map(); + data['value'] = this.value; + data['nameEn'] = this.nameEn; + data['nameAr'] = this.nameAr; + return data; + } +} diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart new file mode 100644 index 00000000..7fad3106 --- /dev/null +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart @@ -0,0 +1,44 @@ +class GetDiabeticChartValuesRequestModel { + int deviceTypeID; + int patientID; + int resultType; + int admissionNo; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; + + GetDiabeticChartValuesRequestModel( + {this.deviceTypeID, + this.patientID, + this.resultType, + this.admissionNo, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); + + GetDiabeticChartValuesRequestModel.fromJson(Map json) { + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + resultType = json['ResultType']; + admissionNo = json['AdmissionNo']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['ResultType'] = this.resultType; + data['AdmissionNo'] = this.admissionNo; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart new file mode 100644 index 00000000..fa2c1ca2 --- /dev/null +++ b/lib/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart @@ -0,0 +1,36 @@ +class GetDiabeticChartValuesResponseModel { + String resultType; + int admissionNo; + String dateChart; + int resultValue; + int createdBy; + String createdOn; + + GetDiabeticChartValuesResponseModel( + {this.resultType, + this.admissionNo, + this.dateChart, + this.resultValue, + this.createdBy, + this.createdOn}); + + GetDiabeticChartValuesResponseModel.fromJson(Map json) { + resultType = json['ResultType']; + admissionNo = json['AdmissionNo']; + dateChart = json['DateChart']; + resultValue = json['ResultValue']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ResultType'] = this.resultType; + data['AdmissionNo'] = this.admissionNo; + data['DateChart'] = this.dateChart; + data['ResultValue'] = this.resultValue; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + return data; + } +} diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart new file mode 100644 index 00000000..310cfb50 --- /dev/null +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart @@ -0,0 +1,32 @@ +class GetDiagnosisForInPatientRequestModel { + int patientID; + int admissionNo; + String setupID; + int patientType; + int patientTypeID; + + GetDiagnosisForInPatientRequestModel( + {this.patientID, + this.admissionNo, + this.setupID, + this.patientType, + this.patientTypeID}); + + GetDiagnosisForInPatientRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + setupID = json['SetupID']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SetupID'] = this.setupID; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart new file mode 100644 index 00000000..1ec48964 --- /dev/null +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -0,0 +1,52 @@ +class GetDiagnosisForInPatientResponseModel { + String iCDCode10ID; + int diagnosisTypeID; + int conditionID; + bool complexDiagnosis; + String asciiDesc; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String createdByName; + String editedByName; + + GetDiagnosisForInPatientResponseModel( + {this.iCDCode10ID, + this.diagnosisTypeID, + this.conditionID, + this.complexDiagnosis, + this.asciiDesc, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, this.createdByName}); + + GetDiagnosisForInPatientResponseModel.fromJson(Map json) { + iCDCode10ID = json['ICDCode10ID']; + diagnosisTypeID = json['DiagnosisTypeID']; + conditionID = json['ConditionID']; + complexDiagnosis = json['ComplexDiagnosis']; + asciiDesc = json['Ascii_Desc']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + createdByName = json['CreatedByName']; + editedByName = json['EditedByName']; + } + + Map toJson() { + final Map data = new Map(); + data['ICDCode10ID'] = this.iCDCode10ID; + data['DiagnosisTypeID'] = this.diagnosisTypeID; + data['ConditionID'] = this.conditionID; + data['ComplexDiagnosis'] = this.complexDiagnosis; + data['Ascii_Desc'] = this.asciiDesc; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + return data; + } +} diff --git a/lib/core/model/labs/LabResultHistory.dart b/lib/core/model/labs/LabResultHistory.dart new file mode 100644 index 00000000..7c4221ca --- /dev/null +++ b/lib/core/model/labs/LabResultHistory.dart @@ -0,0 +1,108 @@ +class LabResultHistory { + String description; + String femaleInterpretativeData; + int gender; + bool isCertificateAllowed; + int lineItemNo; + String maleInterpretativeData; + String notes; + int orderLineItemNo; + int orderNo; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + int resultValueBasedLineItemNo; + String resultValueFlag; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + String superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; + + LabResultHistory( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.isCertificateAllowed, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.orderLineItemNo, + this.orderNo, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.resultValueBasedLineItemNo, + this.resultValueFlag, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResultHistory.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + isCertificateAllowed = json['IsCertificateAllowed']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + orderLineItemNo = json['OrderLineItemNo']; + orderNo = json['OrderNo']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo']; + resultValueFlag = json['ResultValueFlag']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['IsCertificateAllowed'] = this.isCertificateAllowed; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['OrderLineItemNo'] = this.orderLineItemNo; + data['OrderNo'] = this.orderNo; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo; + data['ResultValueFlag'] = this.resultValueFlag; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/labs/all_special_lab_result_model.dart b/lib/core/model/labs/all_special_lab_result_model.dart new file mode 100644 index 00000000..ffdc5ee5 --- /dev/null +++ b/lib/core/model/labs/all_special_lab_result_model.dart @@ -0,0 +1,216 @@ +class AllSpecialLabResultModel { + dynamic actualDoctorRate; + dynamic admissionDate; + dynamic admissionNumber; + dynamic appointmentDate; + dynamic appointmentNo; + dynamic appointmentTime; + String clinicDescription; + String clinicDescriptionEnglish; + dynamic clinicDescriptionN; + dynamic clinicID; + dynamic createdOn; + double decimalDoctorRate; + dynamic doctorID; + String doctorImageURL; + String doctorName; + String doctorNameEnglish; + dynamic doctorNameN; + dynamic doctorRate; + dynamic doctorStarsRate; + String doctorTitle; + dynamic gender; + String genderDescription; + bool inOutPatient; + String invoiceNo; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + dynamic isInOutPatientDescription; + dynamic isInOutPatientDescriptionN; + bool isLiveCareAppointment; + bool isRead; + bool isSendEmail; + String moduleID; + String nationalityFlagURL; + dynamic noOfPatientsRate; + dynamic orderDate; + String orderNo; + dynamic patientID; + String projectID; + String projectName; + dynamic projectNameN; + String qR; + String resultData; + String resultDataHTML; + dynamic resultDataTxt; + String setupID; + //List speciality; + dynamic status; + dynamic statusDesc; + String strOrderDate; + + AllSpecialLabResultModel( + {this.actualDoctorRate, + this.admissionDate, + this.admissionNumber, + this.appointmentDate, + this.appointmentNo, + this.appointmentTime, + this.clinicDescription, + this.clinicDescriptionEnglish, + this.clinicDescriptionN, + this.clinicID, + this.createdOn, + this.decimalDoctorRate, + this.doctorID, + this.doctorImageURL, + this.doctorName, + this.doctorNameEnglish, + this.doctorNameN, + this.doctorRate, + this.doctorStarsRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.inOutPatient, + this.invoiceNo, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isLiveCareAppointment, + this.isRead, + this.isSendEmail, + this.moduleID, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderDate, + this.orderNo, + this.patientID, + this.projectID, + this.projectName, + this.projectNameN, + this.qR, + this.resultData, + this.resultDataHTML, + this.resultDataTxt, + this.setupID, + //this.speciality, + this.status, + this.statusDesc, + this.strOrderDate}); + + AllSpecialLabResultModel.fromJson(Map json) { + actualDoctorRate = json['ActualDoctorRate']; + admissionDate = json['AdmissionDate']; + admissionNumber = json['AdmissionNumber']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + appointmentTime = json['AppointmentTime']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; + clinicDescriptionN = json['ClinicDescriptionN']; + clinicID = json['ClinicID']; + createdOn = json['CreatedOn']; + decimalDoctorRate = json['DecimalDoctorRate']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameEnglish = json['DoctorNameEnglish']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + doctorStarsRate = json['DoctorStarsRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + inOutPatient = json['InOutPatient']; + invoiceNo = json['InvoiceNo']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isRead = json['IsRead']; + isSendEmail = json['IsSendEmail']; + moduleID = json['ModuleID']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + orderDate = json['OrderDate']; + orderNo = json['OrderNo']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + qR = json['QR']; + resultData = json['ResultData']; + resultDataHTML = json['ResultDataHTML']; + resultDataTxt = json['ResultDataTxt']; + setupID = json['SetupID']; + //speciality = json['Speciality'].cast(); + status = json['Status']; + statusDesc = json['StatusDesc']; + strOrderDate = json['StrOrderDate']; + } + + Map toJson() { + final Map data = new Map(); + data['ActualDoctorRate'] = this.actualDoctorRate; + data['AdmissionDate'] = this.admissionDate; + data['AdmissionNumber'] = this.admissionNumber; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentTime'] = this.appointmentTime; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ClinicID'] = this.clinicID; + data['CreatedOn'] = this.createdOn; + data['DecimalDoctorRate'] = this.decimalDoctorRate; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameEnglish'] = this.doctorNameEnglish; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorRate'] = this.doctorRate; + data['DoctorStarsRate'] = this.doctorStarsRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['InOutPatient'] = this.inOutPatient; + data['InvoiceNo'] = this.invoiceNo; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsRead'] = this.isRead; + data['IsSendEmail'] = this.isSendEmail; + data['ModuleID'] = this.moduleID; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OrderDate'] = this.orderDate; + data['OrderNo'] = this.orderNo; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['QR'] = this.qR; + data['ResultData'] = this.resultData; + data['ResultDataHTML'] = this.resultDataHTML; + data['ResultDataTxt'] = this.resultDataTxt; + data['SetupID'] = this.setupID; + //data['Speciality'] = this.speciality; + data['Status'] = this.status; + data['StatusDesc'] = this.statusDesc; + data['StrOrderDate'] = this.strOrderDate; + return data; + } +} diff --git a/lib/core/model/labs/all_special_lab_result_request.dart b/lib/core/model/labs/all_special_lab_result_request.dart new file mode 100644 index 00000000..d5df1405 --- /dev/null +++ b/lib/core/model/labs/all_special_lab_result_request.dart @@ -0,0 +1,68 @@ +class AllSpecialLabResultRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + String tokenID; + int patientTypeID; + int patientType; + int patientID; + int projectID; + + AllSpecialLabResultRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.patientID, + this.projectID}); + + AllSpecialLabResultRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 9a8cfe82..53035721 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -13,6 +13,8 @@ class LabResult { String? sampleCollectedOn; String? sampleReceivedOn; String? setupID; + String? maxValue; + String? minValue; dynamic superVerifiedOn; String? testCode; String? uOM; @@ -31,7 +33,8 @@ class LabResult { this.projectID, this.referanceRange, this.resultValue, - this.sampleCollectedOn, + this.maxValue, + this.minValue,this.sampleCollectedOn, this.sampleReceivedOn, this.setupID, this.superVerifiedOn, @@ -52,6 +55,8 @@ class LabResult { projectID = json['ProjectID'].toString(); referanceRange = json['ReferenceRange'] ?? json['ReferanceRange']; resultValue = json['ResultValue']; + maxValue = json['MaxValue']; + minValue = json['MinValue']; sampleCollectedOn = json['SampleCollectedOn']; sampleReceivedOn = json['SampleReceivedOn']; setupID = json['SetupID']; @@ -75,6 +80,8 @@ class LabResult { data['ProjectID'] = this.projectID; data['ReferanceRange'] = this.referanceRange; data['ResultValue'] = this.resultValue; + data['MaxValue'] = this.maxValue; + data['MinValue'] = this.minValue; data['SampleCollectedOn'] = this.sampleCollectedOn; data['SampleReceivedOn'] = this.sampleReceivedOn; data['SetupID'] = this.setupID; @@ -85,6 +92,28 @@ class LabResult { data['VerifiedOnDateTime'] = this.verifiedOnDateTime; return data; } + + int checkResultStatus() { + try { + var max = double.tryParse(maxValue) ?? null; + var min = double.tryParse(minValue) ?? null; + var result = double.tryParse(resultValue) ?? null; + if (max != null && min != null && result != null) { + if (result > max) { + return 1; + } else if (result < min) { + return -1; + } else { + return 0; + } + } else { + return 0; + } + }catch (e){ + return 0; + } + + } } class LabResultList { diff --git a/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart new file mode 100644 index 00000000..1d63e885 --- /dev/null +++ b/lib/core/model/live_care/add_patient_to_doctor_list_request_model.dart @@ -0,0 +1,27 @@ +class AddPatientToDoctorListRequestModel { + int vCID; + String tokenID; + String generalid; + int doctorId; + bool isOutKsa; + + AddPatientToDoctorListRequestModel({this.vCID, this.tokenID, this.generalid, this.doctorId, this.isOutKsa}); + + AddPatientToDoctorListRequestModel.fromJson(Map json) { + vCID = json['VC_ID']; + tokenID = json['TokenID']; + generalid = json['generalid']; + doctorId = json['DoctorId']; + isOutKsa = json['IsOutKsa']; + } + + Map toJson() { + final Map data = new Map(); + data['VC_ID'] = this.vCID; + data['TokenID'] = this.tokenID; + data['generalid'] = this.generalid; + data['DoctorId'] = this.doctorId; + data['IsOutKsa'] = this.isOutKsa; + return data; + } +} diff --git a/lib/core/model/note/GetNursingProgressNoteRequestModel.dart b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart new file mode 100644 index 00000000..4335053c --- /dev/null +++ b/lib/core/model/note/GetNursingProgressNoteRequestModel.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/config/config.dart'; + +class GetNursingProgressNoteRequestModel { + int patientID; + int admissionNo; + int patientTypeID; + int patientType; + String setupID; + + GetNursingProgressNoteRequestModel( + {this.patientID, this.admissionNo, this.patientTypeID = 1, this.patientType = 1, this.setupID }); + + GetNursingProgressNoteRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + setupID = json['SetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['SetupID'] = this.setupID; + return data; + } +} diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart new file mode 100644 index 00000000..fb7fbcec --- /dev/null +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -0,0 +1,44 @@ +class GetNursingProgressNoteResposeModel { + String notes; + dynamic conditionType; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedOn; + + String createdByName; + + String editedByName; + + GetNursingProgressNoteResposeModel( + {this.notes, + this.conditionType, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.editedByName, + this.createdByName}); + + GetNursingProgressNoteResposeModel.fromJson(Map json) { + notes = json['Notes']; + conditionType = json['ConditionType']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + createdByName = json['CreatedByName']; + editedByName = json['EditedByName']; + } + + Map toJson() { + final Map data = new Map(); + data['Notes'] = this.notes; + data['ConditionType'] = this.conditionType; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + return data; + } +} diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index d377916e..2839833a 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -9,13 +9,14 @@ class PatientSearchRequestModel { String? from; String ?to; int ?searchType; + int projectID; String? mobileNo; String? identificationNo; int? nursingStationID; - int? clinicID=0; + int? clinicID = 0; PatientSearchRequestModel( - {this.doctorID = 0, + {this.doctorID, this.firstName = "0", this.middleName = "0", this.lastName = "0", @@ -28,7 +29,8 @@ class PatientSearchRequestModel { this.from = "0", this.to = "0", this.clinicID, - this.nursingStationID = 0}); + this.nursingStationID = 0, + this.projectID}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -45,6 +47,7 @@ class PatientSearchRequestModel { identificationNo = json['IdentificationNo']; nursingStationID = json['NursingStationID']; clinicID = json['ClinicID']; + projectID = json['ProjectID']; } Map toJson() { @@ -63,7 +66,7 @@ class PatientSearchRequestModel { data['IdentificationNo'] = this.identificationNo; data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; - data['ProjectID'] = 0; + data['ProjectID'] = this.projectID; return data; } } diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart index 64f1cb2b..02ffb44e 100644 --- a/lib/core/model/procedure/get_ordered_procedure_request_model.dart +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -1,18 +1,22 @@ class GetOrderedProcedureRequestModel { String? vidaAuthTokenID; int? patientMRN; + int appointmentNo; - GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN}); + GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo}); GetOrderedProcedureRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; } Map toJson() { final Map data = new Map(); data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + return data; } } diff --git a/lib/core/model/referral/MyReferralPatientModel.dart b/lib/core/model/referral/MyReferralPatientModel.dart index 86a0e9c7..17ee2f8f 100644 --- a/lib/core/model/referral/MyReferralPatientModel.dart +++ b/lib/core/model/referral/MyReferralPatientModel.dart @@ -62,6 +62,15 @@ class MyReferralPatientModel { String? referringClinicDescription; String? referringDoctorName; int? referalStatus; + String sourceSetupID; + int sourceProjectId; + String targetSetupID; + int targetProjectId; + int targetClinicID; + int targetDoctorID; + int sourceAppointmentNo; + int targetAppointmentNo; + String remarksFromSource; MyReferralPatientModel( {this.rowID, @@ -104,27 +113,27 @@ class MyReferralPatientModel { this.referralResponseOn, this.priority, this.frequency, - this.mAXResponseTime, - this.episodeID, - this.appointmentNo, - this.appointmentDate, - this.appointmentType, - this.patientMRN, - this.createdOn, - this.clinicID, - this.nationalityID, - this.age, - this.doctorImageURL, - this.frequencyDescription, - this.genderDescription, - this.isDoctorLate, - this.isDoctorResponse, - this.nationalityFlagURL, - this.nursingStationName, - this.priorityDescription, - this.referringClinicDescription, - this.referringDoctorName, - this.referalStatus}); + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName, + this.referalStatus, this.sourceSetupID, this.sourceAppointmentNo, this.sourceProjectId, this.targetProjectId, this.targetAppointmentNo, this.targetClinicID, this.targetSetupID, this.targetDoctorID, this.remarksFromSource}); MyReferralPatientModel.fromJson(Map json) { rowID = json['RowID']; @@ -201,6 +210,16 @@ class MyReferralPatientModel { priorityDescription = json['PriorityDescription']; referringClinicDescription = json['ReferringClinicDescription']; referringDoctorName = json['ReferringDoctorName']; + sourceSetupID = json['SourceSetupID']; + sourceProjectId = json['SourceProjectId']; + targetSetupID = json['TargetSetupID']; + targetProjectId = json['TargetProjectId']; + targetClinicID = json['TargetClinicID']; + targetDoctorID = json['TargetDoctorID']; + sourceAppointmentNo = json['SourceAppointmentNo']; + targetAppointmentNo = json['TargetAppointmentNo']; + remarksFromSource = json['RemarksFromSource']; + } Map toJson() { @@ -266,6 +285,15 @@ class MyReferralPatientModel { data['PriorityDescription'] = this.priorityDescription; data['ReferringClinicDescription'] = this.referringClinicDescription; data['ReferringDoctorName'] = this.referringDoctorName; + data['SourceSetupID'] = this.sourceSetupID; + data['SourceProjectId'] = this.sourceProjectId; + data['TargetSetupID'] = this.targetSetupID; + data['TargetProjectId'] = this.targetProjectId; + data['TargetClinicID'] = this.targetClinicID; + data['TargetDoctorID'] = this.targetDoctorID; + data['SourceAppointmentNo'] = this.sourceAppointmentNo; + data['TargetAppointmentNo'] = this.targetAppointmentNo; + data['RemarksFromSource'] = this.remarksFromSource; return data; } diff --git a/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart new file mode 100644 index 00000000..26bb76bd --- /dev/null +++ b/lib/core/model/sick_leave/sick_leave_doctor_request_model.dart @@ -0,0 +1,28 @@ +class GetSickLeaveDoctorRequestModel { + int patientMRN; + String appointmentNo; + int status; + String vidaAuthTokenID; + String vidaRefreshTokenID; + + GetSickLeaveDoctorRequestModel( + {this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID}); + + GetSickLeaveDoctorRequestModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + status = json['status']; + vidaAuthTokenID = json['VidaAuthTokenID']; + vidaRefreshTokenID = json['VidaRefreshTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['status'] = this.status; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + return data; + } +} diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index db701206..1caaa066 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -1,41 +1,46 @@ import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; class SickLeavePatientModel { - String? setupID; - int? projectID; - int? patientID; - int? patientType; - int? clinicID; - int? doctorID; - int? requestNo; - String? requestDate; - int? sickLeaveDays; - int? appointmentNo; - int? admissionNo; - int? actualDoctorRate; - String? appointmentDate; - String? clinicName; - String? doctorImageURL; - String? doctorName; - int? doctorRate; - String? doctorTitle; - int? gender; - String? genderDescription; - bool? isActiveDoctorProfile; - bool? isDoctorAllowVedioCall; - bool? isExecludeDoctor; - bool? isInOutPatient; - String? isInOutPatientDescription; - String? isInOutPatientDescriptionN; - bool? isLiveCareAppointment; - int? noOfPatientsRate; + dynamic setupID; + dynamic projectID; + dynamic patientID; + dynamic patientType; + dynamic clinicID; + dynamic doctorID; + dynamic requestNo; + dynamic requestDate; + dynamic sickLeaveDays; + dynamic appointmentNo; + dynamic admissionNo; + dynamic actualDoctorRate; + dynamic appointmentDate; + dynamic clinicName; + dynamic doctorImageURL; + dynamic doctorName; + dynamic doctorRate; + dynamic doctorTitle; + dynamic gender; + dynamic genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + dynamic isInOutPatientDescription; + dynamic isInOutPatientDescriptionN; + bool isLiveCareAppointment; + dynamic noOfPatientsRate; dynamic patientName; - String? projectName; - String? qR; - // List speciality; - String? strRequestDate; - String? startDate; - String? endDate; + dynamic projectName; + dynamic qR; + // List speciality; + dynamic strRequestDate; + dynamic startDate; + dynamic endDate; + dynamic isExtendedLeave; + dynamic noOfDays; + dynamic patientMRN; + dynamic remarks; + dynamic status; SickLeavePatientModel( {this.setupID, @@ -72,10 +77,19 @@ class SickLeavePatientModel { // this.speciality, this.strRequestDate, this.startDate, - this.endDate}); + this.endDate, + this.isExtendedLeave, + this.noOfDays, + this.patientMRN, + this.remarks, + this.status}); SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; + isExtendedLeave = json['isExtendedLeave']; + noOfDays = json['noOfDays']; + patientMRN = json['patientMRN']; + status = json['status']; projectID = json['ProjectID']; patientID = json['PatientID']; @@ -109,13 +123,17 @@ class SickLeavePatientModel { qR = json['QR']; // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; - startDate = json['StartDate']; + startDate = json['StartDate'] ?? json['startDate']; endDate = json['EndDate']; } Map toJson() { final Map data = new Map(); data['SetupID'] = this.setupID; + data['status'] = this.status; + data['isExtendedLeave'] = this.isExtendedLeave; + data['noOfDays'] = this.noOfDays; + data['patientMRN'] = this.patientMRN; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; diff --git a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart index 535836d8..0abe94fe 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_request_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_request_model.dart @@ -10,6 +10,7 @@ class SickLeavePatientRequestModel { int? patientTypeID; String? tokenID; int? patientID; + int patientMRN; String? sessionID; SickLeavePatientRequestModel( @@ -24,10 +25,12 @@ class SickLeavePatientRequestModel { this.patientTypeID, this.tokenID, this.patientID, - this.sessionID}); + this.sessionID, + this.patientMRN}); SickLeavePatientRequestModel.fromJson(Map json) { versionID = json['VersionID']; + patientMRN = json['PatientMRN']; channel = json['Channel']; languageID = json['LanguageID']; iPAdress = json['IPAdress']; @@ -44,6 +47,7 @@ class SickLeavePatientRequestModel { Map toJson() { final Map data = new Map(); data['VersionID'] = this.versionID; + data['PatientMRN'] = this.patientMRN; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart new file mode 100644 index 00000000..0ad669ab --- /dev/null +++ b/lib/core/service/AnalyticsService.dart @@ -0,0 +1,16 @@ +import 'package:firebase_analytics/firebase_analytics.dart'; +import 'package:firebase_analytics/observer.dart'; +import 'package:flutter/cupertino.dart'; + +class AnalyticsService { + final FirebaseAnalytics _analytics = FirebaseAnalytics(); + + FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics); + + Future logEvent({@required String eventCategory, @required String eventAction}) async { + await _analytics.logEvent(name: 'event', parameters: { + "eventCategory": eventCategory, + "eventAction": eventAction, + }); + } +} diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index 11b12ec5..f32c2c0d 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -15,4 +15,12 @@ class NavigationService { Future pushNamedAndRemoveUntil(String routeName) { return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName,(asd)=>false); } + + Future pushAndRemoveUntil(Route newRoute) { + return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); + } + + pop() { + return navigatorKey.currentState.pop(); + } } \ No newline at end of file diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart new file mode 100644 index 00000000..236bcd42 --- /dev/null +++ b/lib/core/service/PatientRegistrationService.dart @@ -0,0 +1,108 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; + +class PatientRegistrationService extends BaseService { + GetPatientInfoResponseModel getPatientInfoResponseModel; + String logInTokenID; + + checkPatientForRegistration( + CheckPatientForRegistrationModel registrationModel) async { + hasError = false; + await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION, + onSuccess: (dynamic response, int statusCode) { + //TODO Elham* fix it + logInTokenID = "OjEi/qgRekGICZm5/a4jbQ=="; //response["LogInTokenID"]; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } + + getPatientInfo(GetPatientInfoRequestModel getPatientInfoRequestMode) async { + hasError = false; + await baseAppClient.post(GET_PATIENT_INFO, + onSuccess: (dynamic response, int statusCode) { + getPatientInfoResponseModel = + GetPatientInfoResponseModel.fromJson(response); + print("ddd"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientInfoRequestMode.toJson()); + } + + sendActivationCodeByOTPNotificationType( + {SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel, + int otpType, + PatientRegistrationViewModel model, + CheckPatientForRegistrationModel + checkPatientForRegistrationModel}) async { + registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel( + oTPSendType: otpType, + patientIdentificationID: checkPatientForRegistrationModel + .patientIdentificationID, + patientMobileNumber: checkPatientForRegistrationModel + .patientMobileNumber, + zipCode: checkPatientForRegistrationModel.zipCode, + patientOutSA: 0, + healthId: model.getPatientInfoResponseModel.healthId, + dOB: checkPatientForRegistrationModel.dOB, + isRegister: checkPatientForRegistrationModel.isRegister, + isHijri: checkPatientForRegistrationModel.isHijri, + sessionID: null, + generalid: GENERAL_ID, + isDentalAllowedBackend: false, + projectOutSA: 0, + searchType: 1, + versionID: 7.1, + channel: 3, + nationalID: + model.checkPatientForRegistrationModel.patientIdentificationID, + patientID: 0, + mobileNo: model.checkPatientForRegistrationModel.patientMobileNumber + .toString(), + loginType: otpType, + logInTokenID: logInTokenID); + + hasError = false; + await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION, + onSuccess: (dynamic response, int statusCode) { + registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( + response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } + + checkActivationCode(CheckActivationCodeModel registrationModel) async { + hasError = false; + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT, + onSuccess: (dynamic response, int statusCode) { + registrationModel = CheckActivationCodeModel.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } + + registrationPatient(PatientRegistrationModel registrationModel) async { + hasError = false; + await baseAppClient.post(PATIENT_REGISTRATION, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: registrationModel.toJson()); + } +} diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index d07c640d..697b78e3 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -22,56 +22,78 @@ class VideoCallService extends BaseService{ late PatiantInformtion patient; LiveCarePatientServices _liveCarePatientServices = locator(); - openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{ + openVideo(StartCallRes startModel, PatiantInformtion patientModel, + bool isRecording,VoidCallback onCallConnected, VoidCallback onCallDisconnected) async { this.startCallRes = startModel; this.patient = patientModel; - DoctorProfileModel? doctorProfile = await getDoctorProfile(isGetProfile: true); + DoctorProfileModel? doctorProfile = + await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", - kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg - kApiKey: '46209962',//'47247954' + // TODO MOSA TEST + kToken: startCallRes.openTokenID, + kSessionId: startCallRes.openSessionID, + kApiKey:'46209962', + // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", + // kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg", + // kApiKey:'47247954', vcId: patient.vcId, - patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), + isRecording: isRecording, + patientName: patient.fullName ?? + (patient.firstName != null + ? "${patient.firstName} ${patient.lastName}" + : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, doctorId: doctorProfile!.doctorID, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); - },onCallConnected: onCallConnected, + }, + onCallConnected: onCallConnected, + onCallDisconnected: onCallDisconnected, onCallEnd: () { WidgetsBinding.instance!.addPostFrameCallback((_) async { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); - endCall(patient.vcId!, false,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); - if (hasError) { - DrAppToastMsg.showErrorToast(error); - }else - locator().navigateTo(PATIENTS_END_Call,arguments: { - "patient": patient, - }); + GifLoaderDialogUtils.showMyDialog( + locator().navigatorKey.currentContext!); + endCall( + patient.vcId!, + false, - }); + ).then((value) { + GifLoaderDialogUtils.hideDialog( + locator().navigatorKey.currentContext!); + if (hasError) { + DrAppToastMsg.showErrorToast(error); + } else + locator() + .navigateTo(PATIENTS_END_Call, arguments: { + "patient": patient, + }); + }); }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { WidgetsBinding.instance!.addPostFrameCallback((_) { - GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!); - endCall(patient.vcId!, sessionStatusModel.sessionStatus == 3,).then((value) { - GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!); + GifLoaderDialogUtils.showMyDialog( + locator().navigatorKey.currentContext!); + endCall( + patient.vcId!, + sessionStatusModel.sessionStatus == 3, + ).then((value) { + GifLoaderDialogUtils.hideDialog( + locator().navigatorKey.currentContext!); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { - locator().navigateTo(PATIENTS_END_Call,arguments: { + locator() + .navigateTo(PATIENTS_END_Call, arguments: { "patient": patient, }); } - }); - - }); + }); }); - } + Future endCall(int vCID, bool isPatient) async { hasError = false; await getDoctorProfile(isGetProfile: true); @@ -85,5 +107,4 @@ class VideoCallService extends BaseService{ error = _liveCarePatientServices.error!; } } - -} \ No newline at end of file +} diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index ac069304..a8a87c8f 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -14,7 +13,11 @@ class BaseService { List patientArrivalList = []; -//TODO add the user login model when we need it + BaseService(){ + doctorProfile = null; + } + + //TODO add the user login model when we need it Future ? getDoctorProfile({bool isGetProfile = false}) async { if(isGetProfile) { diff --git a/lib/core/service/home/doctor_reply_service.dart b/lib/core/service/home/doctor_reply_service.dart index 2ffb3ee8..c3f4584d 100644 --- a/lib/core/service/home/doctor_reply_service.dart +++ b/lib/core/service/home/doctor_reply_service.dart @@ -1,57 +1,77 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; -import 'package:doctor_app_flutter/models/doctor/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; class DoctorReplyService extends BaseService { - - List get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable; + List get listDoctorWorkingHoursTable => + _listDoctorWorkingHoursTable; + List get listDoctorNotRepliedQuestions => + _listDoctorNotRepliedQuestions; List _listDoctorWorkingHoursTable = []; - - - RequestDoctorReply _requestDoctorReply = RequestDoctorReply(); + List _listDoctorNotRepliedQuestions = []; List _listMyReferralPatientModel = []; - List get listMyReferralPatientModel => _listMyReferralPatientModel; - Future getDoctorReply() async { + List get listMyReferralPatientModel => + _listMyReferralPatientModel; + int notRepliedCount = 0; + + Future getDoctorReply(RequestDoctorReply _requestDoctorReply, + {bool clearData = false, bool isGettingNotReply = false}) async { hasError = false; - await baseAppClient.post(GT_MY_PATIENT_QUESTION, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post( + GT_MY_PATIENT_QUESTION, + onSuccess: (dynamic response, int statusCode) { + if (clearData) { + if(isGettingNotReply) + _listDoctorNotRepliedQuestions.clear(); + else _listDoctorWorkingHoursTable.clear(); - response['List_GtMyPatientsQuestions'].forEach((v) { - _listDoctorWorkingHoursTable - .add(ListGtMyPatientsQuestions.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestDoctorReply.toJson(),); + } + + + response['List_GtMyPatientsQuestions'].forEach((v) { + + if(isGettingNotReply) + _listDoctorNotRepliedQuestions.add(ListGtMyPatientsQuestions.fromJson(v)); + else + _listDoctorWorkingHoursTable + .add(ListGtMyPatientsQuestions.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _requestDoctorReply.toJson(), + ); + } + + Future createDoctorResponse( + CreateDoctorResponseModel createDoctorResponseModel) async { + hasError = false; + await baseAppClient.post( + CREATE_DOCTOR_RESPONSE, + body: createDoctorResponseModel.toJson(), + onSuccess: (dynamic body, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); } - Future replay( - String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { - RequestMyReferralPatientModel _requestMyReferralPatient = - RequestMyReferralPatientModel(); - RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = - RequestAddReferredDoctorRemarks(); - - _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo.toString(); - _requestAddReferredDoctorRemarks.patientID = model.patientID; - _requestAddReferredDoctorRemarks.referredDoctorRemarks = - referredDoctorRemarks; - _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; - _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; + Future getNotRepliedCount() async { + hasError = false; await baseAppClient.post( - ADD_REFERRED_DOCTOR_REMARKS, - body: _requestAddReferredDoctorRemarks.toJson(), + GET_DOCTOR_NOT_REPLIED_COUNTS, + body: {}, onSuccess: (dynamic body, int statusCode) { - print("succsss"); - // model.referredDoctorRemarks = referredDoctorRemarks; - // listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] = - // model; + notRepliedCount = body["DoctorNotRepliedCounts"]; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index 7a0033b9..a06a8974 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -11,11 +11,11 @@ class ScanQrService extends BaseService { hasError = false; await getDoctorProfile(); - if (isMyInpatient) { - requestModel.doctorID = doctorProfile!.doctorID!; - } else { - requestModel.doctorID = 0; - } + // if (isMyInpatient) { + // requestModel.doctorID = doctorProfile!.doctorID!; + // } else { + requestModel.doctorID = 0; + //} await baseAppClient.post( GET_PATIENT_IN_PATIENT_LIST, diff --git a/lib/core/service/home/schedule_service.dart b/lib/core/service/home/schedule_service.dart index 674facda..1776b470 100644 --- a/lib/core/service/home/schedule_service.dart +++ b/lib/core/service/home/schedule_service.dart @@ -21,6 +21,6 @@ class ScheduleService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestSchedule.toJson(),); + }, body: _requestSchedule.toJson(),isFallLanguage: true); } } diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 40968550..b0bf13e1 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -1,7 +1,7 @@ - import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart'; import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; @@ -34,15 +34,34 @@ class LiveCarePatientServices extends BaseService { StartCallRes get startCallRes => _startCallRes; Future getPendingPatientERForDoctorApp( - PendingPatientERForDoctorAppRequestModel - pendingPatientERForDoctorAppRequestModel) async { + PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async { hasError = false; await baseAppClient.post( GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - _patientList.clear(); + List localPatientList = []; + response['List_PendingPatientList'].forEach((v) { - _patientList.add(PatiantInformtion.fromJson(v)); + localPatientList.add(PatiantInformtion.fromJson(v)); + }); + + /// add new items. + localPatientList.forEach((element) { + if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + _patientList.add(element); + } + }); + + /// remove items. + List removedPatientList = []; + _patientList.forEach((element) { + if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + removedPatientList.add(element); + } + }); + + removedPatientList.forEach((element) { + _patientList.remove(element); }); }, onFailure: (String error, int statusCode) { @@ -102,20 +121,17 @@ class LiveCarePatientServices extends BaseService { Future sendSMSInstruction(int vcID) async { hasError = false; - await baseAppClient.post(SEND_SMS_INSTRUCTIONS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) { transferToAdminResponse = response; }, onFailure: (String error, int statusCode) { hasError =true; super.error = error; - }, body: { - "VC_ID": vcID, "generalid": GENERAL_ID - }, isLiveCare: _isLive); + }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async { hasError = false; - await getDoctorProfile( ); + await getDoctorProfile(); isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID!; await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { isLoginResponse = response; @@ -129,17 +145,48 @@ class LiveCarePatientServices extends BaseService { hasError = false; alternativeServicesList.clear(); - await baseAppClient.post(GET_ALTERNATIVE_SERVICE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) { response['AlternativeServicesList'].forEach((v) { alternativeServicesList.add(AlternativeService.fromJson(v)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: { - "VC_ID": vcID, - "generalid": GENERAL_ID - }, isLiveCare: _isLive); + }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); + } + + Future addPatientToDoctorList({int vcID}) async { + hasError = false; + await getDoctorProfile(); + AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); + + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.vCID = vcID; + addPatientToDoctorListRequestModel.isOutKsa = false; + addPatientToDoctorListRequestModel.generalid = GENERAL_ID; + + await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async { + isLoginResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); + } + + Future removePatientFromDoctorList({int vcID}) async { + hasError = false; + AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); + await getDoctorProfile(); + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.vCID = vcID; + addPatientToDoctorListRequestModel.isOutKsa = false; + addPatientToDoctorListRequestModel.generalid = GENERAL_ID; + + await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async { + isLoginResponse = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); } } diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 946d631f..f1185786 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -100,20 +100,22 @@ class MyReferralInPatientService extends BaseService { ); } - Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async { + Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async { hasError = false; await getDoctorProfile(); AddReferredRemarksRequestModel _requestAddReferredDoctorRemarks = AddReferredRemarksRequestModel( editedBy: doctorProfile!.doctorID!, projectID: doctorProfile!.projectID!, referredDoctorRemarks: referredDoctorRemarks, - referalStatus: referalStatus); + referalStatus: referralStatus); _requestAddReferredDoctorRemarks.projectID = referral.projectID!; + + //TODO Check this in case out patient _requestAddReferredDoctorRemarks.admissionNo = int.parse(referral.admissionNo!); _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo!; _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; _requestAddReferredDoctorRemarks.editedBy = doctorProfile!.doctorID!; - _requestAddReferredDoctorRemarks.referalStatus = referalStatus; + _requestAddReferredDoctorRemarks.referalStatus = referralStatus; // _requestAddReferredDoctorRemarks.patientID = referral.patientID; // _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index fd9e25b3..5d4caa50 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; @@ -233,18 +234,18 @@ class PatientReferralService extends LookupService { ); } - Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async { hasError = false; DoctorProfileModel? doctorProfile = await getDoctorProfile(); Map body = Map(); - body['PatientMRN'] = pendingReferral.patientID; - body['AppointmentNo'] = pendingReferral.targetAppointmentNo; - body['SetupID'] = pendingReferral.targetSetupID; - body['ProjectID'] = pendingReferral.targetProjectId; + body['PatientMRN'] = referralPatient.patientID; + body['AppointmentNo'] = referralPatient.targetAppointmentNo; + body['SetupID'] = referralPatient.targetSetupID; + body['ProjectID'] = referralPatient.targetProjectId; body['IsAccepted'] = isAccepted; - body['PatientName'] = pendingReferral.patientName; - body['ReferralResponse'] = pendingReferral.remarksFromSource; + body['PatientName'] = referralPatient.patientName; + body['ReferralResponse'] = referralPatient.remarksFromSource; body['DoctorName'] = doctorProfile!.doctorName; await baseAppClient.post( diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index 8648a0cc..32b27ae1 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -9,7 +9,7 @@ class PatientInPatientService extends BaseService { Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async { hasError = false; - await getDoctorProfile(); + await getDoctorProfile(isGetProfile: true); if (isMyInpatient) { requestModel.doctorID = doctorProfile!.doctorID; diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 3d97ae10..0e05c628 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -1,7 +1,13 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; @@ -51,11 +57,21 @@ class PatientService extends BaseService { List get labResultList => _labResultList; - // TODO: replace var with model List _patientProgressNoteList = []; List get patientProgressNoteList => _patientProgressNoteList; + List _patientNursingProgressNoteList = []; + + List get patientNursingProgressNoteList => _patientNursingProgressNoteList; + + List _diagnosisForInPatientList = []; + + List get diagnosisForInPatientList => _diagnosisForInPatientList; + List _diabeticChartValuesList = []; + + List get diabeticChartValuesList => _diabeticChartValuesList; + // TODO: replace var with model var _insuranceApporvalsList = []; @@ -465,4 +481,63 @@ class PatientService extends BaseService { body: _doctorsByClinicIdRequest.toJson(), ); } + + + Future getNursingProgressNote(GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel) async { + hasError = false; + + await baseAppClient.post( + NURSING_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { + _patientNursingProgressNoteList = []; + response['List_NursingProgressNote'].forEach((v) { + _patientNursingProgressNoteList.add( GetNursingProgressNoteResposeModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getNursingProgressNoteRequestModel.toJson(), + ); + } + + Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_DIAGNOSIS_FOR_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _diagnosisForInPatientList = []; + response['List_DiagnosisForInPatient'].forEach((v) { + _diagnosisForInPatientList.add( GetDiagnosisForInPatientResponseModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getDiagnosisForInPatientRequestModel.toJson(), + ); + } + + + Future getDiabeticChartValues(GetDiabeticChartValuesRequestModel getDiabeticChartValuesRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_DIABETIC_CHART_VALUES, + onSuccess: (dynamic response, int statusCode) { + _diabeticChartValuesList = []; + response['List_DiabeticChartValues'].forEach((v) { + _diabeticChartValuesList.add( GetDiabeticChartValuesResponseModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getDiabeticChartValuesRequestModel.toJson(), + ); + } } diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart new file mode 100644 index 00000000..daea1b42 --- /dev/null +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -0,0 +1,32 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; + +class DischargeSummaryService extends BaseService { + List _pendingDischargeSummaryList = []; + List get pendingDischargeSummaryList => _pendingDischargeSummaryList; + + Future getPendingDischargeSummary( + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + + hasError = false; + await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, + onSuccess: (dynamic response, int statusCode) { + _pendingDischargeSummaryList.clear(); + response['List_PendingDischargeSummary'].forEach( + (v) { + _pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getDischargeSummaryReqModel.toJson()); + } +} diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart new file mode 100644 index 00000000..7ac4ade7 --- /dev/null +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; + +class OperationReportService extends BaseService { + List _reservationList = []; + List get reservationList => _reservationList; + + List _operationDetailsList = []; + List get operationDetailsList => _operationDetailsList; + + Future getReservations( + {GetReservationsRequestModel getReservationsRequestModel, + int patientId}) async { + getReservationsRequestModel = + GetReservationsRequestModel(patientID: patientId, doctorID: ""); + + hasError = false; + await baseAppClient.post(GET_RESERVATIONS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + _reservationList.clear(); + response['List_OTReservationDetails'].forEach( + (v) { + _reservationList.add(GetReservationsResponseModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getReservationsRequestModel.toJson()); + } + + Future getOperationReportDetails( + {GetOperationDetailsRequestModel getOperationReportRequestModel, + }) async { + + hasError = false; + await baseAppClient.post(GET_OPERATION_DETAILS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + _operationDetailsList.clear(); + response['List_OperationDetails'].forEach( + (v) { + _operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getOperationReportRequestModel.toJson()); + } + + Future updateOperationReport( + CreateUpdateOperationReportRequestModel + createUpdateOperationReport) async { + await baseAppClient.post(UPDATE_OPERATION_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: createUpdateOperationReport.toJson(), isFallLanguage: true); + } +} diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 4b7a2459..1fe088c0 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -1,5 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; +import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; +import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; @@ -11,6 +14,10 @@ import '../../base/base_service.dart'; class LabsService extends BaseService { List patientLabOrdersList = []; + List _allSpecialLab = []; + List get allSpecialLab => _allSpecialLab; + + AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(); Future getPatientLabOrdersList(PatiantInformtion patient, bool isInpatient) async { hasError = false; @@ -49,6 +56,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = []; List labResultList = []; List labOrdersResultsList = []; + List labOrdersResultHistoryList = []; Future getLaboratoryResult( {String? projectID, @@ -169,4 +177,46 @@ class LabsService extends BaseService { // super.error = error; // }, body: _requestSendLabReportEmail.toJson()); } + + Future getPatientLabOrdersResultHistoryByDescription( + {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + hasError = false; + Map body = Map(); + if (patientLabOrder != null) { + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = 0; + body['ClinicID'] = 0; + } + body['isDentalAllowedBackend'] = false; + body['ProcedureDescription'] = procedureDescription; + await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, + onSuccess: (dynamic response, int statusCode) { + labOrdersResultHistoryList.clear(); + response['ListGeneralResultHistory'].forEach((lab) { + labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getAllSpecialLabResult({int mrn}) async { + _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( + patientID: mrn, + patientType: 1, + patientTypeID: 1, + ); + hasError = false; + _allSpecialLab.clear(); + await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { + response['ListPLSRALL'].forEach((lab) { + var labs = AllSpecialLabResultModel.fromJson(lab); + if (labs.invoiceNo != "0") _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _allSpecialLabResultRequestModel.toJson()); + } } diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 14139715..98536476 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -15,14 +15,15 @@ class PatientMedicalReportService extends BaseService { body['AdmissionNo'] = patient.admissionNo; body['SetupID'] = doctorProfile!.setupID; body['ProjectID'] = doctorProfile!.projectID; - + medicalReportList = []; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { - medicalReportList.clear(); + if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { medicalReportList.add(MedicalReportModel.fromJson(v)); }); } + medicalReportList = medicalReportList.reversed.toList(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error.toString(); @@ -72,6 +73,10 @@ class PatientMedicalReportService extends BaseService { body['AdmissionNo'] = patient.admissionNo; body['InvoiceNo'] = medicalReport.invoiceNo; body['LineItemNo'] = medicalReport.lineItemNo; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; + } + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_VERIFIED, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { @@ -79,4 +84,54 @@ class PatientMedicalReportService extends BaseService { super.error = error.toString(); }, body: body, patient: patient); } + + Future addMedicalReport(PatiantInformtion patient, String htmlText) async { + hasError = false; + Map body = Map(); + // body['TokenID'] = "@dm!n"; + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + body['AdmissionNo'] = int.parse(patient.admissionNo); + body['MedicalReportHTML'] = htmlText; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; + } + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; + + await baseAppClient.postPatient(INSERT_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); + } + + Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + hasError = false; + Map body = Map(); + // body['TokenID'] = "@dm!n"; + + body['LineItemNo'] = limitNumber; + body['InvoiceNo'] = invoiceNumber; + + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + //body['AdmissionNo'] = int.parse(patient.admissionNo); + body['MedicalReportHTML'] = htmlText; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; + } + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; + + await baseAppClient.postPatient(UPDATE_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, body: body, patient: patient); + } } diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index 22e5044d..55ab7a89 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/in_patient_prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; @@ -16,10 +18,13 @@ import '../../base/base_service.dart'; class PrescriptionsService extends BaseService { List prescriptionsList = []; + List medicationForInPatient = []; List prescriptionsOrderList = []; List prescriptionInPatientList = []; InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(); + GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = + GetMedicationForInPatientRequestModel(); Future getPrescriptionInPatient({int? mrn, String? adn}) async { _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( @@ -100,8 +105,7 @@ class PrescriptionsService extends BaseService { Future getListPharmacyForPrescriptions({int? itemId, @required PatiantInformtion? patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient!, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient!, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions)); @@ -118,8 +122,7 @@ class PrescriptionsService extends BaseService { List prescriptionReportEnhList = []; - Future getPrescriptionReportEnh( - {PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { + Future getPrescriptionReportEnh({PrescriptionsOrder? prescriptionsOrder, @required PatiantInformtion? patient}) async { ///This logic copy from the old app from class [order-history.component.ts] in line 45 bool isInPatient = false; prescriptionsList.forEach((element) { @@ -184,4 +187,24 @@ class PrescriptionsService extends BaseService { super.error = error; }, body: body); } + + Future getMedicationForInPatient(PatiantInformtion patient) async { + hasError = false; + _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel( + isDentalAllowedBackend: false, + admissionNo: int.parse(patient.admissionNo), + tokenID: "@dm!n", + projectID: patient.projectId, + ); + await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, + onSuccess: (dynamic response, int statusCode) { + medicationForInPatient.clear(); + response['List_GetMedicationForInpatient'].forEach((prescriptions) { + medicationForInPatient.add(GetMedicationForInPatientModel.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _getMedicationForInPatientRequestModel.toJson()); + } } diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 936eacd7..576c593d 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -104,8 +104,10 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int? mrn}) async { - _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(patientMRN: mrn); + Future getProcedure({int? mrn, int appointmentNo}) async { + _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( + patientMRN: mrn, + ); hasError = false; _procedureList.clear(); await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 63dcd188..7ebbd348 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -16,8 +16,7 @@ class RadiologyService extends BaseService { body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient!, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient!, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -32,7 +31,7 @@ class RadiologyService extends BaseService { url = GET_IN_PATIENT_ORDERS; body['ProjectID'] = patient.projectId; } - + finalRadiologyList.clear(); hasError = false; await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; @@ -40,7 +39,7 @@ class RadiologyService extends BaseService { if (isInPatient) { label = "List_GetRadOreders"; } - if(response[label] == null || response[label].length == 0){ + if (response[label] == null || response[label].length == 0) { label = "FinalRadiologyList"; } response[label].forEach((radiology) { diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 0294c3e7..6efeba18 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_doctor_request_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; @@ -6,11 +7,12 @@ import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/models/sickleave/sick_leave_statisitics_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; class SickLeaveService extends BaseService { - Map get sickLeavestatisitics => _statistics; - Map _statistics = {}; + SickLeaveStatisticsModel get sickLeavestatisitics => _statistics; + SickLeaveStatisticsModel _statistics = SickLeaveStatisticsModel(); List get getOffTimeList => offTime; List offTime = []; List get getReasons => reasonse; @@ -26,12 +28,12 @@ class SickLeaveService extends BaseService { dynamic get postReschedule => _postReschedule; dynamic _postReschedule; - dynamic get sickLeaveResponse => _sickLeaveResponse; - dynamic _sickLeaveResponse; List getAllSickLeavePatient = []; + List getAllSickLeaveDoctor = []; SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); + GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(); Future getStatistics(appoNo, patientMRN) async { hasError = false; @@ -39,8 +41,8 @@ class SickLeaveService extends BaseService { GET_SICKLEAVE_STATISTIC, onSuccess: (dynamic response, int statusCode) { print(response); - _statistics = {}; - _statistics = response['SickLeaveStatistics']; + + _statistics = SickLeaveStatisticsModel.fromJson(response['SickLeaveStatistics']); }, onFailure: (String error, int statusCode) { hasError = true; @@ -51,14 +53,10 @@ class SickLeaveService extends BaseService { } Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { - // addSickLeaveRequest.appointmentNo = '2016054661'; - // addSickLeaveRequest.patientMRN = '3120746'; hasError = false; await baseAppClient.post( ADD_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - _sickLeaveResponse = response; - return Future.value(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -78,7 +76,6 @@ class SickLeaveService extends BaseService { await baseAppClient.post( EXTEND_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - _sickLeaveResponse = response; return Future.value(response); }, onFailure: (String error, int statusCode) { @@ -132,6 +129,28 @@ class SickLeaveService extends BaseService { ); } + Future getSickLeaveDoctor(patientMRN) async { + _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(patientMRN: patientMRN); + hasError = false; + getAllSickLeaveDoctor = []; + getAllSickLeaveDoctor.clear(); + await baseAppClient.post( + GET_SICK_LEAVE_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + getAllSickLeaveDoctor.clear(); + response['SickLeavesList']['entityList'].forEach((v) { + getAllSickLeaveDoctor.add(SickLeavePatientModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _sickLeaveDoctorRequestModel.toJson(), + ); + } + Future getRescheduleLeave() async { hasError = false; await baseAppClient.post( diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index 588dd904..d206de77 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -14,6 +14,8 @@ import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; @@ -62,6 +64,18 @@ class SOAPService extends LookupService { }, body: postEpisodeReqModel.toJson()); } + Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel postEpisodeForInpatientRequestModel) async { + hasError = false; + + await baseAppClient.post(POST_EPISODE_FOR_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { + episodeID = response['EpisodeID']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postEpisodeForInpatientRequestModel.toJson()); + } + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; @@ -69,7 +83,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = error; + super.error = super.error+ "\n"+error; }, body: postAllergyRequestModel.toJson()); } @@ -79,12 +93,13 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = error; + super.error =super.error + "\n"+error; }, body: postHistoriesRequestModel.toJson()); } Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; + super.error =""; await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -130,7 +145,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = error; + super.error = "\n"+error; }, body: patchAllergyRequestModel.toJson()); } @@ -140,12 +155,13 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = error; + super.error = super.error +"\n"+error; }, body: patchHistoriesRequestModel.toJson()); } Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { hasError = false; + super.error =""; await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -268,4 +284,19 @@ class SOAPService extends LookupService { super.error = error; }, body: getAssessmentReqModel.toJson()); } + + Future getEpisodeForInpatient( + GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel) async { + hasError = false; + await baseAppClient.post(GET_EPISODE_FOR_INPATIENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + + episodeID = response["GetEpisodeNo"]; + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getEpisodeForInpatientReqModel.toJson()); + } } diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 84162053..535a5b49 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -8,8 +8,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - List patientChiefComplaintList = []; - List patientVitalSignsHistory = []; + List patientChiefComplaintList; + List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; PrescriptionModel? prescriptionList; @@ -22,9 +22,14 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; + patientChiefComplaintList = null; await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); - patientChiefComplaintList.clear(); + if (patientChiefComplaintList != null) { + patientChiefComplaintList.clear(); + } else { + patientChiefComplaintList = new List(); + } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); }); @@ -45,10 +50,15 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); + if (patientVitalSignsHistory != null) { + patientVitalSignsHistory.clear(); + } else { + patientVitalSignsHistory = new List(); + } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); @@ -76,10 +86,15 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; + patientVitalSignsHistory = null; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { - patientVitalSignsHistory.clear(); + if (patientVitalSignsHistory != null) { + patientVitalSignsHistory.clear(); + } else { + patientVitalSignsHistory = new List(); + } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart new file mode 100644 index 00000000..f0bcf5e9 --- /dev/null +++ b/lib/core/service/pending_order_service.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_request_model.dart'; +import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_model.dart'; +import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; + +class PendingOrderService extends BaseService { + List _pendingOrderList = []; + List get pendingOrderList => _pendingOrderList; + + List _admissionOrderList = []; + List get admissionOrderList => _admissionOrderList; + + Future getPendingOrders( + {PendingOrderRequestModel pendingOrderRequestModel, + int patientId, + int admissionNo}) async { + pendingOrderRequestModel = PendingOrderRequestModel( + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + setupID: "010266"); + + hasError = false; + await baseAppClient.post(GET_PENDING_ORDERS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + _pendingOrderList.clear(); + response['List_PendingOrders'].forEach( + (v) { + _pendingOrderList.add(PendingOrderModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: pendingOrderRequestModel.toJson()); + } + + Future getAdmissionOrders( + {AdmissionOrdersRequestModel admissionOrdersRequestModel, + int patientId, + int admissionNo}) async { + admissionOrdersRequestModel = AdmissionOrdersRequestModel( + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + setupID: "010266"); + + hasError = false; + await baseAppClient.post(GET_ADMISSION_ORDERS, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + //admissionOrderList.clear(); + response['List_AdmissionOrders'].forEach( + (v) { + _admissionOrderList.add(AdmissionOrdersModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: admissionOrdersRequestModel.toJson()); + } +} diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 356a3826..e7dc0a92 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -20,8 +20,7 @@ class LiveCarePatientViewModel extends BaseViewModel { StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; - List get alternativeServicesList => - _liveCarePatientServices.alternativeServicesList; + List get alternativeServicesList => _liveCarePatientServices.alternativeServicesList; DashboardService _dashboardService = locator(); @@ -106,8 +105,7 @@ class LiveCarePatientViewModel extends BaseViewModel { selectedServices = getSelectedAlternativeServices(); } - await _liveCarePatientServices.endCallWithCharge( - vcID, selectedServices); + await _liveCarePatientServices.endCallWithCharge(vcID, selectedServices); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error!; setState(ViewState.ErrorLocal); @@ -209,8 +207,7 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 2, serviceName: "LABORATORY"), ); alternativeServicesList.add( - AlternativeService( - serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), + AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"), ); alternativeServicesList.add( AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), @@ -231,11 +228,46 @@ class LiveCarePatientViewModel extends BaseViewModel { AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), ); alternativeServicesList.add( - AlternativeService( - serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), + AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"), ); alternativeServicesList.add( AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), ); } + + updateInCallPatient({PatiantInformtion patient, appointmentNo}) { + _liveCarePatientServices.patientList.forEach((e) { + if (e.patientId == patient.patientId) { + e.episodeNo = 0; + e.appointmentNo = appointmentNo; + return; + } + }); + + setState(ViewState.Idle); + } + + Future addPatientToDoctorList(int vcID) async { + await getDoctorProfile(isGetProfile: true); + setState(ViewState.BusyLocal); + await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future removePatientFromDoctorList(int vcID) async { + await getDoctorProfile(isGetProfile: true); + setState(ViewState.BusyLocal); + await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 31057317..59485e92 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -12,8 +12,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { List get medicalReportList => _service.medicalReportList; - List get medicalReportTemplate => - _service.medicalReportTemplate; + List get medicalReportTemplate => _service.medicalReportTemplate; Future getMedicalReportList(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -25,20 +24,8 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Idle); } - bool hasOnHold(){ - bool hasHold = false; - medicalReportList.forEach((element) { - if(element.status == 1){ - hasHold = true; - } - }); - - return hasHold; - - } - Future getMedicalReportTemplate() async { - setState(ViewState.BusyLocal); + setState(ViewState.Busy); await _service.getMedicalReportTemplate(); if (_service.hasError) { error = _service.error!; @@ -57,14 +44,40 @@ class PatientMedicalReportViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future verifyMedicalReport( - PatiantInformtion patient, MedicalReportModel medicalReport) async { + Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport) async { setState(ViewState.Busy); await _service.verifyMedicalReport(patient, medicalReport); if (_service.hasError) { error = _service.error!; setState(ViewState.ErrorLocal); } else - setState(ViewState.Idle); + await getMedicalReportList(patient); + setState(ViewState.Idle); + } + + Future addMedicalReport(PatiantInformtion patient, String htmlText) async { + setState(ViewState.Busy); + await _service.addMedicalReport(patient, htmlText); + if (_service.hasError) { + error = _service.error!; + await getMedicalReportList(patient); + setState(ViewState.ErrorLocal); + } else + { await getMedicalReportList(patient); + setState(ViewState.Idle); + } + } + + Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + setState(ViewState.Busy); + await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); + if (_service.hasError) { + error = _service.error!; + await getMedicalReportList(patient); + setState(ViewState.ErrorLocal); + } else + { + await getMedicalReportList(patient); + setState(ViewState.Idle);} } } diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart new file mode 100644 index 00000000..64fdae18 --- /dev/null +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -0,0 +1,209 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/service/PatientRegistrationService.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class PatientRegistrationViewModel extends BaseViewModel { + PatientRegistrationService _patientRegistrationService = + locator(); + + GetPatientInfoResponseModel get getPatientInfoResponseModel => + _patientRegistrationService.getPatientInfoResponseModel; + + CheckPatientForRegistrationModel checkPatientForRegistrationModel; + + Future checkPatientForRegistration( + CheckPatientForRegistrationModel registrationModel) async { + checkPatientForRegistrationModel = registrationModel; + + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel.fromJson(registrationModel.toJson()); + setState(ViewState.BusyLocal); + await _patientRegistrationService + .checkPatientForRegistration(registrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getPatientInfo( + GetPatientInfoRequestModel getPatientInfoRequestModel) async { + setState(ViewState.BusyLocal); + + /// TODO Elham* return call service when it working + _patientRegistrationService.getPatientInfoResponseModel = + GetPatientInfoResponseModel.fromJson({ + "Date": null, + "LanguageID": 0, + "ServiceName": 0, + "Time": null, + "AndroidLink": null, + "AuthenticationTokenID": null, + "Data": null, + "Dataw": false, + "DietType": 0, + "ErrorCode": null, + "ErrorEndUserMessage": null, + "ErrorEndUserMessageN": null, + "ErrorMessage": null, + "ErrorType": 0, + "FoodCategory": 0, + "IOSLink": null, + "IsAuthenticated": false, + "MealOrderStatus": 0, + "MealType": 0, + "MessageStatus": 1, + "NumberOfResultRecords": 0, + "PatientBlodType": null, + "SuccessMsg": null, + "SuccessMsgN": null, + "VidaUpdatedResponse": null, + "AccessTokenObject": null, + "Age": 33, + "ClientIdentifierId": null, + "CreatedBy": 0, + "DateOfBirth": "07/31/1988", + "FirstNameAr": "سفيان", + "FirstNameEn": "SUFIAN", + "Gender": "M", + "GenderAr": null, + "GenderEn": null, + "HealthId": "30000018540264", + "IdNumber": "1062938285", + "IdType": "NationalId", + "IsHijri": false, + "IsInstertedOrUpdated": 0, + "IsNull": 0, + "IsPatientExistNHIC": 0, + "IsRecordLockedByCurrentUser": false, + "LastNameAr": "عثمان", + "LastNameEn": "OTHMAN", + "List_ActiveAccessToken": null, + "MaritalStatus": "غير معروف", + "MaritalStatusCode": "U", + "NationalDateOfBirth": "18/12/1408", + "Nationality": "السعودية", + "NationalityCode": "SAU", + "Occupation": "طالب", + "PCDTransactionDataResultList": null, + "PCD_GetVidaPatientForManualVerificationList": null, + "PCD_NHIC_HMG_PatientDetailsMatchCalulationList": null, + "PCD_ReturnValue": 0, + "PatientStatus": "-", + "PlaceofBirth": "فينا", + "PractitionerStatusCode": null, + "PractitionerStatusDescAr": null, + "PractitionerStatusDescEn": null, + "RowCount": 0, + "SecondNameAr": "عبدالهادي", + "SecondNameEn": "ABDULHADI", + "ThirdNameAr": "احمد", + "ThirdNameEn": "A", + "YakeenVidaPatientDataStatisticsByPatientIdList": null, + "YakeenVidaPatientDataStatisticsList": null, + "YakeenVidaPatientDataStatisticsPrefferedList": null, + "accessToken": null, + "categoryCode": 0, + "categoryNameAr": null, + "categoryNameEn": null, + "constraintCode": 0, + "constraintNameAr": null, + "constraintNameEn": null, + "content": null, + "errorList": null, + "licenseExpiryDate": null, + "licenseIssuedDate": null, + "licenseStatusCode": null, + "licenseStatusDescAr": null, + "licenseStatusDescEn": null, + "organizations": null, + "registrationNumber": null, + "specialtyCode": 0, + "specialtyNameAr": null, + "specialtyNameEn": null + }); + // await _patientRegistrationService. + // getPatientInfo(getPatientInfoRequestModel); + // if (_patientRegistrationService.hasError) { + // error = _patientRegistrationService.error!; + // setState(ViewState.ErrorLocal); + // } else + setState(ViewState.Idle); + } + + Future sendActivationCodeByOTPNotificationType( + {SendActivationCodeByOTPNotificationTypeForRegistrationModel + registrationModel, + int otpType, + PatientRegistrationViewModel user}) async { + setState(ViewState.BusyLocal); + print(checkPatientForRegistrationModel); + print(checkPatientForRegistrationModel); + + await _patientRegistrationService.sendActivationCodeByOTPNotificationType( + otpType: otpType, + model: this, + checkPatientForRegistrationModel: checkPatientForRegistrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future checkActivationCode(String code) async { + CheckActivationCodeModel model = CheckActivationCodeModel( + activationCode: code, + patientIdentificationID: + checkPatientForRegistrationModel.patientIdentificationID, + patientMobileNumber: checkPatientForRegistrationModel.patientMobileNumber, + zipCode: checkPatientForRegistrationModel.zipCode, + patientOutSA: 0, + healthId: getPatientInfoResponseModel.healthId, + dOB: checkPatientForRegistrationModel.dOB, + isRegister: checkPatientForRegistrationModel.isRegister, + isHijri: checkPatientForRegistrationModel.isHijri, + sessionID: null, + generalid: GENERAL_ID, + forRegisteration: true, + isDentalAllowedBackend: false, + projectOutSA: 0, + searchType: 1, + versionID: 7.1, + channel: 3, + // TODO Elham* loginType + loginType: 4, + logInTokenID:_patientRegistrationService.logInTokenID , + nationalID: checkPatientForRegistrationModel.patientIdentificationID, + patientID: 0, + mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(), + ); + setState(ViewState.BusyLocal); + await _patientRegistrationService.checkActivationCode(model); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future registrationPatient(PatientRegistrationModel registrationModel) async { + setState(ViewState.BusyLocal); + await _patientRegistrationService.registrationPatient(registrationModel); + if (_patientRegistrationService.hasError) { + error = _patientRegistrationService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 1e77f9e1..b9a9a323 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -14,16 +14,26 @@ import 'base_view_model.dart'; class PatientSearchViewModel extends BaseViewModel { OutPatientService _outPatientService = locator(); - SpecialClinicsService _specialClinicsService = locator(); + SpecialClinicsService _specialClinicsService = + locator(); List get patientList => _outPatientService.patientList; - List get specialClinicalCareMappingList => _specialClinicsService.specialClinicalCareMappingList; + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; List filterData = []; DateTime? selectedFromDate; DateTime? selectedToDate; + int firstSubsetIndex = 0; + int inPatientPageSize = 20; + int lastSubsetIndex = 20; + + List InpatientClinicList = []; + searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { @@ -70,6 +80,14 @@ class PatientSearchViewModel extends BaseViewModel { } } + sortOutPatient({bool isDes = false}) { + if (isDes) + filterData = filterData.reversed.toList(); + else + filterData = filterData.reversed.toList(); + setState(ViewState.Idle); + } + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); await _outPatientService.getPatientFileInformation(patientSearchRequestModel); @@ -94,7 +112,8 @@ class PatientSearchViewModel extends BaseViewModel { selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); dateTo = AppDateUtils.convertDateToFormat(selectedToDate!, 'yyyy-MM-dd'); - dateFrom = AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); + dateFrom = + AppDateUtils.convertDateToFormat(selectedFromDate!, 'yyyy-MM-dd'); } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), 'yyyy-MM-dd'); @@ -126,70 +145,238 @@ class PatientSearchViewModel extends BaseViewModel { List get myIinPatientList => _inPatientService.myInPatientList; List filteredInPatientItems = []; + List filteredMyInPatientItems = []; Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false}) async { await getDoctorProfile(); - if(isLocalBusy) { + if (isLocalBusy) { setState(ViewState.BusyLocal); - } else{ + } else { setState(ViewState.Busy); } if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error!; - if(isLocalBusy) { + if (isLocalBusy) { setState(ViewState.ErrorLocal); - } else{ - setState(ViewState.Error); + } else { + setState(ViewState.Error); } } else { - // setDefaultInPatientList(); + setDefaultInPatientList(); + generateInpatientClinicList(); setState(ViewState.Idle); } } + sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) { + if (isMyInPatient + ? myIinPatientList.length > 0 + : isAllClinic + ? inPatientList.length > 0 + : filteredInPatientItems.length > 0) { + List localInPatient = isMyInPatient + ? [...filteredMyInPatientItems] + : isAllClinic + ? [...inPatientList] + : [...filteredInPatientItems]; + if (isDes) + localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => b + .admissionDateWithDateTimeForm + .compareTo(a.admissionDateWithDateTimeForm)); + else + localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => a + .admissionDateWithDateTimeForm + .compareTo(b.admissionDateWithDateTimeForm)); + if (isMyInPatient) { + filteredMyInPatientItems.clear(); + filteredMyInPatientItems.addAll(localInPatient); + } else if (isAllClinic) { + resetInPatientPagination(); + filteredInPatientItems + .addAll(localInPatient.sublist(firstSubsetIndex, lastSubsetIndex)); + } else { + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(localInPatient); + } + } + setState(ViewState.Idle); + } + + resetInPatientPagination() { + filteredInPatientItems.clear(); + firstSubsetIndex = 0; + lastSubsetIndex = inPatientPageSize - 1; + } + Future setDefaultInPatientList() async { setState(ViewState.BusyLocal); await getDoctorProfile(); - filteredInPatientItems.clear(); - if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList); + resetInPatientPagination(); + if (inPatientList.length > 0) { + lastSubsetIndex = (inPatientList.length < inPatientPageSize - 1 + ? inPatientList.length + : inPatientPageSize - 1); + + filteredInPatientItems + .addAll(inPatientList.sublist(firstSubsetIndex, lastSubsetIndex)); + } + + if (myIinPatientList.length > 0) { + filteredMyInPatientItems.addAll(myIinPatientList); + } setState(ViewState.Idle); } + generateInpatientClinicList() { + InpatientClinicList.clear(); + inPatientList.forEach((element) { + if (!InpatientClinicList.contains(element.clinicDescription)) { + InpatientClinicList.add(element.clinicDescription); + } + }); + } + addOnFilteredList() { + if (lastSubsetIndex < inPatientList.length) { + firstSubsetIndex = firstSubsetIndex + + (inPatientList.length - lastSubsetIndex < inPatientPageSize - 1 + ? inPatientList.length - lastSubsetIndex + : inPatientPageSize - 1); + lastSubsetIndex = lastSubsetIndex + + (inPatientList.length - lastSubsetIndex < inPatientPageSize - 1 + ? inPatientList.length - lastSubsetIndex + : inPatientPageSize - 1); + filteredInPatientItems + .addAll(inPatientList.sublist(firstSubsetIndex, lastSubsetIndex)); + setState(ViewState.Idle); + } + } + + removeOnFilteredList() { + if (lastSubsetIndex - inPatientPageSize - 1 > 0) { + filteredInPatientItems.removeAt(lastSubsetIndex - inPatientPageSize - 1); + setState(ViewState.Idle); + } + } + + filterByHospital({int hospitalId}) { + filteredInPatientItems = []; + for (var i = 0; i < inPatientList.length; i++) { + if (inPatientList[i].projectId == hospitalId) { + filteredInPatientItems.add(inPatientList[i]); + } + } + notifyListeners(); + } + filterByClinic({String clinicName}) { + filteredInPatientItems = []; + for (var i = 0; i < inPatientList.length; i++) { + if (inPatientList[i].clinicDescription == clinicName) { + filteredInPatientItems.add(inPatientList[i]); + } + } + notifyListeners(); + } void clearPatientList() { _inPatientService.inPatientList = []; _inPatientService.myInPatientList = []; } - void filterSearchResults(String query) { + void filterSearchResults(String query, + {bool isAllClinic, bool isMyInPatient}) { var strExist = query.length > 0 ? true : false; - if (strExist) { - filteredInPatientItems = []; - for (var i = 0; i < inPatientList.length; i++) { - String firstName = inPatientList[i].firstName!.toUpperCase(); - String lastName = inPatientList[i].lastName!.toUpperCase(); - String mobile = inPatientList[i].mobileNumber!.toUpperCase(); - String patientID = inPatientList[i].patientId.toString(); - - if (firstName.contains(query.toUpperCase()) || - lastName.contains(query.toUpperCase()) || - mobile.contains(query) || - patientID.contains(query)) { - filteredInPatientItems.add(inPatientList[i]); + + if (isMyInPatient) { + List localFilteredMyInPatientItems = [ + ...myIinPatientList + ]; + + if (strExist) { + filteredMyInPatientItems.clear(); + for (var i = 0; i < localFilteredMyInPatientItems.length; i++) { + String firstName = + localFilteredMyInPatientItems[i].firstName.toUpperCase(); + String lastName = + localFilteredMyInPatientItems[i].lastName.toUpperCase(); + String mobile = + localFilteredMyInPatientItems[i].mobileNumber.toUpperCase(); + String patientID = + localFilteredMyInPatientItems[i].patientId.toString(); + + if (firstName.contains(query.toUpperCase()) || + lastName.contains(query.toUpperCase()) || + mobile.contains(query) || + patientID.contains(query)) { + filteredMyInPatientItems.add(localFilteredMyInPatientItems[i]); + } } + notifyListeners(); + } else { + if (myIinPatientList.length > 0) filteredMyInPatientItems.clear(); + filteredMyInPatientItems.addAll(myIinPatientList); + notifyListeners(); } - notifyListeners(); } else { - if (inPatientList.length > 0) filteredInPatientItems.clear(); - filteredInPatientItems.addAll(inPatientList); - notifyListeners(); + if (isAllClinic) { + if (strExist) { + filteredInPatientItems = []; + for (var i = 0; i < inPatientList.length; i++) { + String firstName = inPatientList[i].firstName!.toUpperCase(); + String lastName = inPatientList[i].lastName!.toUpperCase(); + String mobile = inPatientList[i].mobileNumber!.toUpperCase(); + String patientID = inPatientList[i].patientId.toString(); + + if (firstName.contains(query.toUpperCase()) || + lastName.contains(query.toUpperCase()) || + mobile.contains(query) || + patientID.contains(query)) { + filteredInPatientItems.add(inPatientList[i]); + } + } + notifyListeners(); + } else { + if (inPatientList.length > 0) filteredInPatientItems.clear(); + filteredInPatientItems.addAll(inPatientList); + notifyListeners(); + } + } else { + List localFilteredInPatientItems = [ + ...filteredInPatientItems + ]; + + if (strExist) { + filteredInPatientItems.clear(); + for (var i = 0; i < localFilteredInPatientItems.length; i++) { + String firstName = + localFilteredInPatientItems[i].firstName.toUpperCase(); + String lastName = + localFilteredInPatientItems[i].lastName.toUpperCase(); + String mobile = + localFilteredInPatientItems[i].mobileNumber.toUpperCase(); + String patientID = + localFilteredInPatientItems[i].patientId.toString(); + + if (firstName.contains(query.toUpperCase()) || + lastName.contains(query.toUpperCase()) || + mobile.contains(query) || + patientID.contains(query)) { + filteredInPatientItems.add(localFilteredInPatientItems[i]); + } + } + notifyListeners(); + } else { + if (localFilteredInPatientItems.length > 0) + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(localFilteredInPatientItems); + notifyListeners(); + } + } } } - getSpecialClinicalCareMappingList(clinicId, {bool isLocalBusy = false}) async { if (isLocalBusy) { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 9c3bf75a..09afc8be 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -19,6 +19,8 @@ import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; @@ -26,6 +28,14 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:flutter/material.dart'; import '../../locator.dart'; @@ -70,14 +80,66 @@ class SOAPViewModel extends BaseViewModel { List get patientProgressNoteList => _SOAPService.patientProgressNoteList; List get patientAssessmentList => _SOAPService.patientAssessmentList; + int? get episodeID => _SOAPService.episodeID; + bool isAddProgress = true; + bool isAddExamInProgress = true; + String progressNoteText = ""; + String complaintsControllerError = ''; + String medicationControllerError = ''; + String illnessControllerError = ''; + get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; + get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; + get medicationRouteList => _SOAPService.medicationRouteListWithModel; + get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; + List get allMedicationList => _prescriptionService.allMedicationList; + SubjectiveCallBack subjectiveCallBack; + + setSubjectiveCallBack(SubjectiveCallBack callBack) { + this.subjectiveCallBack = callBack; + } + + nextOnSubjectPage(model) { + subjectiveCallBack.nextFunction(model); + } + + ObjectiveCallBack objectiveCallBack; + + setObjectiveCallBack(ObjectiveCallBack callBack) { + this.objectiveCallBack = callBack; + } + + nextOnObjectivePage(model) { + objectiveCallBack.nextFunction(model); + } + + AssessmentCallBack assessmentCallBack; + + setAssessmentCallBack(AssessmentCallBack callBack) { + this.assessmentCallBack = callBack; + } + + nextOnAssessmentPage(model) { + assessmentCallBack.nextFunction(model); + } + + PlanCallBack planCallBack; + + setPlanCallBack(PlanCallBack callBack) { + this.planCallBack = callBack; + } + + nextOnPlanPage(model) { + planCallBack.nextFunction(model); + } + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); @@ -114,31 +176,12 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { - setState(ViewState.BusyLocal); - await _SOAPService.postAllergy(postAllergyRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { + Future postEpisodeForInPatient( + PostEpisodeForInpatientRequestModel + postEpisodeForInpatientRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postHistories(postHistoriesRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { - setState(ViewState.BusyLocal); - await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); + await _SOAPService.postEpisodeForInPatient( + postEpisodeForInpatientRequestModel); if (_SOAPService.hasError) { error = _SOAPService.error!; @@ -180,40 +223,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { - setState(ViewState.BusyLocal); - await _SOAPService.patchAllergy(patchAllergyRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { - setState(ViewState.BusyLocal); - await _SOAPService.patchHistories(patchHistoriesRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { - setState(ViewState.BusyLocal); - await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } - - Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam( + PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { @@ -274,29 +285,24 @@ class SOAPViewModel extends BaseViewModel { return allergiesString; } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { - setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - - Future getPatientChiefComplaint(GetChiefComplaintReqModel getChiefComplaintReqModel) async { - setState(ViewState.Busy); - await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); - if (_SOAPService.hasError) { - error = _SOAPService.error!; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - - Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam(PatiantInformtion patientInfo, + ) async { + GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo == null + ? "0" + : patientInfo.episodeNo.toString(), + appointmentNo: patientInfo.appointmentNo == null + ? 0 + : int.parse( + patientInfo.appointmentNo.toString(), + ), + ); + if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); + else + getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { @@ -339,6 +345,23 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getEpisodeForInpatient(PatiantInformtion patient) async { + setState(ViewState.BusyLocal); + GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = + GetEpisodeForInpatientReqModel( + patientID: patient.patientId, + admissionNo: int.parse(patient.admissionNo), + patientTypeID: 1); + await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); + if (_SOAPService.hasError) { + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); + } else { + patient.episodeNo = _SOAPService.episodeID; + setState(ViewState.Idle); + } + } + // ignore: missing_return MasterKeyModel? getOneMasterKey({@required MasterKeysService? masterKeys, dynamic id, int? typeId}) { switch (masterKeys) { @@ -441,4 +464,382 @@ class SOAPViewModel extends BaseViewModel { break; } } + + int getFirstIndexForOldExamination( + List mySelectedExamination) { + Iterable examList = + mySelectedExamination.where((element) => !element.isLocal); + + if (examList.length > 0) { + return mySelectedExamination.indexOf(examList.first); + } else + return -1; + } + + onUpdateSubjectStepStart(PatiantInformtion patientInfo) async { + GetChiefComplaintReqModel getChiefComplaintReqModel = + GetChiefComplaintReqModel( + admissionNo: + patientInfo + .admissionNo != + null + ? int.parse(patientInfo.admissionNo) + : null, + patientMRN: patientInfo.patientMRN, + appointmentNo: patientInfo.appointmentNo != null + ? int.parse(patientInfo.appointmentNo.toString()) + : null, + episodeId: patientInfo.episodeNo, + episodeID: patientInfo.episodeNo, + doctorID: ''); + var services = [ + _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel) + ]; + + if (patientInfo.admissionNo == null) { + complaintsControllerError = ''; + medicationControllerError = ''; + illnessControllerError = ''; + GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo.toString(), + appointmentNo: int.parse(patientInfo.appointmentNo.toString()), + doctorID: '', + editedBy: ''); + services.add( + _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true)); + + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: patientInfo.patientMRN, + episodeId: patientInfo.episodeNo, + appointmentNo: int.parse(patientInfo.appointmentNo.toString()), + doctorID: '', + editedBy: ''); + + services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP)); + } + + final results = await Future.wait(services); + await callServicesAfterGetPatientInfoForUpdateSubject(); + } + + callServicesAfterGetPatientInfoForUpdateSubject() async { + var services; + if (patientHistoryList.isNotEmpty) { + if (historyFamilyList.isEmpty) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily) + ]; + } else { + services.add( + _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)); + } + } + if (historyMedicalList.isEmpty) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical) + ]; + } else + services.add( + _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)); + } + if (historySurgicalList.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical) + ]; + } else + services.add( + _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)); + } + if (historySportList.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.HistorySports) + ]; + } else + services.add( + _SOAPService.getMasterLookup(MasterKeysService.HistorySports)); + } + } + + if (patientAllergiesList.isNotEmpty) { + if (allergiesList.isEmpty) if (services == null) { + services = [_SOAPService.getMasterLookup(MasterKeysService.Allergies)]; + } else + services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies)); + if (allergySeverityList.isEmpty) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity) + ]; + } else + services.add( + _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)); + } + } + + final results = await Future.wait(services ?? []); + + if (_SOAPService.hasError) { + error = _SOAPService.error!; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + onAddMedicationStart() async { + setState(ViewState.Busy); + var services; + if (medicationStrengthList.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength) + ]; + } else { + services.add( + _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)); + } + } + if (medicationFrequencyList.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency) + ]; + } else { + services.add(_SOAPService.getMasterLookup( + MasterKeysService.MedicationFrequency)); + } + } + if (medicationDoseTimeList.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime) + ]; + } else { + services.add( + _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)); + } + } + if (medicationRouteList.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute) + ]; + } else { + services.add( + _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)); + } + } + if (allMedicationList.length == 0) { + if (services == null) { + services = [_prescriptionService.getMedicationList()]; + } else { + services.add(_prescriptionService.getMedicationList()); + } + } + + final results = await Future.wait(services ?? []); + + if (_SOAPService.hasError || _prescriptionService.hasError) { + error = _SOAPService.error + _prescriptionService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + callAddAssessmentLookupsServices({bool allowSetState = true}) async { + if (allowSetState) setState(ViewState.Busy); + var services; + if (listOfDiagnosisCondition.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition) + ]; + } else { + services.add( + _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)); + } + } + if (listOfDiagnosisType.length == 0) { + if (services == null) { + services = [ + _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType) + ]; + } else { + services + .add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)); + } + } + if (listOfICD10.length == 0) { + if (services == null) { + services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)]; + } else { + services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10)); + } + } + + final results = await Future.wait(services ?? []); + if (allowSetState) { + if (_SOAPService.hasError) { + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + } + + onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async { + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: int.parse(patientInfo.appointmentNo.toString())); + + var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)]; + + final results = await Future.wait(services); + + if (patientAssessmentList.isNotEmpty) { + await callAddAssessmentLookupsServices(allowSetState: false); + } + + if (_SOAPService.hasError) { + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + postSubjectServices( + {patientInfo, + String complaintsText, + String medicationText, + String illnessText, + List myHistoryList, + List myAllergiesList}) async { + var services; + + PostChiefComplaintRequestModel postChiefComplaintRequestModel = + createPostChiefComplaintRequestModel( + patientInfo: patientInfo, + illnessText: illnessText, + medicationText: medicationText, + complaintsText: complaintsText); + if (patientChiefComplaintList.isEmpty) { + postChiefComplaintRequestModel.editedBy = ''; + services = [ + _SOAPService.postChiefComplaint(postChiefComplaintRequestModel) + ]; + } else { + postChiefComplaintRequestModel.editedBy = ''; + services = [ + _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel) + ]; + } + + if (myHistoryList.length != 0) { + PostHistoriesRequestModel postHistoriesRequestModel = + createPostHistoriesRequestModel( + patientInfo: patientInfo, myHistoryList: myHistoryList); + + if (patientHistoryList.isEmpty) { + services.add(_SOAPService.postHistories(postHistoriesRequestModel)); + } else { + services.add(_SOAPService.patchHistories(postHistoriesRequestModel)); + } + } + + if (myAllergiesList.length != 0) { + PostAllergyRequestModel postAllergyRequestModel =createPostAllergyRequestModel (myAllergiesList:myAllergiesList, patientInfo: patientInfo); + if (patientAllergiesList.isEmpty) { + services.add(_SOAPService.postAllergy(postAllergyRequestModel)); + } else { + services.add(_SOAPService.patchAllergy(postAllergyRequestModel)); + } + + } + + final results = await Future.wait(services); + + if (_SOAPService.hasError) { + error = _SOAPService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( + {patientInfo, + String complaintsText, + String medicationText, + String illnessText}) { + return new PostChiefComplaintRequestModel( + admissionNo: patientInfo.admissionNo != null + ? int.parse(patientInfo.admissionNo) + : null, + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo ?? 0, + appointmentNo: patientInfo.appointmentNo ?? 0, + chiefComplaint: complaintsText, + currentMedication: medicationText, + hopi: illnessText, + isLactation: false, + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); + } + + PostHistoriesRequestModel createPostHistoriesRequestModel( + {patientInfo, List myHistoryList}) { + PostHistoriesRequestModel postHistoriesRequestModel = + new PostHistoriesRequestModel(doctorID: ''); + myHistoryList.forEach((history) { + if (postHistoriesRequestModel.listMedicalHistoryVM == null) + postHistoriesRequestModel.listMedicalHistoryVM = []; + postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + patientMRN: patientInfo.patientMRN, + episodeId: patientInfo.episodeNo, + appointmentNo: patientInfo.appointmentNo, + remarks: "", + historyId: history.selectedHistory.id, + historyType: history.selectedHistory.typeId, + isChecked: history.isChecked, + )); + }); + + return postHistoriesRequestModel; + } + + + PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}){ + PostAllergyRequestModel postAllergyRequestModel = + new PostAllergyRequestModel(); + myAllergiesList.forEach((allergy) { + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == + null) + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: patientInfo.patientMRN, + episodeId: patientInfo.episodeNo, + appointmentNo: patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); + }); + + + return postAllergyRequestModel; + } } diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a38cd0eb..697f5654 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -65,35 +65,25 @@ class AuthenticationViewModel extends BaseViewModel { bool isLogin = false; bool unverified = false; bool isFromLogin = false; - APP_STATUS app_status = APP_STATUS.LOADING; - + APP_STATUS appStatus = APP_STATUS.LOADING; + String localToken =""; AuthenticationViewModel() { getDeviceInfoFromFirebase(); getDoctorProfile(); } - /// select Device IMEI - Future selectDeviceImei(imei) async { - setState(ViewState.Busy); - await _authService.selectDeviceImei(imei); - if (_authService.hasError) { - error = _authService.error!; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } /// Insert Device IMEI - Future insertDeviceImei() async { + Future insertDeviceImei(token) async { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); - var user = await sharedPref.getObj(LAST_LOGIN_USER); - if (user != null) { - user = GetIMEIDetailsModel.fromJson(user); + var data = await sharedPref.getObj(LAST_LOGIN_USER); + if (data != null) { + user = GetIMEIDetailsModel.fromJson(data); } var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE); - profileInfo['IMEI'] = DEVICE_TOKEN; + profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; @@ -109,7 +99,7 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); - insertIMEIDetailsModel.password = await sharedPref.getString(PASSWORD); + insertIMEIDetailsModel.password = userInfo.password; await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { @@ -143,6 +133,7 @@ class AuthenticationViewModel extends BaseViewModel { iMEI: user!.iMEI, facilityId: user!.projectID, memberID: user!.doctorID, + loginDoctorID: int.parse(user.editedBy.toString()), zipCode: user!.outSA == true ? '971' : '966', mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), @@ -163,35 +154,44 @@ class AuthenticationViewModel extends BaseViewModel { int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser!.listMemberInformation![0].memberID, - zipCode: loggedUser!.zipCode, - mobileNumber: loggedUser!.mobileNumber, + memberID: loggedUser.listMemberInformation[0].memberID, + loginDoctorID: loggedUser.listMemberInformation[0].employeeID, otpSendType: authMethodType.getTypeIdService().toString(), - password: password); + ); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { error = _authService.error!; setState(ViewState.ErrorLocal); - } else + } else { + await sharedPref.setString(TOKEN, + _authService.activationCodeForDoctorAppRes.logInTokenID); setState(ViewState.Idle); + } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({required String activationCode}) async { + Future checkActivationCodeForDoctorApp({required String activationCode,bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, - logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), + logInTokenID: await sharedPref.getString(TOKEN), activationCode: activationCode, + memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID , + password: userInfo.password, + facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin:isSilentLogin, generalid: "Cs2020@2016\$2958"); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { error = _authService.error!; setState(ViewState.ErrorLocal); } else { + await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } @@ -230,13 +230,14 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess( - SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); - // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode!); - sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); - sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); - sharedPref.setString(LOGIN_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.logInTokenID!); + setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async { + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + await sharedPref.setString(TOKEN, + sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } saveObjToString(String key, value) async { @@ -270,12 +271,11 @@ class AuthenticationViewModel extends BaseViewModel { /// get doctor profile based on clinic model Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async { ProfileReqModel docInfo = new ProfileReqModel( - doctorID: clinicInfo.doctorID, - clinicID: clinicInfo.clinicID, - license: true, - projectID: clinicInfo.projectID, - tokenID: '', - ); //TODO change the lan + doctorID: clinicInfo.doctorID, + clinicID: clinicInfo.clinicID, + license: true, + projectID: clinicInfo.projectID, + languageID: 2);///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error!; @@ -287,7 +287,7 @@ class AuthenticationViewModel extends BaseViewModel { } /// add some logic in case of check activation code is success - onCheckActivationCodeSuccess() async { + onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { @@ -318,30 +318,31 @@ class AuthenticationViewModel extends BaseViewModel { } } + /// call firebase service to check if the user already login in before or not /// call firebase service to check if the user already login in before or not getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - await _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); - } - - try { - setState(ViewState.Busy); - } catch (e) { - Helpers.showErrorToast("fdfdfdfdf" + e.toString()); + _firebaseMessaging.requestNotificationPermissions(); } + setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); - if (DEVICE_TOKEN == "") { - DEVICE_TOKEN = token!; + if (localToken == "") { + localToken = token; - await _authService.selectDeviceImei(DEVICE_TOKEN); + await _authService.selectDeviceImei(localToken); if (_authService.hasError) { error = _authService.error!; setState(ViewState.ErrorLocal); } else { if (_authService.dashboardItemsList.length > 0) { - user = _authService.dashboardItemsList[0]; - sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + user =_authService.dashboardItemsList[0]; + sharedPref.setObj( + LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + user.vidaRefreshTokenID); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + user.vidaAuthTokenID); this.unverified = true; } setState(ViewState.Idle); @@ -351,26 +352,27 @@ class AuthenticationViewModel extends BaseViewModel { } } + /// determine the status of the app APP_STATUS get status { if (state == ViewState.Busy) { - app_status = APP_STATUS.LOADING; + appStatus = APP_STATUS.LOADING; } else { if (this.doctorProfile != null) - app_status = APP_STATUS.AUTHENTICATED; + appStatus = APP_STATUS.AUTHENTICATED; else if (this.unverified) { - app_status = APP_STATUS.UNVERIFIED; + appStatus = APP_STATUS.UNVERIFIED; } else if (this.isLogin) { - app_status = APP_STATUS.AUTHENTICATED; + appStatus = APP_STATUS.AUTHENTICATED; } else { - app_status = APP_STATUS.UNAUTHENTICATED; + appStatus = APP_STATUS.UNAUTHENTICATED; } } - return app_status; + return appStatus; } setAppStatus(APP_STATUS status) { - this.app_status = status; + this.appStatus = status; notifyListeners(); } @@ -382,7 +384,7 @@ class AuthenticationViewModel extends BaseViewModel { /// logout function logout({bool isFromLogin = false}) async { - DEVICE_TOKEN = ""; + localToken = ""; String lang = await sharedPref.getString(APP_Language); await Helpers.clearSharedPref(); doctorProfile = null; @@ -390,7 +392,7 @@ class AuthenticationViewModel extends BaseViewModel { deleteUser(); await getDeviceInfoFromFirebase(); this.isFromLogin = isFromLogin; - app_status = APP_STATUS.UNAUTHENTICATED; + appStatus = APP_STATUS.UNAUTHENTICATED; setState(ViewState.Idle); } diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index cdc0f3d9..f4d052cf 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -1,3 +1,5 @@ +import 'dart:isolate'; + import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; @@ -19,12 +21,12 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; - notifyListeners(); + + notifyListeners(); } Future ?getDoctorProfile({bool isGetProfile = false}) async { - if(isGetProfile) - { + if (isGetProfile) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); doctorProfile = DoctorProfileModel.fromJson(profile); if (doctorProfile != null) { @@ -42,10 +44,25 @@ class BaseViewModel extends ChangeNotifier { return doctorProfile; } } - - setDoctorProfile(DoctorProfileModel doctorProfile)async { - await sharedPref.setObj(DOCTOR_PROFILE, doctorProfile); - this.doctorProfile = doctorProfile; - notifyListeners(); + + void getIsolateDoctorProfile(bool isGetProfile) async { + if (isGetProfile) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + } + } + if (doctorProfile == null) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + } + } + } + + setDoctorProfile(DoctorProfileModel doctorProfile) async { + await sharedPref.setObj(DOCTOR_PROFILE, doctorProfile); + this.doctorProfile = doctorProfile; + notifyListeners(); } } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 409fc935..38bf85e6 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,22 +1,23 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; +import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import '../../locator.dart'; import 'authentication_view_model.dart'; import 'base_view_model.dart'; + class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); - SpecialClinicsService _specialClinicsService = locator(); + SpecialClinicsService _specialClinicsService = + locator(); + DoctorReplyService _doctorReplyService = locator(); List get dashboardItemsList => _dashboardService.dashboardItemsList; @@ -24,20 +25,38 @@ class DashboardViewModel extends BaseViewModel { String? get sServiceID => _dashboardService.sServiceID; - List get specialClinicalCareList => + int get notRepliedCount => _doctorReplyService.notRepliedCount; + +List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; - Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { + Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); - await projectsProvider.getDoctorClinicsList(); + await getDoctorProfile(isGetProfile: true); - // _firebaseMessaging.setAutoInitEnabled(true); + final results = await Future.wait([ + projectsProvider.getDoctorClinicsList(), + _dashboardService.getDashboard(), + _dashboardService.checkDoctorHasLiveCare(), + _specialClinicsService.getSpecialClinicalCareList(), + ]); + + if (_dashboardService.hasError) { + error = _dashboardService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + + setFirebaseNotification(authProvider); + } + + Future setFirebaseNotification(AuthenticationViewModel authProvider) async { _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); _firebaseMessaging.getToken().then((String? token) async { if (token != '') { - DEVICE_TOKEN = token!; - authProvider.insertDeviceImei(); + // DEVICE_TOKEN = token!; + authProvider.insertDeviceImei(token); } }); } @@ -45,31 +64,21 @@ class DashboardViewModel extends BaseViewModel { Future getDashboard() async { setState(ViewState.Busy); await _dashboardService.getDashboard(); - if (_dashboardService.hasError) { - error = _dashboardService.error!; - setState(ViewState.Error); - } else - setState(ViewState.Idle); } Future checkDoctorHasLiveCare() async { setState(ViewState.Busy); await _dashboardService.checkDoctorHasLiveCare(); - if (_dashboardService.hasError) { - error = _dashboardService.error!; - setState(ViewState.Error); - } else - setState(ViewState.Idle); } Future getSpecialClinicalCareList() async { setState(ViewState.Busy); await _specialClinicsService.getSpecialClinicalCareList(); - if (_specialClinicsService.hasError) { - error = _specialClinicsService.error!; - setState(ViewState.Error); - } else - setState(ViewState.Idle); + // if (_specialClinicsService.hasError) { + // error = _specialClinicsService.error!; + // setState(ViewState.Error); + // } else + // setState(ViewState.Idle); } Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { @@ -82,7 +91,7 @@ class DashboardViewModel extends BaseViewModel { ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { - error = authProvider.error; + error = authProvider.error!; } } @@ -96,11 +105,24 @@ class DashboardViewModel extends BaseViewModel { GetSpecialClinicalCareListResponseModel? getSpecialClinic(clinicId) { GetSpecialClinicalCareListResponseModel? special; specialClinicalCareList.forEach((element) { - if (element.clinicID == 1) { + if (element.clinicID == clinicId) { special = element; } }); return special; } + + Future getNotRepliedCount() async { + setState(ViewState.BusyLocal); + await getDoctorProfile(); + await _doctorReplyService.getNotRepliedCount(); + if (_doctorReplyService.hasError) { + error = _doctorReplyService.error!; + setState(ViewState.ErrorLocal); + } else { + notifyListeners(); + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 37a61afe..bb7dd336 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; +import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -10,25 +12,57 @@ class DoctorReplayViewModel extends BaseViewModel { List get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable; + List get listDoctorNotRepliedQuestions => + _doctorReplyService.listDoctorNotRepliedQuestions; - Future getDoctorReply() async { - setState(ViewState.Busy); - await _doctorReplyService.getDoctorReply(); + Future getDoctorReply( + {int pageSize = 10, + int pageIndex = 1, + bool isLocalBusy = true, + bool isGettingNotReply = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await getDoctorProfile(); + RequestDoctorReply _requestDoctorReply = + RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize); + if (isGettingNotReply) + _requestDoctorReply.infoStatus = 99; //to get the not replied only + + await _doctorReplyService.getDoctorReply(_requestDoctorReply, + clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply); if (_doctorReplyService.hasError) { error = _doctorReplyService.error!; - setState(ViewState.Error); + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } } else setState(ViewState.Idle); } - Future replay( - String referredDoctorRemarks, ListGtMyPatientsQuestions model) async { + Future createDoctorResponse( + String response, ListGtMyPatientsQuestions model) async { + await getDoctorProfile(); + CreateDoctorResponseModel createDoctorResponseModel = + CreateDoctorResponseModel( + transactionNo: model.transactionNo.toString(), + doctorResponse: response, + infoStatus: 6, + createdBy: this.doctorProfile.doctorID, + infoEnteredBy: this.doctorProfile.doctorID, + setupID: "010266"); setState(ViewState.BusyLocal); - await _doctorReplyService.replay(referredDoctorRemarks, model); + await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); if (_doctorReplyService.hasError) { error = _doctorReplyService.error!; setState(ViewState.ErrorLocal); - } else + } else { setState(ViewState.Idle); + _doctorReplyService.getNotRepliedCount(); + } } } diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 674dddd5..aca7c9e0 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; +import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; @@ -15,16 +17,16 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); - List get labOrdersResultsList => - _labsService.labOrdersResultsList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; + List get allSpecialLabList => _labsService.allSpecialLab; List _patientLabOrdersListClinic = []; List _patientLabOrdersListHospital = []; List get patientLabOrdersList => - filterType == FilterType.Clinic - ? _patientLabOrdersListClinic - : _patientLabOrdersListHospital; + filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; + + List get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList; void getLabs(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -34,41 +36,33 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List patientLabOrdersClinic = _patientLabOrdersListClinic + .where((elementClinic) => elementClinic.filterName == element.clinicDescription) + .toList(); if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] + _patientLabOrdersListClinic[_patientLabOrdersListClinic.indexOf(patientLabOrdersClinic[0])] .patientLabOrdersList .add(element); } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription!, - patientDoctorAppointment: element)); + _patientLabOrdersListClinic + .add(PatientLabOrdersList(filterName: element.clinicDescription!, patientDoctorAppointment: element)); } // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List patientLabOrdersHospital = _patientLabOrdersListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] + _patientLabOrdersListHospital[_patientLabOrdersListHospital.indexOf(patientLabOrdersHospital[0])] .patientLabOrdersList .add(element); } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName!, - patientDoctorAppointment: element)); + _patientLabOrdersListHospital + .add(PatientLabOrdersList(filterName: element.projectName!, patientDoctorAppointment: element)); } }); @@ -81,8 +75,7 @@ class LabsViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; @@ -115,15 +108,12 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult( - {required PatientLabOrders patientLabOrder, + getPatientLabResult({required PatientLabOrders patientLabOrder, required PatiantInformtion patient, required bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient); + patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error!; setState(ViewState.Error); @@ -132,33 +122,25 @@ class LabsViewModel extends BaseViewModel { } } - void setLabResultDependOnFilterName(){ + void setLabResultDependOnFilterName() { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists - .where( - (elementClinic) => elementClinic.filterName == element.testCode) - .toList(); + List patientLabOrdersClinic = + labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists - .add(LabResultList(filterName: element.testCode!, lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode!, lab: element)); } }); } - getPatientLabOrdersResults( - {required PatientLabOrders patientLabOrder, + getPatientLabOrdersResults({required PatientLabOrders patientLabOrder, required String procedure, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, - procedure: procedure, - patient: patient); + patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { error = _labsService.error!; setState(ViewState.Error); @@ -166,9 +148,8 @@ class LabsViewModel extends BaseViewModel { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue!.contains('/') || - element.resultValue!.contains('*') || - element.resultValue!.isEmpty) isShouldClear = true; + if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) + isShouldClear = true; }); } if (isShouldClear) _labsService.labOrdersResultsList.clear(); @@ -176,6 +157,19 @@ class LabsViewModel extends BaseViewModel { } } + getPatientLabResultHistoryByDescription( + {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResultHistoryByDescription( + patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); + if (_labsService.hasError) { + error = _labsService.error!; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { @@ -183,4 +177,14 @@ class LabsViewModel extends BaseViewModel { } else DrAppToastMsg.showSuccesToast(mes); } + + Future getAllSpecialLabResult({int patientId}) async { + setState(ViewState.Busy); + await _labsService.getAllSpecialLabResult(mrn: patientId); + if (_labsService.hasError) { + error = _labsService.error!; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 8dd898bc..b74c7d25 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -202,9 +202,9 @@ class PatientReferralViewModel extends BaseViewModel { getMyReferralPatientService(); } - Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async { setState(ViewState.Busy); - await _referralPatientService.responseReferral(pendingReferral, isAccepted); + await _referralPatientService.responseReferral(referralPatient, isAccepted); if (_referralPatientService.hasError) { error = _referralPatientService.error!; setState(ViewState.ErrorLocal); @@ -255,17 +255,7 @@ class PatientReferralViewModel extends BaseViewModel { } } - Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { - setState(ViewState.Busy); - await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn); - if (_referralPatientService.hasError) { - error = _referralPatientService.error!; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } Future getReferralFrequencyList() async { setState(ViewState.Busy); @@ -302,13 +292,13 @@ class PatientReferralViewModel extends BaseViewModel { String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).pending ?? "" /*referralStatusHold*/; + return TranslationBase.of(context).referralStatusHold??"" /*pending*/; case 2: - return TranslationBase.of(context).accepted ?? "" /*referralStatusActive*/; + return TranslationBase.of(context).referralStatusActive??"" /* accepted*/; case 4: - return TranslationBase.of(context).rejected ?? "" /*referralStatusCancelled*/; + return TranslationBase.of(context).referralStatusCancelled ??""/*rejected*/; case 46: - return TranslationBase.of(context).accepted ?? "" /*referralStatusCompleted*/; + return TranslationBase.of(context).referralStatusCompleted??"" /*accepted*/; case 63: return TranslationBase.of(context).rejected ?? "" /*referralStatusNotSeen*/; default: @@ -321,6 +311,7 @@ class PatientReferralViewModel extends BaseViewModel { patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; patient.patientId = referredPatient.patientID; + patient.patientMRN = referredPatient.patientID; patient.firstName = referredPatient.firstName; patient.middleName = referredPatient.middleName; patient.lastName = referredPatient.lastName; @@ -338,6 +329,8 @@ class PatientReferralViewModel extends BaseViewModel { patient.nationalityFlagURL = referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription; + patient.appointmentNo = referredPatient.appointmentNo; + return patient; } @@ -391,9 +384,9 @@ class PatientReferralViewModel extends BaseViewModel { return patient; } - Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referalStatus) async { + Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async { setState(ViewState.Busy); - await _myReferralService.replayReferred(referredDoctorRemarks, referral, referalStatus); + await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus); if (_myReferralService.hasError) { error = _myReferralService.error!; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 4c4d6e56..7c3dfb4e 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -32,16 +32,22 @@ class UcafViewModel extends BaseViewModel { List get orderProcedures => _ucafService.orderProcedureList; - late String selectedLanguage; + Function saveUCAFOnTap; + + String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; String temperatureCelcius = "0"; String hartRat = "0"; String respirationBeatPerMinute = "0"; - String bloodPressure = "0 / 0"; + String bloodPressure = "0/0"; - resetDataInFirst() { + resetDataInFirst({bool firstPage = true}) { + if(firstPage){ + _ucafService.patientVitalSignsHistory = null; + _ucafService.patientChiefComplaintList = null; + } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; _ucafService.prescriptionList = null; @@ -52,7 +58,7 @@ class UcafViewModel extends BaseViewModel { } Future getUCAFData(PatiantInformtion patient) async { - setState(ViewState.Busy); + // setState(ViewState.Busy); String from; String to; @@ -99,7 +105,7 @@ class UcafViewModel extends BaseViewModel { Future getPatientAssessment(PatiantInformtion patient) async { if (patientAssessmentList.isEmpty) { - setState(ViewState.Busy); + // setState(ViewState.Busy); await _ucafService.getPatientAssessment(patient); if (_ucafService.hasError) { error = _ucafService.error!; @@ -125,7 +131,7 @@ class UcafViewModel extends BaseViewModel { Future getOrderProcedures(PatiantInformtion patient) async { if (orderProcedures.isEmpty) { - setState(ViewState.Busy); + // setState(ViewState.Busy); await _ucafService.getOrderProcedures(patient); if (_ucafService.hasError) { error = _ucafService.error!; @@ -138,7 +144,7 @@ class UcafViewModel extends BaseViewModel { Future getPrescription(PatiantInformtion patient) async { if (prescriptionList == null) { - setState(ViewState.Busy); + // setState(ViewState.Busy); await _ucafService.getPrescription(patient); if (_ucafService.hasError) { error = _ucafService.error!; @@ -173,7 +179,7 @@ class UcafViewModel extends BaseViewModel { } Future postUCAF(PatiantInformtion patient) async { - setState(ViewState.Busy); + // setState(ViewState.Busy); await _ucafService.postUCAF(patient); if (_ucafService.hasError) { error = _ucafService.error!; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 7b25b6fe..a11bb8f6 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -1,5 +1,11 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; @@ -21,41 +27,60 @@ class PatientViewModel extends BaseViewModel { List get inPatientList => _patientService.inPatientList; - List get patientVitalSignList => _patientService.patientVitalSignList; + List get patientVitalSignList => + _patientService.patientVitalSignList; - List get patientVitalSignOrderdSubList => _patientService.patientVitalSignOrderdSubList; + List get patientVitalSignOrderdSubList => + _patientService.patientVitalSignOrderdSubList; - List get patientLabResultOrdersList => _patientService.patientLabResultOrdersList; + List get patientLabResultOrdersList => + _patientService.patientLabResultOrdersList; - List get patientPrescriptionsList => _patientService.patientPrescriptionsList; + List get patientPrescriptionsList => + _patientService.patientPrescriptionsList; List get prescriptionReportForInPatientList => _patientService.prescriptionReportForInPatientList; - List get prescriptionReport => _patientService.prescriptionReport; + List get prescriptionReport => + _patientService.prescriptionReport; - List get patientRadiologyList => _patientService.patientRadiologyList; + List get patientRadiologyList => + _patientService.patientRadiologyList; List get labResultList => _patientService.labResultList; get insuranceApporvalsList => _patientService.insuranceApporvalsList; - List get patientProgressNoteList => _patientService.patientProgressNoteList; + List get patientProgressNoteList => + _patientService.patientProgressNoteList; + + List get patientNursingProgressNoteList => + _patientService.patientNursingProgressNoteList; + + List get diagnosisForInPatientList => + _patientService.diagnosisForInPatientList; + + List get diabeticChartValuesList => + _patientService.diabeticChartValuesList; List get clinicsList => _patientService.clinicsList; List get doctorsList => _patientService.doctorsList; - List get referralFrequencyList => _patientService.referalFrequancyList; + List get referralFrequencyList => + _patientService.referalFrequancyList; - Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async { + Future getPatientList(patient, patientType, + {bool isBusyLocal = false, isView}) async { var localRes; if (isBusyLocal) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - localRes = await _patientService.getPatientList(patient, patientType, isView: isView); + localRes = await _patientService.getPatientList(patient, patientType, + isView: isView); if (_patientService.hasError) { error = _patientService.error!; @@ -204,12 +229,16 @@ class PatientViewModel extends BaseViewModel { } List getDoctorNameList() { - var doctorNamelist = _patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList(); + var doctorNamelist = _patientService.doctorsList + .map((value) => value['DoctorName'].toString()) + .toList(); return doctorNamelist; } List getClinicNameList() { - var clinicsNameslist = _patientService.clinicsList.map((value) => value['ClinicDescription'].toString()).toList(); + var clinicsNameslist = _patientService.clinicsList + .map((value) => value['ClinicDescription'].toString()) + .toList(); return clinicsNameslist; } @@ -224,8 +253,9 @@ class PatientViewModel extends BaseViewModel { } List getReferralNamesList() { - var referralNamesList = - _patientService.referalFrequancyList.map((value) => value['Description'].toString()).toList(); + var referralNamesList = _patientService.referalFrequancyList + .map((value) => value['Description'].toString()) + .toList(); return referralNamesList; } @@ -271,7 +301,8 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false}) async { await getDoctorProfile(); setState(ViewState.Busy); @@ -284,4 +315,60 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getNursingProgressNote( + GetNursingProgressNoteRequestModel requestModel) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + await _patientService.getNursingProgressNote(requestModel); + if (_patientService.hasError) { + error = _patientService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getDiagnosisForInPatient( + GetDiagnosisForInPatientRequestModel requestModel) async { + await getDoctorProfile(); + setState(ViewState.Busy); + + await _patientService.getDiagnosisForInPatient(requestModel); + if (_patientService.hasError) { + error = _patientService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getDiabeticChartValues(PatiantInformtion patient, int resultType, + {bool isLocalBusy = false}) async { + await getDoctorProfile(); + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); + + GetDiabeticChartValuesRequestModel requestModel = + GetDiabeticChartValuesRequestModel( + patientID: patient.patientId, + admissionNo: int.parse(patient.admissionNo), + patientTypeID: 1, + patientType: 1, + resultType: resultType, + setupID: "010266"); + await _patientService.getDiabeticChartValues(requestModel); + if (_patientService.hasError) { + error = _patientService.error!; + if (isLocalBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart new file mode 100644 index 00000000..cbf81c15 --- /dev/null +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -0,0 +1,43 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; + +class PendingOrdersViewModel extends BaseViewModel { + bool hasError = false; + PendingOrderService _pendingOrderService = locator(); + + List get pendingOrdersList => + _pendingOrderService.pendingOrderList; + + List get admissionOrderList => + _pendingOrderService.admissionOrderList; + + Future getPendingOrders({int patientId, int admissionNo}) async { + hasError = false; + setState(ViewState.Busy); + await _pendingOrderService.getPendingOrders( + patientId: patientId, admissionNo: admissionNo); + if (_pendingOrderService.hasError) { + error = _pendingOrderService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getAdmissionOrders({int patientId, int admissionNo}) async { + hasError = false; + setState(ViewState.Busy); + await _pendingOrderService.getAdmissionOrders( + patientId: patientId, admissionNo: admissionNo); + if (_pendingOrderService.hasError) { + error = _pendingOrderService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 349da950..53b95099 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; @@ -27,6 +28,7 @@ class PrescriptionViewModel extends BaseViewModel { bool hasError = false; PrescriptionService _prescriptionService = locator(); List get allMedicationList => _prescriptionService.allMedicationList; + List get medicationForInPatient => _prescriptionsService.medicationForInPatient; List get prescriptionList => _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; @@ -249,4 +251,15 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + getMedicationForInPatient(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _prescriptionsService.getMedicationForInPatient(patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart index d0718597..b1a23a14 100644 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; @@ -29,6 +30,10 @@ class PrescriptionsViewModel extends BaseViewModel { List get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; + List get medicationForInPatient => _prescriptionsService.medicationForInPatient; + + List _medicationForInPatient = []; + getPrescriptions(PatiantInformtion patient) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); @@ -123,4 +128,14 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + getMedicationForInPatient(PatiantInformtion patient) async { + await _prescriptionsService.getMedicationForInPatient(patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 81edda20..f7dfad9a 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -60,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel { List _patientLabOrdersListClinic = []; List _patientLabOrdersListHospital = []; - Future getProcedure({int? mrn, String? patientType}) async { + Future getProcedure({int? mrn, String? patientType, int appointmentNo}) async { hasError = false; await getDoctorProfile(); //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); if (_procedureService.hasError) { error = _procedureService.error!; if (patientType == "7") diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart new file mode 100644 index 00000000..b147a11b --- /dev/null +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -0,0 +1,31 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; + +class DischargeSummaryViewModel extends BaseViewModel { + bool hasError = false; + DischargeSummaryService _dischargeSummaryService = + locator(); + + List get pendingDischargeSummaryList => + _dischargeSummaryService.pendingDischargeSummaryList; + + + Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + hasError = false; + setState(ViewState.Busy); + await _dischargeSummaryService.getPendingDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + if (_dischargeSummaryService.hasError) { + error = _dischargeSummaryService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + +} diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart new file mode 100644 index 00000000..1d37bc16 --- /dev/null +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -0,0 +1,59 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; + +class OperationReportViewModel extends BaseViewModel { + bool hasError = false; + OperationReportService _operationReportService = + locator(); + + List get reservationList => + _operationReportService.reservationList; + + List get operationDetailsList => + _operationReportService.operationDetailsList; + + Future getReservations(int patientId) async { + hasError = false; + setState(ViewState.Busy); + await _operationReportService.getReservations(patientId: patientId); + if (_operationReportService.hasError) { + error = _operationReportService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getOperationReportDetails(GetReservationsResponseModel reservation) async { + hasError = false; + setState(ViewState.Busy); + GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" ); + await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel); + if (_operationReportService.hasError) { + error = _operationReportService.error!; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + + + Future updateOperationReport( + CreateUpdateOperationReportRequestModel + createUpdateOperationReport) async { + setState(ViewState.BusyLocal); + await _operationReportService.updateOperationReport(createUpdateOperationReport); + if (_operationReportService.hasError) { + error = _operationReportService.error!; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index e2e6bc06..087f5019 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -104,8 +104,8 @@ class ProjectViewModel with ChangeNotifier { return Future.value(localRes); } catch (error) { - print(error); - throw error; + //print(error); + //throw error; } } diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index ea10d13c..02f98ef7 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -13,7 +13,7 @@ class ScanQrViewModel extends BaseViewModel { await getDoctorProfile(); setState(ViewState.Busy); - await _scanQrService.getInPatient(requestModel, true); + await _scanQrService.getInPatient(requestModel, isMyInpatient); if (_scanQrService.hasError) { error = _scanQrService.error!; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 60eebe88..181f5c94 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,23 +1,39 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/models/sickleave/sick_leave_statisitics_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); - get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; + PatientService _patientService = locator(); + + SickLeaveStatisticsModel get sickLeaveStatistics => + _sickLeaveService.sickLeavestatisitics; + get getAllSIckLeave => _sickLeaveService.getAllSickLeave; - get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; + List get allOffTime => _sickLeaveService.getOffTimeList; + List get allReasons => _sickLeaveService.getReasons; + List get coveringDoctors => _sickLeaveService.coveringDoctorsList; + + List get sickLeaveDoctor => _sickLeaveService.getAllSickLeaveDoctor; + get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; + get postSechedule => _sickLeaveService.postReschedule; - get sickleaveResponse => _sickLeaveService.sickLeaveResponse; + get getAllSIckLeavePatient => [ + ..._sickLeaveService.getAllSickLeavePatient, + ..._sickLeaveService.getAllSickLeaveDoctor + ]; Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.BusyLocal); await _sickLeaveService.addSickLeave(addSickLeaveRequest); @@ -29,11 +45,11 @@ class SickLeaveViewModel extends BaseViewModel { } Future extendSickLeave(GetAllSickLeaveResponse extendSickLeaveRequest) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); if (_sickLeaveService.hasError) { error = _sickLeaveService.error!; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } @@ -58,9 +74,43 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getSickLeavePatient(patientMRN) async { - setState(ViewState.Busy); + Future getSickLeavePatient(patientMRN, {bool isLocalBusy = false}) async { + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); await _sickLeaveService.getSickLeavePatient(patientMRN); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error!; + setState(ViewState.ErrorLocal); + + } else + setState(ViewState.Idle); + } + + Future getSickLeaveForPatient(PatiantInformtion patient, {bool isLocalBusy = false}) async { + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); + var patientMRN = patient.patientMRN ?? patient.patientId; + var services = [_sickLeaveService.getSickLeavePatient(patientMRN),_sickLeaveService.getSickLeaveDoctor(patientMRN) ]; + + final results = await Future.wait(services); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error!; + // if (isLocalBusy) + setState(ViewState.ErrorLocal); + // else + // setState(ViewState.Error); + + } else + setState(ViewState.Idle); + } + + Future getSickLeaveDoctor(patientMRN) async { + setState(ViewState.Busy); + await _sickLeaveService.getSickLeaveDoctor(patientMRN); if (_sickLeaveService.hasError) { error = _sickLeaveService.error!; setState(ViewState.ErrorLocal); diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 0959cd52..1f168dab 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/home/home_screen.dart'; import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart'; diff --git a/lib/locator.dart b/lib/locator.dart index d74fad8b..18c04ffc 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,16 +1,23 @@ import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; +import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; +import 'core/service/PatientRegistrationService.dart'; import 'core/service/VideoCallService.dart'; import 'core/service/home/dasboard_service.dart'; import 'core/service/home/doctor_reply_service.dart'; @@ -25,6 +32,7 @@ import 'core/service/patient/out_patient_service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart'; import 'core/service/patient/patientInPatientService.dart'; import 'core/service/patient/patient_service.dart'; +import 'core/service/patient/profile/operation_report_servive.dart'; import 'core/service/patient/referral_patient_service.dart'; import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; @@ -46,6 +54,7 @@ import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart'; import 'core/viewModel/PatientMedicalReportViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; +import 'core/viewModel/PatientRegistrationViewModel.dart'; import 'core/viewModel/PatientSearchViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; @@ -98,6 +107,11 @@ void setupLocator() { locator.registerLazySingleton(() => ScanQrService()); locator.registerLazySingleton(() => SpecialClinicsService()); locator.registerLazySingleton(() => VideoCallService()); + locator.registerLazySingleton(() => AnalyticsService()); + locator.registerLazySingleton(() => OperationReportService()); + locator.registerLazySingleton(() => PendingOrderService()); + locator.registerLazySingleton(() => PatientRegistrationService()); + locator.registerLazySingleton(() => DischargeSummaryService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -107,7 +121,7 @@ void setupLocator() { locator.registerFactory(() => PatientViewModel()); locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => SickLeaveViewModel()); - locator.registerFactory(() => SOAPViewModel()); + locator.registerLazySingleton(() => SOAPViewModel()); locator.registerFactory(() => PatientReferralViewModel()); locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => ProcedureViewModel()); @@ -126,4 +140,9 @@ void setupLocator() { locator.registerFactory(() => LiveCarePatientViewModel()); locator.registerFactory(() => PatientMedicalReportViewModel()); locator.registerFactory(() => ScanQrViewModel()); + locator.registerFactory(() => OperationReportViewModel()); + locator.registerFactory(() => PatientRegistrationViewModel()); + locator.registerFactory(() => PendingOrdersViewModel()); + locator.registerFactory(() => DischargeSummaryViewModel()); + } diff --git a/lib/main.dart b/lib/main.dart index c29429b0..450c046f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,7 +2,10 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:firebase_analytics/firebase_analytics.dart'; +import 'package:firebase_analytics/observer.dart'; import 'package:firebase_core/firebase_core.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -11,6 +14,7 @@ import 'package:provider/provider.dart'; import './config/size_config.dart'; import './routes.dart'; import 'config/config.dart'; +import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; import 'core/viewModel/authentication_view_model.dart'; import 'locator.dart'; @@ -32,8 +36,7 @@ class MyApp extends StatelessWidget { SizeConfig().init(constraints, orientation); return MultiProvider( providers: [ - ChangeNotifierProvider( - create: (context) => AuthenticationViewModel()), + ChangeNotifierProvider(create: (context) => AuthenticationViewModel()), ChangeNotifierProvider( create: (context) => ProjectViewModel(), ), @@ -54,6 +57,8 @@ class MyApp extends StatelessWidget { TranslationBaseDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + DefaultCupertinoLocalizations.delegate ], supportedLocales: [ const Locale('ar', ''), // Arabic @@ -67,7 +72,10 @@ class MyApp extends StatelessWidget { dividerColor: Colors.grey[350], backgroundColor: Color.fromRGBO(255, 255, 255, 1), ), - navigatorKey: locator().navigatorKey, + navigatorKey: locator().navigatorKey, + navigatorObservers: [ + locator().getAnalyticsObserver(), + ], initialRoute: INIT_ROUTE, routes: routes, debugShowCheckedModeBanner: false, diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 878205fc..1bb586c2 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -4,8 +4,9 @@ class GetChiefComplaintReqModel { int? episodeId; int? episodeID; dynamic doctorID; + int admissionNo; - GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); + GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -13,15 +14,27 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; + admissionNo = json['admissionNo']; } Map toJson() { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeId'] = this.episodeId; - data['EpisodeID'] = this.episodeID; - data['DoctorID'] = this.doctorID; + if (this.appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + if (this.episodeId != null) { + data['EpisodeId'] = this.episodeId; + } + if (episodeID != null) { + data['EpisodeID'] = this.episodeID; + } + if (doctorID != null) { + data['DoctorID'] = this.doctorID; + } + if (this.admissionNo != null) { + data['AdmissionNo'] = this.admissionNo; + } return data; } diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 57d14a3f..27b454d2 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,6 +1,7 @@ class GetPhysicalExamReqModel { int? patientMRN; int? appointmentNo; + int admissionNo; String? episodeID; String? from; String? to; @@ -10,6 +11,7 @@ class GetPhysicalExamReqModel { GetPhysicalExamReqModel({ this.patientMRN, this.appointmentNo, + this.admissionNo, this.episodeID, this.from, this.to, @@ -31,11 +33,13 @@ class GetPhysicalExamReqModel { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; data['EpisodeID'] = this.episodeID; data['From'] = this.from; data['To'] = this.to; data['DoctorID'] = this.doctorID; data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart new file mode 100644 index 00000000..2b49066e --- /dev/null +++ b/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart @@ -0,0 +1,22 @@ +class GetEpisodeForInpatientReqModel { + int patientID; + int patientTypeID; + int admissionNo; + + GetEpisodeForInpatientReqModel( + {this.patientID, this.patientTypeID, this.admissionNo}); + + GetEpisodeForInpatientReqModel.fromJson(Map json) { + patientID = json['PatientID']; + patientTypeID = json['PatientTypeID']; + admissionNo = json['AdmissionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + data['AdmissionNo'] = this.admissionNo; + return data; + } +} diff --git a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart new file mode 100644 index 00000000..2dff7a60 --- /dev/null +++ b/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart @@ -0,0 +1,22 @@ +class PostEpisodeForInpatientRequestModel { + int admissionNo; + int patientID; + int patientTypeID; + + PostEpisodeForInpatientRequestModel( + {this.admissionNo, this.patientID, this.patientTypeID = 1}); + + PostEpisodeForInpatientRequestModel.fromJson(Map json) { + admissionNo = json['AdmissionNo']; + patientID = json['PatientID']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionNo'] = this.admissionNo; + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart deleted file mode 100644 index 0347a5ba..00000000 --- a/lib/models/SOAP/my_selected_allergy.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedAllergy { - MasterKeyModel? selectedAllergySeverity; - MasterKeyModel? selectedAllergy; - String? remark; - bool? isChecked; - bool? isExpanded; - int? createdBy; - - MySelectedAllergy( - {this.selectedAllergySeverity, - this.selectedAllergy, - this.remark, - this.isChecked, - this.isExpanded = true, - this.createdBy}); - - MySelectedAllergy.fromJson(Map json) { - selectedAllergySeverity = - json['selectedAllergySeverity'] != null ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) : null; - selectedAllergy = json['selectedAllergy'] != null ? new MasterKeyModel.fromJson(json['selectedAllergy']) : null; - remark = json['remark']; - isChecked = json['isChecked']; - isExpanded = json['isExpanded']; - createdBy = json['createdBy']; - } - - Map toJson() { - final Map data = new Map(); - if (this.selectedAllergySeverity != null) { - data['selectedAllergySeverity'] = this.selectedAllergySeverity!.toJson(); - } - if (this.selectedAllergy != null) { - data['selectedAllergy'] = this.selectedAllergy!.toJson(); - } - data['remark'] = this.remark; - data['isChecked'] = this.isChecked; - data['isExpanded'] = this.isExpanded; - data['createdBy'] = this.createdBy; - return data; - } -} diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart deleted file mode 100644 index f683f8b7..00000000 --- a/lib/models/SOAP/my_selected_assement.dart +++ /dev/null @@ -1,64 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedAssessment { - MasterKeyModel? selectedICD; - MasterKeyModel? selectedDiagnosisCondition; - MasterKeyModel? selectedDiagnosisType; - String? remark; - int? appointmentId; - int? createdBy; - String? createdOn; - int? doctorID; - String? doctorName; - String? icdCode10ID; - - MySelectedAssessment( - {this.selectedICD, - this.selectedDiagnosisCondition, - this.selectedDiagnosisType, - this.remark, - this.appointmentId, - this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); - - MySelectedAssessment.fromJson(Map json) { - selectedICD = json['selectedICD'] != null ? new MasterKeyModel.fromJson(json['selectedICD']) : null; - selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null - ? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition']) - : null; - selectedDiagnosisType = - json['selectedDiagnosisType'] != null ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) : null; - remark = json['remark']; - appointmentId = json['appointmentId']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - doctorID = json['doctorID']; - doctorName = json['doctorName']; - icdCode10ID = json['icdCode10ID']; - } - - Map toJson() { - final Map data = new Map(); - - if (this.selectedICD != null) { - data['selectedICD'] = this.selectedICD!.toJson(); - } - if (this.selectedDiagnosisCondition != null) { - data['selectedICD'] = this.selectedDiagnosisCondition!.toJson(); - } - if (this.selectedDiagnosisType != null) { - data['selectedICD'] = this.selectedDiagnosisType!.toJson(); - } - data['remark'] = this.remark; - data['appointmentId'] = this.appointmentId; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['doctorID'] = this.doctorID; - data['doctorName'] = this.doctorName; - data['icdCode10ID'] = this.icdCode10ID; - return data; - } -} diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart deleted file mode 100644 index fc147415..00000000 --- a/lib/models/SOAP/my_selected_examination.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedExamination { - MasterKeyModel? selectedExamination; - String? remark; - bool? isNormal; - bool? isAbnormal; - bool? notExamined; - bool? isNew; - int? createdBy; - - MySelectedExamination( - {this.selectedExamination, - this.remark, - this.isNormal = false, - this.isAbnormal = false, - this.notExamined = true, - this.isNew = true, - this.createdBy}); - - MySelectedExamination.fromJson(Map json) { - selectedExamination = - json['selectedExamination'] != null ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; - remark = json['remark']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - notExamined = json['notExamined']; - isNew = json['isNew']; - createdBy = json['createdBy']; - } - - Map toJson() { - final Map data = new Map(); - - if (this.selectedExamination != null) { - data['selectedExamination'] = this.selectedExamination!.toJson(); - } - data['remark'] = this.remark; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['notExamined'] = this.notExamined; - data['isNew'] = this.isNew; - data['createdBy'] = this.createdBy; - return data; - } -} diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart deleted file mode 100644 index 59ae412a..00000000 --- a/lib/models/SOAP/my_selected_history.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedHistory { - MasterKeyModel? selectedHistory; - String? remark; - bool? isChecked; - - MySelectedHistory({this.selectedHistory, this.remark, this.isChecked}); - - MySelectedHistory.fromJson(Map json) { - selectedHistory = json['selectedHistory'] != null ? new MasterKeyModel.fromJson(json['selectedHistory']) : null; - remark = json['remark']; - remark = json['isChecked']; - } - - Map toJson() { - final Map data = new Map(); - - if (this.selectedHistory != null) { - data['selectedHistory'] = this.selectedHistory!.toJson(); - } - data['remark'] = this.remark; - data['isChecked'] = this.remark; - return data; - } -} diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index fa4c1684..142aadf3 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -2,6 +2,7 @@ class PostChiefComplaintRequestModel { int? appointmentNo; int? episodeID; int? patientMRN; + int admissionNo; String? chiefComplaint; String? hopi; String? currentMedication; @@ -22,7 +23,8 @@ class PostChiefComplaintRequestModel { this.isLactation, this.doctorID, this.editedBy, - this.numberOfWeeks}); + this.numberOfWeeks, + this.admissionNo}); PostChiefComplaintRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -36,12 +38,18 @@ class PostChiefComplaintRequestModel { numberOfWeeks = json['numberOfWeeks']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; + admissionNo = json['AdmissionNo']; } Map toJson() { final Map data = new Map(); - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeID'] = this.episodeID; + if (appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + + if (episodeID != null) { + data['EpisodeID'] = this.episodeID; + } data['PatientMRN'] = this.patientMRN; data['chiefComplaint'] = this.chiefComplaint; data['Hopi'] = this.hopi; @@ -50,7 +58,12 @@ class PostChiefComplaintRequestModel { data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; - data['EditedBy'] = this.editedBy; + if (editedBy != null) { + data['EditedBy'] = this.editedBy; + } + if (admissionNo != null) { + data['AdmissionNo'] = this.admissionNo; + } return data; } diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index d1b44e04..95baafda 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,11 +1,13 @@ class PostPhysicalExamRequestModel { - List? listHisProgNotePhysicalExaminationVM; + List + ? listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { - listHisProgNotePhysicalExaminationVM = []; + listHisProgNotePhysicalExaminationVM = + []; json['listHisProgNotePhysicalExaminationVM'].forEach((v) { listHisProgNotePhysicalExaminationVM!.add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); @@ -15,8 +17,10 @@ class PostPhysicalExamRequestModel { Map toJson() { final Map data = new Map(); if (this.listHisProgNotePhysicalExaminationVM != null) { - data['listHisProgNotePhysicalExaminationVM'] = - this.listHisProgNotePhysicalExaminationVM!.map((v) => v.toJson()).toList(); + data['listHisProgNotePhysicalExaminationVM'] = this + .listHisProgNotePhysicalExaminationVM + !.map((v) => v.toJson()) + .toList(); } return data; } @@ -25,6 +29,7 @@ class PostPhysicalExamRequestModel { class ListHisProgNotePhysicalExaminationVM { int? episodeId; int? appointmentNo; + int? admissionNo; int? examType; int? examId; int? patientMRN; @@ -46,7 +51,7 @@ class ListHisProgNotePhysicalExaminationVM { ListHisProgNotePhysicalExaminationVM( {this.episodeId, this.appointmentNo, - this.examType, + this.admissionNo,this.examType, this.examId, this.patientMRN, this.isNormal, @@ -67,7 +72,7 @@ class ListHisProgNotePhysicalExaminationVM { ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { episodeId = json['episodeId']; appointmentNo = json['appointmentNo']; - examType = json['examType']; + admissionNo = json['AdmissionNo'];examType = json['examType']; examId = json['examId']; patientMRN = json['patientMRN']; isNormal = json['isNormal']; @@ -90,7 +95,7 @@ class ListHisProgNotePhysicalExaminationVM { final Map data = new Map(); data['episodeId'] = this.episodeId; data['appointmentNo'] = this.appointmentNo; - data['examType'] = this.examType; + data['admissionNo'] = this.admissionNo;data['examType'] = this.examType; data['examId'] = this.examId; data['patientMRN'] = this.patientMRN; data['isNormal'] = this.isNormal; diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/models/SOAP/selected_items/my_selected_allergy.dart new file mode 100644 index 00000000..512a4f64 --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_allergy.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedAllergy { + MasterKeyModel selectedAllergySeverity; + MasterKeyModel selectedAllergy; + String remark; + bool isChecked; + bool isExpanded; + bool isLocal; + int createdBy; + bool hasValidationError; + + MySelectedAllergy( + {this.selectedAllergySeverity, + this.selectedAllergy, + this.remark, + this.isChecked, + this.isExpanded = true, + this.isLocal = true, + this.createdBy, + this.hasValidationError = false}); + +} diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/models/SOAP/selected_items/my_selected_assement.dart new file mode 100644 index 00000000..01572e6d --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_assement.dart @@ -0,0 +1,24 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedAssessment { + MasterKeyModel selectedICD; + MasterKeyModel selectedDiagnosisCondition; + MasterKeyModel selectedDiagnosisType; + String remark; + int appointmentId; + int createdBy; + String createdOn; + int doctorID; + String doctorName; + String icdCode10ID; + + MySelectedAssessment( + {this.selectedICD, + this.selectedDiagnosisCondition, + this.selectedDiagnosisType, + this.remark, this.appointmentId, this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); +} diff --git a/lib/models/SOAP/selected_items/my_selected_examination.dart b/lib/models/SOAP/selected_items/my_selected_examination.dart new file mode 100644 index 00000000..75f67ae2 --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_examination.dart @@ -0,0 +1,27 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedExamination { + MasterKeyModel selectedExamination; + String remark; + bool isNormal; + bool isAbnormal; + bool notExamined; + bool isNew; + bool isLocal; + int createdBy; + String createdOn; + String editedOn; + + MySelectedExamination({ + this.selectedExamination, + this.remark, + this.isNormal = false, + this.isAbnormal = false, + this.notExamined = true, + this.isNew = true, + this.isLocal = true, + this.createdBy, + this.createdOn, + this.editedOn, + }); +} diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/models/SOAP/selected_items/my_selected_history.dart new file mode 100644 index 00000000..3769c418 --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_history.dart @@ -0,0 +1,11 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedHistory { + MasterKeyModel selectedHistory; + String remark; + bool isChecked; + bool isLocal; + + MySelectedHistory( + {this.selectedHistory, this.remark, this.isChecked, this.isLocal = true}); +} diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/models/admisson_orders/admission_orders_model.dart new file mode 100644 index 00000000..a0891a02 --- /dev/null +++ b/lib/models/admisson_orders/admission_orders_model.dart @@ -0,0 +1,57 @@ +class AdmissionOrdersModel { + int procedureID; + String procedureName; + String procedureNameN; + int orderNo; + int doctorID; + int clinicID; + String createdOn; + int createdBy; + String editedOn; + int editedBy; + String createdByName; + + AdmissionOrdersModel( + {this.procedureID, + this.procedureName, + this.procedureNameN, + this.orderNo, + this.doctorID, + this.clinicID, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy, + this.createdByName}); + + AdmissionOrdersModel.fromJson(Map json) { + procedureID = json['ProcedureID']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + orderNo = json['OrderNo']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + createdOn = json['CreatedOn']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + createdByName = json['CreatedByName']; + } + + Map toJson() { + final Map data = new Map(); + data['ProcedureID'] = this.procedureID; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['OrderNo'] = this.orderNo; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['CreatedByName'] = this.createdByName; + + return data; + } +} diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/models/admisson_orders/admission_orders_request_model.dart new file mode 100644 index 00000000..897bb8f8 --- /dev/null +++ b/lib/models/admisson_orders/admission_orders_request_model.dart @@ -0,0 +1,76 @@ +class AdmissionOrdersRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; + + AdmissionOrdersRequestModel( + {this.isDentalAllowedBackend, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.admissionNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); + + AdmissionOrdersRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart new file mode 100644 index 00000000..2d2c14ad --- /dev/null +++ b/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart @@ -0,0 +1,27 @@ +class GetDischargeSummaryReqModel { + int patientID; + int admissionNo; + int patientType; + int patientTypeID; + + GetDischargeSummaryReqModel( + {this.patientID, this.admissionNo, this.patientType = 1, this.patientTypeID=1}); + + GetDischargeSummaryReqModel.fromJson(Map json) { + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['SetupID'] = "010266"; + data['isDentalAllowedBackend'] = false; + return data; + } +} diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart new file mode 100644 index 00000000..006ac6a2 --- /dev/null +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -0,0 +1,192 @@ +class GetDischargeSummaryResModel { + String setupID; + int projectID; + int dischargeNo; + String dischargeDate; + int admissionNo; + int assessmentNo; + int patientType; + int patientID; + int clinicID; + int doctorID; + String finalDiagnosis; + String persentation; + String pastHistory; + String planOfCare; + String investigations; + String followupPlan; + String conditionOnDischarge; + String significantFindings; + String planedProcedure; + int daysStayed; + String remarks; + String eRCare; + int status; + bool isActive; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool isPatientDied; + Null isMedicineApproved; + Null isOpenBillDischarge; + Null activatedDate; + Null activatedBy; + Null lAMA; + Null patientCodition; + Null others; + Null reconciliationInstruction; + String dischargeInstructions; + String reason; + Null dischargeDisposition; + Null hospitalID; + String createdByName; + Null createdByNameN; + String editedByName; + Null editedByNameN; + + GetDischargeSummaryResModel( + {this.setupID, + this.projectID, + this.dischargeNo, + this.dischargeDate, + this.admissionNo, + this.assessmentNo, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.finalDiagnosis, + this.persentation, + this.pastHistory, + this.planOfCare, + this.investigations, + this.followupPlan, + this.conditionOnDischarge, + this.significantFindings, + this.planedProcedure, + this.daysStayed, + this.remarks, + this.eRCare, + this.status, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.isPatientDied, + this.isMedicineApproved, + this.isOpenBillDischarge, + this.activatedDate, + this.activatedBy, + this.lAMA, + this.patientCodition, + this.others, + this.reconciliationInstruction, + this.dischargeInstructions, + this.reason, + this.dischargeDisposition, + this.hospitalID, + this.createdByName, + this.createdByNameN, + this.editedByName, + this.editedByNameN}); + + GetDischargeSummaryResModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + dischargeNo = json['DischargeNo']; + dischargeDate = json['DischargeDate']; + admissionNo = json['AdmissionNo']; + assessmentNo = json['AssessmentNo']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + finalDiagnosis = json['FinalDiagnosis']; + persentation = json['Persentation']; + pastHistory = json['PastHistory']; + planOfCare = json['PlanOfCare']; + investigations = json['Investigations']; + followupPlan = json['FollowupPlan']; + conditionOnDischarge = json['ConditionOnDischarge']; + significantFindings = json['SignificantFindings']; + planedProcedure = json['PlanedProcedure']; + daysStayed = json['DaysStayed']; + remarks = json['Remarks']; + eRCare = json['ERCare']; + status = json['Status']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + isPatientDied = json['IsPatientDied']; + isMedicineApproved = json['IsMedicineApproved']; + isOpenBillDischarge = json['IsOpenBillDischarge']; + activatedDate = json['ActivatedDate']; + activatedBy = json['ActivatedBy']; + lAMA = json['LAMA']; + patientCodition = json['PatientCodition']; + others = json['Others']; + reconciliationInstruction = json['ReconciliationInstruction']; + dischargeInstructions = json['DischargeInstructions']; + reason = json['Reason']; + dischargeDisposition = json['DischargeDisposition']; + hospitalID = json['HospitalID']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + data['DischargeDate'] = this.dischargeDate; + data['AdmissionNo'] = this.admissionNo; + data['AssessmentNo'] = this.assessmentNo; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['FinalDiagnosis'] = this.finalDiagnosis; + data['Persentation'] = this.persentation; + data['PastHistory'] = this.pastHistory; + data['PlanOfCare'] = this.planOfCare; + data['Investigations'] = this.investigations; + data['FollowupPlan'] = this.followupPlan; + data['ConditionOnDischarge'] = this.conditionOnDischarge; + data['SignificantFindings'] = this.significantFindings; + data['PlanedProcedure'] = this.planedProcedure; + data['DaysStayed'] = this.daysStayed; + data['Remarks'] = this.remarks; + data['ERCare'] = this.eRCare; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['IsPatientDied'] = this.isPatientDied; + data['IsMedicineApproved'] = this.isMedicineApproved; + data['IsOpenBillDischarge'] = this.isOpenBillDischarge; + data['ActivatedDate'] = this.activatedDate; + data['ActivatedBy'] = this.activatedBy; + data['LAMA'] = this.lAMA; + data['PatientCodition'] = this.patientCodition; + data['Others'] = this.others; + data['ReconciliationInstruction'] = this.reconciliationInstruction; + data['DischargeInstructions'] = this.dischargeInstructions; + data['Reason'] = this.reason; + data['DischargeDisposition'] = this.dischargeDisposition; + data['HospitalID'] = this.hospitalID; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + return data; + } +} diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index a5b881f1..0e630c5f 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,6 +1,6 @@ -import 'package:doctor_app_flutter/util/date-utils.dart'; - class ListGtMyPatientsQuestions { + + Null rowID; String? setupID; int? projectID; int? transactionNo; @@ -8,7 +8,7 @@ class ListGtMyPatientsQuestions { int? patientID; int? doctorID; int? requestType; - DateTime? requestDate; + String? requestDate; String? requestTime; String? remarks; int? status; @@ -17,20 +17,26 @@ class ListGtMyPatientsQuestions { int? editedBy; String? editedOn; String? patientName; - dynamic patientNameN; + Null patientNameN; int? gender; String? dateofBirth; String? mobileNumber; String? emailAddress; - int? admissionNo; - int? referringDoctor; - int? lineItemNo; + int? infoStatus; + String? infoDesc; + String? doctorResponse; + dynamic? responseDate; + int? memberID; + String? memberName; + String? memberNameN; String? age; String? genderDescription; bool? isVidaCall; + String? requestTypeDescription; ListGtMyPatientsQuestions( - {this.setupID, + {this.rowID, + this.setupID, this.projectID, this.transactionNo, this.patientType, @@ -51,14 +57,20 @@ class ListGtMyPatientsQuestions { this.dateofBirth, this.mobileNumber, this.emailAddress, - this.admissionNo, - this.referringDoctor, - this.lineItemNo, + this.infoStatus, + this.infoDesc, + this.doctorResponse, + this.responseDate, + this.memberID, + this.memberName, + this.memberNameN, this.age, this.genderDescription, - this.isVidaCall}); + this.isVidaCall, + this.requestTypeDescription}); ListGtMyPatientsQuestions.fromJson(Map json) { + rowID = json['RowID']; setupID = json['SetupID']; projectID = json['ProjectID']; transactionNo = json['TransactionNo']; @@ -66,7 +78,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = AppDateUtils.convertStringToDate(json['RequestDate']); + requestDate = json['RequestDate']; requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; @@ -80,16 +92,22 @@ class ListGtMyPatientsQuestions { dateofBirth = json['DateofBirth']; mobileNumber = json['MobileNumber']; emailAddress = json['EmailAddress']; - admissionNo = json['AdmissionNo']; - referringDoctor = json['ReferringDoctor']; - lineItemNo = json['LineItemNo']; + infoStatus = json['InfoStatus']; + infoDesc = json['InfoDesc']; + doctorResponse = json['DoctorResponse']; + responseDate = json['ResponseDate']; + memberID = json['MemberID']; + memberName = json['MemberName']; + memberNameN = json['MemberNameN']; age = json['Age']; genderDescription = json['GenderDescription']; isVidaCall = json['IsVidaCall']; + requestTypeDescription = json['RequestTypeDescription']; } Map toJson() { final Map data = new Map(); + data['RowID'] = this.rowID; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['TransactionNo'] = this.transactionNo; @@ -111,12 +129,17 @@ class ListGtMyPatientsQuestions { data['DateofBirth'] = this.dateofBirth; data['MobileNumber'] = this.mobileNumber; data['EmailAddress'] = this.emailAddress; - data['AdmissionNo'] = this.admissionNo; - data['ReferringDoctor'] = this.referringDoctor; - data['LineItemNo'] = this.lineItemNo; + data['InfoStatus'] = this.infoStatus; + data['InfoDesc'] = this.infoDesc; + data['DoctorResponse'] = this.doctorResponse; + data['ResponseDate'] = this.responseDate; + data['MemberID'] = this.memberID; + data['MemberName'] = this.memberName; + data['MemberNameN'] = this.memberNameN; data['Age'] = this.age; data['GenderDescription'] = this.genderDescription; data['IsVidaCall'] = this.isVidaCall; + data['RequestTypeDescription'] = this.requestTypeDescription; return data; } } diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/models/doctor/profile_req_Model.dart index 56d937da..147809ea 100644 --- a/lib/models/doctor/profile_req_Model.dart +++ b/lib/models/doctor/profile_req_Model.dart @@ -29,7 +29,7 @@ class ProfileReqModel { this.languageID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - this.versionID = 5.5, + // this.versionID = 5.5, this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.tokenID, diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/models/doctor/replay/request_create_doctor_response.dart new file mode 100644 index 00000000..49e421d9 --- /dev/null +++ b/lib/models/doctor/replay/request_create_doctor_response.dart @@ -0,0 +1,48 @@ +class CreateDoctorResponseModel { + String setupID; + int projectID; + String transactionNo; + int infoEnteredBy; + int infoStatus; + int createdBy; + int editedBy; + String doctorResponse; + int doctorID; + + CreateDoctorResponseModel( + {this.setupID, + this.projectID, + this.transactionNo, + this.infoEnteredBy, + this.infoStatus, + this.createdBy, + this.editedBy, + this.doctorResponse, + this.doctorID}); + + CreateDoctorResponseModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + transactionNo = json['TransactionNo']; + infoEnteredBy = json['InfoEnteredBy']; + infoStatus = json['InfoStatus']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + doctorResponse = json['DoctorResponse']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['TransactionNo'] = this.transactionNo; + data['InfoEnteredBy'] = this.infoEnteredBy; + data['InfoStatus'] = this.infoStatus; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['DoctorResponse'] = this.doctorResponse; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/models/doctor/request_doctor_reply.dart b/lib/models/doctor/replay/request_doctor_reply.dart similarity index 81% rename from lib/models/doctor/request_doctor_reply.dart rename to lib/models/doctor/replay/request_doctor_reply.dart index 3720d647..f2daa591 100644 --- a/lib/models/doctor/request_doctor_reply.dart +++ b/lib/models/doctor/replay/request_doctor_reply.dart @@ -13,6 +13,9 @@ class RequestDoctorReply { String? sessionID; bool? isLoginForDoctorApp; bool? patientOutSA; + int pageIndex; + int pageSize; + int infoStatus; RequestDoctorReply( {this.projectID, @@ -26,7 +29,10 @@ class RequestDoctorReply { this.tokenID, this.sessionID, this.isLoginForDoctorApp, - this.patientOutSA}); + this.patientOutSA, + this.pageIndex, + this.infoStatus, + this.pageSize}); RequestDoctorReply.fromJson(Map json) { projectID = json['ProjectID']; @@ -41,6 +47,9 @@ class RequestDoctorReply { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; + pageIndex = json['PageIndex']; + pageSize = json['PageSize']; + pageSize = json['InfoStatus']; } Map toJson() { @@ -57,6 +66,10 @@ class RequestDoctorReply { data['SessionID'] = this.sessionID; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; + data['PageIndex'] = this.pageIndex; + data['PageSize'] = this.pageSize; + if(this.infoStatus != null) + data['InfoStatus'] = this.infoStatus; return data; } } diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index 55e70a9a..decd97e6 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -53,7 +53,7 @@ class RequestSchedule { data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; data['DoctorWorkingHoursDays'] = this.doctorWorkingHoursDays; - data['LanguageID'] = this.languageID; + data['LanguageID'] = 2; data['stamp'] = this.stamp; data['IPAdress'] = this.iPAdress; data['VersionID'] = this.versionID; diff --git a/lib/models/livecare/start_call_res.dart b/lib/models/livecare/start_call_res.dart index acbe9c4b..7309c410 100644 --- a/lib/models/livecare/start_call_res.dart +++ b/lib/models/livecare/start_call_res.dart @@ -5,6 +5,7 @@ class StartCallRes { bool? isAuthenticated; int? messageStatus; String? appointmentNo; + bool isRecording; StartCallRes( {this.result, @@ -12,7 +13,9 @@ class StartCallRes { this.openTokenID, this.isAuthenticated, this.appointmentNo, - this.messageStatus}); + this.messageStatus, + this.isRecording = true, + }); StartCallRes.fromJson(Map json) { result = json['Result']; @@ -21,6 +24,7 @@ class StartCallRes { isAuthenticated = json['IsAuthenticated']; messageStatus = json['MessageStatus']; appointmentNo = json['AppointmentNo']; + isRecording = json['IsRecordedSession'] ?? false; } Map toJson() { @@ -31,6 +35,7 @@ class StartCallRes { data['IsAuthenticated'] = this.isAuthenticated; data['MessageStatus'] = this.messageStatus; data['AppointmentNo'] = this.appointmentNo; + data['IsRecordedSession'] = this.isRecording ?? false; return data; } } diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/models/operation_report/create_update_operation_report_request_model.dart new file mode 100644 index 00000000..f6d72b1b --- /dev/null +++ b/lib/models/operation_report/create_update_operation_report_request_model.dart @@ -0,0 +1,108 @@ +class CreateUpdateOperationReportRequestModel { + String setupID; + int patientID; + int reservationNo; + int admissionNo; + String preOpDiagmosis; + String postOpDiagmosis; + String surgeon; + String assistant; + String anasthetist; + String operation; + String inasion; + String finding; + String surgeryProcedure; + String postOpInstruction; + int createdBy; + int editedBy; + String complicationDetails; + String bloodLossDetail; + String histopathSpecimen; + String microbiologySpecimen; + String otherSpecimen; + String scrubNurse; + String circulatingNurse; + String bloodTransfusedDetail; + + CreateUpdateOperationReportRequestModel( + {this.setupID, + this.patientID, + this.reservationNo, + this.admissionNo, + this.preOpDiagmosis, + this.postOpDiagmosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.createdBy, + this.editedBy, + this.complicationDetails, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); + + CreateUpdateOperationReportRequestModel.fromJson(Map json) { + setupID = json['SetupID']; + patientID = json['PatientID']; + reservationNo = json['reservationNo']; + admissionNo = json['AdmissionNo']; + preOpDiagmosis = json['preOpDiagmosis']; + postOpDiagmosis = json['postOpDiagmosis']; + surgeon = json['surgeon']; + assistant = json['assistant']; + anasthetist = json['anasthetist']; + operation = json['operation']; + inasion = json['inasion']; + finding = json['finding']; + surgeryProcedure = json['surgeryProcedure']; + postOpInstruction = json['postOpInstruction']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + complicationDetails = json['complicationDetails']; + bloodLossDetail = json['bloodLossDetail']; + histopathSpecimen = json['histopathSpecimen']; + microbiologySpecimen = json['microbiologySpecimen']; + otherSpecimen = json['otherSpecimen']; + scrubNurse = json['scrubNurse']; + circulatingNurse = json['circulatingNurse']; + bloodTransfusedDetail = json['BloodTransfusedDetail']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['PatientID'] = this.patientID; + data['reservationNo'] = this.reservationNo; + data['AdmissionNo'] = this.admissionNo; + data['preOpDiagmosis'] = this.preOpDiagmosis; + data['postOpDiagmosis'] = this.postOpDiagmosis; + data['surgeon'] = this.surgeon; + data['assistant'] = this.assistant; + data['anasthetist'] = this.anasthetist; + data['operation'] = this.operation; + data['inasion'] = this.inasion; + data['finding'] = this.finding; + data['surgeryProcedure'] = this.surgeryProcedure; + data['postOpInstruction'] = this.postOpInstruction; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['complicationDetails'] = this.complicationDetails; + data['bloodLossDetail'] = this.bloodLossDetail; + data['histopathSpecimen'] = this.histopathSpecimen; + data['microbiologySpecimen'] = this.microbiologySpecimen; + data['otherSpecimen'] = this.otherSpecimen; + data['scrubNurse'] = this.scrubNurse; + data['circulatingNurse'] = this.circulatingNurse; + data['BloodTransfusedDetail'] = this.bloodTransfusedDetail; + return data; + } +} diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/models/operation_report/get_operation_details_request_modle.dart new file mode 100644 index 00000000..7e23b503 --- /dev/null +++ b/lib/models/operation_report/get_operation_details_request_modle.dart @@ -0,0 +1,68 @@ +class GetOperationDetailsRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int reservationNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + + GetOperationDetailsRequestModel( + {this.isDentalAllowedBackend = false, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.reservationNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA}); + + GetOperationDetailsRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + reservationNo = json['reservationNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['reservationNo'] = this.reservationNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/models/operation_report/get_operation_details_response_modle.dart new file mode 100644 index 00000000..04540ea6 --- /dev/null +++ b/lib/models/operation_report/get_operation_details_response_modle.dart @@ -0,0 +1,148 @@ +class GetOperationDetailsResponseModel { + String setupID; + int projectID; + int reservationNo; + int patientID; + int admissionID; + dynamic surgeryDate; + String preOpDiagnosis; + String postOpDiagnosis; + String surgeon; + String assistant; + String anasthetist; + String operation; + String inasion; + String finding; + String surgeryProcedure; + String postOpInstruction; + bool isActive; + int createdBy; + String createdName; + dynamic createdNameN; + String createdOn; + dynamic editedBy; + dynamic editedByName; + dynamic editedByNameN; + dynamic editedOn; + dynamic oRBookStatus; + String complicationDetail; + String bloodLossDetail; + String histopathSpecimen; + String microbiologySpecimen; + String otherSpecimen; + dynamic scrubNurse; + dynamic circulatingNurse; + dynamic bloodTransfusedDetail; + + GetOperationDetailsResponseModel( + {this.setupID, + this.projectID, + this.reservationNo, + this.patientID, + this.admissionID, + this.surgeryDate, + this.preOpDiagnosis, + this.postOpDiagnosis, + this.surgeon, + this.assistant, + this.anasthetist, + this.operation, + this.inasion, + this.finding, + this.surgeryProcedure, + this.postOpInstruction, + this.isActive, + this.createdBy, + this.createdName, + this.createdNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn, + this.oRBookStatus, + this.complicationDetail, + this.bloodLossDetail, + this.histopathSpecimen, + this.microbiologySpecimen, + this.otherSpecimen, + this.scrubNurse, + this.circulatingNurse, + this.bloodTransfusedDetail}); + + GetOperationDetailsResponseModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + reservationNo = json['ReservationNo']; + patientID = json['PatientID']; + admissionID = json['AdmissionID']; + surgeryDate = json['SurgeryDate']; + preOpDiagnosis = json['PreOpDiagnosis']; + postOpDiagnosis = json['PostOpDiagnosis']; + surgeon = json['Surgeon']; + assistant = json['Assistant']; + anasthetist = json['Anasthetist']; + operation = json['Operation']; + inasion = json['Inasion']; + finding = json['Finding']; + surgeryProcedure = json['SurgeryProcedure']; + postOpInstruction = json['PostOpInstruction']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdName = json['CreatedName']; + createdNameN = json['CreatedNameN']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + editedOn = json['EditedOn']; + oRBookStatus = json['ORBookStatus']; + complicationDetail = json['ComplicationDetail']; + bloodLossDetail = json['BloodLossDetail']; + histopathSpecimen = json['HistopathSpecimen']; + microbiologySpecimen = json['MicrobiologySpecimen']; + otherSpecimen = json['OtherSpecimen']; + scrubNurse = json['ScrubNurse']; + circulatingNurse = json['CirculatingNurse']; + bloodTransfusedDetail = json['BloodTransfusedDetail']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ReservationNo'] = this.reservationNo; + data['PatientID'] = this.patientID; + data['AdmissionID'] = this.admissionID; + data['SurgeryDate'] = this.surgeryDate; + data['PreOpDiagnosis'] = this.preOpDiagnosis; + data['PostOpDiagnosis'] = this.postOpDiagnosis; + data['Surgeon'] = this.surgeon; + data['Assistant'] = this.assistant; + data['Anasthetist'] = this.anasthetist; + data['Operation'] = this.operation; + data['Inasion'] = this.inasion; + data['Finding'] = this.finding; + data['SurgeryProcedure'] = this.surgeryProcedure; + data['PostOpInstruction'] = this.postOpInstruction; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedName'] = this.createdName; + data['CreatedNameN'] = this.createdNameN; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + data['EditedOn'] = this.editedOn; + data['ORBookStatus'] = this.oRBookStatus; + data['ComplicationDetail'] = this.complicationDetail; + data['BloodLossDetail'] = this.bloodLossDetail; + data['HistopathSpecimen'] = this.histopathSpecimen; + data['MicrobiologySpecimen'] = this.microbiologySpecimen; + data['OtherSpecimen'] = this.otherSpecimen; + data['ScrubNurse'] = this.scrubNurse; + data['CirculatingNurse'] = this.circulatingNurse; + data['BloodTransfusedDetail'] = this.bloodTransfusedDetail; + return data; + } +} diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/models/operation_report/get_reservations_request_model.dart new file mode 100644 index 00000000..06425254 --- /dev/null +++ b/lib/models/operation_report/get_reservations_request_model.dart @@ -0,0 +1,64 @@ +class GetReservationsRequestModel { + int patientID; + int projectID; + String doctorID; + int clinicID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + bool patientOutSA; + int deviceTypeID; + String tokenID; + String sessionID; + + GetReservationsRequestModel( + {this.patientID, + this.projectID, + this.doctorID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.deviceTypeID, + this.tokenID, + this.sessionID}); + + GetReservationsRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + return data; + } +} diff --git a/lib/models/operation_report/get_reservations_response_model.dart b/lib/models/operation_report/get_reservations_response_model.dart new file mode 100644 index 00000000..3bebdc8b --- /dev/null +++ b/lib/models/operation_report/get_reservations_response_model.dart @@ -0,0 +1,152 @@ +class GetReservationsResponseModel { + String setupID; + int projectID; + int oTReservationID; + String oTReservationDate; + String oTReservationDateN; + int oTID; + int admissionRequestNo; + int admissionNo; + int primaryDoctorID; + int patientType; + int patientID; + int patientStatusType; + int clinicID; + int doctorID; + String operationDate; + int operationType; + String endDate; + String timeStart; + String timeEnd; + dynamic remarks; + int status; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String patientName; + Null patientNameN; + Null gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String doctorName; + Null doctorNameN; + String clinicDescription; + Null clinicDescriptionN; + + GetReservationsResponseModel( + {this.setupID, + this.projectID, + this.oTReservationID, + this.oTReservationDate, + this.oTReservationDateN, + this.oTID, + this.admissionRequestNo, + this.admissionNo, + this.primaryDoctorID, + this.patientType, + this.patientID, + this.patientStatusType, + this.clinicID, + this.doctorID, + this.operationDate, + this.operationType, + this.endDate, + this.timeStart, + this.timeEnd, + this.remarks, + this.status, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.patientName, + this.patientNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.doctorName, + this.doctorNameN, + this.clinicDescription, + this.clinicDescriptionN}); + + GetReservationsResponseModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + oTReservationID = json['OTReservationID']; + oTReservationDate = json['OTReservationDate']; + oTReservationDateN = json['OTReservationDateN']; + oTID = json['OTID']; + admissionRequestNo = json['AdmissionRequestNo']; + admissionNo = json['AdmissionNo']; + primaryDoctorID = json['PrimaryDoctorID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + patientStatusType = json['PatientStatusType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + operationDate = json['OperationDate']; + operationType = json['OperationType']; + endDate = json['EndDate']; + timeStart = json['TimeStart']; + timeEnd = json['TimeEnd']; + remarks = json['Remarks']; + status = json['Status']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + patientName = json['PatientName']; + patientNameN = json['PatientNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['OTReservationID'] = this.oTReservationID; + data['OTReservationDate'] = this.oTReservationDate; + data['OTReservationDateN'] = this.oTReservationDateN; + data['OTID'] = this.oTID; + data['AdmissionRequestNo'] = this.admissionRequestNo; + data['AdmissionNo'] = this.admissionNo; + data['PrimaryDoctorID'] = this.primaryDoctorID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['PatientStatusType'] = this.patientStatusType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['OperationDate'] = this.operationDate; + data['OperationType'] = this.operationType; + data['EndDate'] = this.endDate; + data['TimeStart'] = this.timeStart; + data['TimeEnd'] = this.timeEnd; + data['Remarks'] = this.remarks; + data['Status'] = this.status; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['PatientName'] = this.patientName; + data['PatientNameN'] = this.patientNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + return data; + } +} diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/models/patient/get_list_stp_referral_frequency_request.dart index ca4f3bd3..1f5b97a0 100644 --- a/lib/models/patient/get_list_stp_referral_frequency_request.dart +++ b/lib/models/patient/get_list_stp_referral_frequency_request.dart @@ -36,7 +36,6 @@ class STPReferralFrequencyRequest { {this.languageID = 2, this.stamp = "2020-06-03T11:18:19.986Z", this.iPAdress = "11.11.11.11", - this.versionID = 5.8, this.channel = 9, this.tokenID, this.sessionID = "JBXRsDl37L", diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 06936a59..aa27d68e 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,10 +1,13 @@ -// TODO : it have to be changed. +// TODO = it have to be changed. + +import 'package:doctor_app_flutter/util/date-utils.dart'; class PatiantInformtion { PatiantInformtion? patientDetails; int? genderInt; dynamic age; String? appointmentDate; + DateTime appointmentDateWithDateTimeForm; dynamic appointmentNo; dynamic appointmentType; String? arrivalTime; @@ -52,6 +55,7 @@ class PatiantInformtion { int? patientMRN; String? admissionNo; String? admissionDate; + DateTime admissionDateWithDateTimeForm; String? createdOn; String? roomId; String? bedId; @@ -75,7 +79,6 @@ class PatiantInformtion { int? vcId; String? voipToken; - PatiantInformtion( {this.patientDetails, this.projectId, @@ -149,112 +152,182 @@ class PatiantInformtion { this.dischargeDate, this.status, this.vcId, - this.voipToken}); - PatiantInformtion.fromJson(Map json) { - try { - patientDetails = - json['patientDetails'] != null ? new PatiantInformtion.fromJson( - json['patientDetails']) : null; - projectId = json["ProjectID"] ?? json["projectID"]; - clinicId = json["ClinicID"] ?? json["clinicID"]; - doctorId = json["DoctorID"] ?? json["doctorID"]; - patientId = json["PatientID"] != null - ? json["PatientID"] is String - ? int?.parse(json["PatientID"]) - : json["PatientID"] - : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; - doctorName = json["DoctorName"] ?? json["doctorName"]; - doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; - firstName = json["FirstName"] ?? json["firstName"]; - middleName = json["MiddleName"] ?? json["middleName"]; - lastName = json["LastName"] ?? json["lastName"]; - firstNameN = json["FirstNameN"] ?? json["firstNameN"]; - middleNameN = json["MiddleNameN"] ?? json["middleNameN"]; - lastNameN = json["LastNameN"] ?? json["lastNameN"]; - gender = json["Gender"] != null - ? json["Gender"] is String - ? int?.parse(json["Gender"]) - : json["Gender"] - : json["gender"]; - fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; - fullNameN = - json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; - dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; - nationalityId = json["NationalityID"] ?? json["nationalityID"]; - mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; - emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; - //TODO make 7 dynamic when the backend retrun it in patient arrival - patientType = json["PatientType"] ?? json["patientType"] ?? 1; - admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; - admissionDate = json["AdmissionDate"] ?? json["admissionDate"]; - createdOn = json["CreatedOn"] ?? json["CreatedOn"]; - roomId = json["RoomID"] ?? json["roomID"]; - bedId = json["BedID"] ?? json["bedID"]; - nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; - description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? - json['NationalityName']; - nationalityNameN = - json["NationalityNameN"] ?? json["nationalityNameN"] ?? - json['NationalityNameN']; - age = json["Age"] ?? json["age"]; - genderDescription = json["GenderDescription"]; - nursingStationName = json["NursingStationName"]; - appointmentDate = json["AppointmentDate"] ?? ''; - startTime = json["startTime"] ?? json['StartTime']; - appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; - appointmentType = json['appointmentType']; - appointmentTypeId = - json['appointmentTypeId'] ?? json['appointmentTypeid']; - arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; - clinicGroupId = json['clinicGroupId']; - companyName = json['companyName']; - dischargeStatus = json['dischargeStatus']; - doctorDetails = json['doctorDetails']; - endTime = json['endTime']; - episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; - fallRiskScore = json['fallRiskScore']; - isSigned = json['isSigned']; - medicationOrders = json['medicationOrders']; - nationality = json['nationality'] ?? json['NationalityNameN']; - patientMRN = json['patientMRN'] ?? - json['PatientMRN'] ?? - (json["PatientID"] != null - ? int?.parse(json["PatientID"].toString()) - : json["patientID"] != null ? int?.parse( - json["patientID"].toString()) : json["patientId"] != null ? int - ?.parse(json["patientId"].toString()) : ''); - visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = - json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = - json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = - json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; - startTimes = json['StartTime'] ?? json['StartTime']; - dischargeDate = json['DischargeDate']; - status = json['Status']; - vcId = json['VC_ID']; + this.voipToken, + this.admissionDateWithDateTimeForm, + this.appointmentDateWithDateTimeForm}); + + PatiantInformtion.fromJson(Map json) { + { + patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; + projectId = json["ProjectID"] ?? json["projectID"]; + clinicId = json["ClinicID"] ?? json["clinicID"]; + doctorId = json["DoctorID"] ?? json["doctorID"]; + patientId = json["PatientID"] != null + ? json["PatientID"] is String + ? int.parse(json["PatientID"]) + : json["PatientID"] + : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; + doctorName = json["DoctorName"] ?? json["doctorName"]; + doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; + firstName = json["FirstName"] ?? json["firstName"]; + middleName = json["MiddleName"] ?? json["middleName"]; + lastName = json["LastName"] ?? json["lastName"]; + firstNameN = json["FirstNameN"] ?? json["firstNameN"]; + middleNameN = json["MiddleNameN"] ?? json["middleNameN"]; + lastNameN = json["LastNameN"] ?? json["lastNameN"]; + gender = json["Gender"] != null + ? json["Gender"] is String + ? int.parse(json["Gender"]) + : json["Gender"] + : json["gender"]; + fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; + fullNameN = json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; + dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; + nationalityId = json["NationalityID"] ?? json["nationalityID"]; + mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; + emailAddress = json["EmailAddress"] ?? json["emailAddress"]; + patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + //TODO make 7 dynamic when the backend retrun it in patient arrival + patientType = json["PatientType"] ?? json["patientType"] ?? 1; + admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; + admissionDate = json["AdmissionDate"] ?? json["admissionDate"]; + createdOn = json["CreatedOn"] ?? json["CreatedOn"]; + roomId = json["RoomID"] ?? json["roomID"]; + bedId = json["BedID"] ?? json["bedID"]; + nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; + description = json["Description"] ?? json["description"]; + clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; + age = json["Age"] ?? json["age"]; + genderDescription = json["GenderDescription"]; + nursingStationName = json["NursingStationName"]; + appointmentDate = json["AppointmentDate"] ?? ''; + startTime = json["startTime"] ?? json['StartTime']; + appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; + appointmentType = json['appointmentType']; + appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; + arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; + clinicGroupId = json['clinicGroupId']; + companyName = json['companyName']; + dischargeStatus = json['dischargeStatus']; + doctorDetails = json['doctorDetails']; + endTime = json['endTime']; + episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; + fallRiskScore = json['fallRiskScore']; + isSigned = json['isSigned']; + medicationOrders = json['medicationOrders']; + nationality = json['nationality'] ?? json['NationalityNameN']; + patientMRN = json['patientMRN'] ?? + json['PatientMRN'] ?? + (json["PatientID"] != null + ? int?.parse(json["PatientID"].toString()) + : json["patientID"] != null + ? int?.parse(json["patientID"].toString()) + : json["patientId"] != null + ? int?.parse(json["patientId"].toString()) + : ''); + visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; + nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + startTimes = json['StartTime'] ?? json['StartTime']; + dischargeDate = json['DischargeDate']; + status = json['Status']; + vcId = json['VC_ID']; + + arrivalTime = json['ArrivalTime']; + arrivalTimeD = json['ArrivalTimeD']; + callStatus = json['CallStatus']; + callStatusDisc = json['CallStatusDisc']; + callTypeID = json['CallTypeID']; + clientRequestID = json['ClientRequestID']; + clinicName = json['ClinicName']; + consoltationEnd = json['ConsoltationEnd']; + consultationNotes = json['ConsultationNotes']; + patientStatus = json['PatientStatus']; + voipToken = json['VoipToken']; + admissionDateWithDateTimeForm = json["AdmissionDate"] != null + ? AppDateUtils.convertStringToDate(json["AdmissionDate"]) + : json["admissionDate"] != null + ? AppDateUtils.convertStringToDate(json["admissionDate"]) + : null; + + appointmentDateWithDateTimeForm = + json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; + } + } + + Map toJson() { + final Map data = new Map(); + + data['patientDetails'] = this.patientDetails; + data["ProjectID"] = this.projectId; + data["projectID"] = this.projectId; + data["ClinicID"] = this.clinicId; + data["clinicID"] = this.clinicId; + data["DoctorID"] = this.doctorId; + data["doctorID"] = this.doctorId; + data["PatientID"] = this.patientId; + data["patientID"] = this.patientId; + data['patientMRN'] = this.patientMRN; + data['PatientMRN'] = this.patientMRN; + + data['episodeNo'] = this.episodeNo; + data['EpisodeID'] = this.episodeNo; + data['EpisodeNo'] = this.episodeNo; + + data["DoctorName"] = this.doctorName; + data["doctorName"] = this.doctorName; + data["DoctorNameN"] = this.doctorNameN; + data["doctorNameN"] = this.doctorNameN; + data["FirstName"] = this.firstName; + data["firstName"] = this.firstName; + data["MiddleName"] = this.middleName; + data["middleName"] = this.middleName; + data["LastName"] = this.lastName; + data["lastName"] = this.lastName; + data["FirstNameN"] = this.firstNameN; + data["firstNameN"] = this.firstNameN; + data["MiddleNameN"] = this.middleNameN; + data["middleNameN"] = this.middleNameN; + data["LastNameN"] = this.lastNameN; + data["lastNameN"] = this.lastNameN; + + data["fullName"] = this.fullName; + data["fullName"] = this.fullName; + data["PatientName"] = this.fullName; + + data["Gender"] = this.gender; + data["gender"] = this.gender; + + data['Age'] = this.age; + data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null; + + data['AppointmentNo'] = this.appointmentNo; + data['ArrivalTime'] = this.arrivalTime; + data['ArrivalTimeD'] = this.arrivalTimeD; + data['CallStatus'] = this.callStatus; + data['CallStatusDisc'] = this.callStatusDisc; + data['CallTypeID'] = this.callTypeID; + data['ClientRequestID'] = this.clientRequestID; + data['ClinicName'] = this.clinicName; + data['ConsoltationEnd'] = this.consoltationEnd; + data['ConsultationNotes'] = this.consultationNotes; + data['CreatedOn'] = this.createdOn; + data['DoctorName'] = this.doctorName; + data['Gender'] = this.gender; + data['MobileNumber'] = this.mobileNumber; + data['PatientID'] = this.patientId; + data['PatientStatus'] = this.patientStatus; + data['ProjectID'] = this.projectId; + data['VC_ID'] = this.vcId; + data['VoipToken'] = this.voipToken; - arrivalTime = json['ArrivalTime']; - arrivalTimeD = json['ArrivalTimeD']; - callStatus = json['CallStatus']; - callStatusDisc = json['CallStatusDisc']; - callTypeID = json['CallTypeID']; - clientRequestID = json['ClientRequestID']; - clinicName = json['ClinicName']; - consoltationEnd = json['ConsoltationEnd']; - consultationNotes = json['ConsultationNotes']; - patientStatus = json['PatientStatus']; - voipToken = json['VoipToken']; - } catch (e) { - print(e); - } - } + data["DateofBirth"] = this.dateofBirth; + data["dob"] = this.dateofBirth; + data['DateOfBirth'] = this.dateofBirth; + return data; + } } diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart index e19c50ed..aed886cb 100644 --- a/lib/models/patient/progress_note_request.dart +++ b/lib/models/patient/progress_note_request.dart @@ -1,4 +1,4 @@ -/* +/* *@author: Ibrahim Albitar *@Date:15/5/2020 @@ -48,7 +48,6 @@ class ProgressNoteRequest { this.sessionID = "LlBk8lUEJY", this.isLoginForDoctorApp = true, this.patientTypeID = 1, - this.versionID = 5.5, this.patientOutSA = false}); ProgressNoteRequest.fromJson(Map json) { @@ -64,7 +63,6 @@ class ProgressNoteRequest { isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; patientTypeID = json['PatientTypeID']; - versionID = json['VersionID']; } Map toJson() { @@ -81,7 +79,6 @@ class ProgressNoteRequest { data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; data['PatientTypeID'] = this.patientTypeID; - data['VersionID'] = this.versionID; return data; } } diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/models/patient/vital_sign/vital_sign_req_model.dart index e18e3a0a..c52cf838 100644 --- a/lib/models/patient/vital_sign/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_req_model.dart @@ -30,7 +30,7 @@ class VitalSignReqModel { this.tokenID, this.stamp = '2020-04-26T09:32:18.317Z', this.iPAdress = '11.11.11.11', - this.versionID = 5.8, + this.channel = 9, this.sessionID = 'E2bsEeYEJo', this.isLoginForDoctorApp = true, diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/models/pending_orders/pending_order_request_model.dart new file mode 100644 index 00000000..c69cf780 --- /dev/null +++ b/lib/models/pending_orders/pending_order_request_model.dart @@ -0,0 +1,76 @@ +class PendingOrderRequestModel { + bool isDentalAllowedBackend; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int deviceTypeID; + String tokenID; + int patientID; + int admissionNo; + String sessionID; + int projectID; + String setupID; + bool patientOutSA; + int patientType; + int patientTypeID; + + PendingOrderRequestModel( + {this.isDentalAllowedBackend, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.deviceTypeID, + this.tokenID, + this.patientID, + this.admissionNo, + this.sessionID, + this.projectID, + this.setupID, + this.patientOutSA, + this.patientType, + this.patientTypeID}); + + PendingOrderRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + deviceTypeID = json['DeviceTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + sessionID = json['SessionID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['DeviceTypeID'] = this.deviceTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['SessionID'] = this.sessionID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/models/pending_orders/pending_orders_model.dart new file mode 100644 index 00000000..89525369 --- /dev/null +++ b/lib/models/pending_orders/pending_orders_model.dart @@ -0,0 +1,15 @@ +class PendingOrderModel { + String notes; + + PendingOrderModel({this.notes}); + + PendingOrderModel.fromJson(Map json) { + notes = json['Notes']; + } + + Map toJson() { + final Map data = new Map(); + data['Notes'] = this.notes; + return data; + } +} diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/models/pharmacies/pharmacies_List_request_model.dart index 31c3f758..48ef6c9c 100644 --- a/lib/models/pharmacies/pharmacies_List_request_model.dart +++ b/lib/models/pharmacies/pharmacies_List_request_model.dart @@ -25,7 +25,6 @@ class PharmaciesListRequestModel { this.languageID = 2, this.stamp = '2020-04-23T21:01:21.492Z', this.ipAdress = '11.11.11.11', - this.versionID = 5.5, this.tokenID, this.sessionID = 'e29zoooEJ4', this.isLoginForDoctorApp = true, diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/models/pharmacies/pharmacies_items_request_model.dart index 801fed36..a8cd82c3 100644 --- a/lib/models/pharmacies/pharmacies_items_request_model.dart +++ b/lib/models/pharmacies/pharmacies_items_request_model.dart @@ -10,7 +10,6 @@ class PharmaciesItemsRequestModel { String? pHRItemName; int? pageIndex = 0; int? pageSize = 20; - double? versionID = 5.5; int? channel = 3; int? languageID = 2; String? iPAdress = "10.20.10.20"; @@ -24,7 +23,6 @@ class PharmaciesItemsRequestModel { {this.pHRItemName, this.pageIndex = 0, this.pageSize = 20, - this.versionID = 5.8, this.channel = 3, this.languageID = 2, this.iPAdress = "10.20.10.20", @@ -38,7 +36,6 @@ class PharmaciesItemsRequestModel { pHRItemName = json['PHR_itemName']; pageIndex = json['PageIndex']; pageSize = json['PageSize']; - versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; iPAdress = json['IPAdress']; @@ -54,7 +51,6 @@ class PharmaciesItemsRequestModel { data['PHR_itemName'] = this.pHRItemName; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; - data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; diff --git a/lib/models/sickleave/sick_leave_statisitics_model.dart b/lib/models/sickleave/sick_leave_statisitics_model.dart new file mode 100644 index 00000000..f679807c --- /dev/null +++ b/lib/models/sickleave/sick_leave_statisitics_model.dart @@ -0,0 +1,24 @@ +class SickLeaveStatisticsModel { + String recommendedSickLeaveDays; + int totalLeavesByAllClinics; + int totalLeavesByDoctor; + + SickLeaveStatisticsModel( + {this.recommendedSickLeaveDays, + this.totalLeavesByAllClinics, + this.totalLeavesByDoctor}); + + SickLeaveStatisticsModel.fromJson(Map json) { + recommendedSickLeaveDays = json['recommendedSickLeaveDays']; + totalLeavesByAllClinics = json['totalLeavesByAllClinics']; + totalLeavesByDoctor = json['totalLeavesByDoctor']; + } + + Map toJson() { + final Map data = new Map(); + data['recommendedSickLeaveDays'] = this.recommendedSickLeaveDays; + data['totalLeavesByAllClinics'] = this.totalLeavesByAllClinics; + data['totalLeavesByDoctor'] = this.totalLeavesByDoctor; + return data; + } +} diff --git a/lib/routes.dart b/lib/routes.dart index 0826c76e..4ce73a4e 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,33 +1,39 @@ import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; +import 'package:doctor_app_flutter/screens/patient-sick-leave/patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/diabetic_chart.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/diagnosis/diagnosis_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/admission-orders/admission_orders_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/discharge_summary/discharge_summary.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/lab_result/all_lab_special_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportDetailPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/medical_report/MedicalReportPage.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/note/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/note/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/pending_orders/pending_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import './screens/auth/login_screen.dart'; +import 'screens/patients/profile/UCAF/ucaf_pager_screen.dart'; import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; -import 'screens/patients/profile/note/progress_note_screen.dart'; + import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; @@ -66,8 +72,17 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PROCEDURE = 'procedure/procedure'; const String ADD_SICKLEAVE = 'add-sickleave'; -const String SHOW_SICKLEAVE = 'show-sickleave'; const String RADIOLOGY_PATIENT = 'radiology-patient'; +const String ALL_SPECIAL_LAB_RESULT = 'all-special_lab'; +const String GET_OPERATION_REPORT = 'operation-report'; +const String PENDING_ORDERS = 'pending-orders'; +const String ADMISSION_ORDERS = 'admission-orders'; +const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; +const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; + +const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; +const String DISCHARGE_SUMMARY = 'discharge_summary'; + //todo: change the routing way. var routes = { ROOT: (_) => RootPage(), @@ -77,8 +92,12 @@ var routes = { PATIENTS_PROFILE: (_) => PatientProfileScreen(), LAB_RESULT: (_) => LabsHomePage(), HEALTH_SUMMARY: (_) => HealthSummaryPage(), - PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,), - ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,), + PROGRESS_NOTE: (_) => ProgressNoteScreen( + visitType: 5, + ), + ORDER_NOTE: (_) => ProgressNoteScreen( + visitType: 3, + ), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), REFER_IN_PATIENT_TO_DOCTOR: (_) => PatientMakeInPatientReferralScreen(), PATIENT_INSURANCE_APPROVALS_NEW: (_) => InsuranceApprovalScreenNew(), @@ -98,12 +117,19 @@ var routes = { isUpdate: true, ), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), - ADD_SICKLEAVE: (_) => AddSickLeavScreen(), - SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), + ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(), ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), ORDER_PROCEDURE: (_) => ProcedureScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), - PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), - PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), + PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(), + // PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), PATIENT_ECG: (_) => ECGPage(), + ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), + GET_OPERATION_REPORT: (_) => OperationReportScreen(), + PENDING_ORDERS: (_) => PendingOrdersScreen(), + NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), + DISCHARGE_SUMMARY : (_) => DischargeSummaryPage(), + DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), + ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), + DIABETIC_CHART_VALUES: (_) => DiabeticChart(), }; diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index cf4d7d78..d22e13df 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -56,7 +56,8 @@ class _VerificationMethodsScreenState extends State { child: Center( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( + child: SingleChildScrollView( + child:Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( @@ -196,10 +197,10 @@ class _VerificationMethodsScreenState extends State { ], crossAxisAlignment: CrossAxisAlignment.start, ) - ], + ], + ), ), - ), - SizedBox( + SizedBox( height: SizeConfig.heightMultiplier * 3, ), Row( @@ -248,7 +249,7 @@ class _VerificationMethodsScreenState extends State { Expanded( child: InkWell( onTap: () => { - // TODO check this logic it seem it will create bug to us + // TODO check this logic it seem it will create bug to us authenticateUser(AuthMethodTypes.Fingerprint, true) }, child: VerificationMethodsList( @@ -321,40 +322,37 @@ class _VerificationMethodsScreenState extends State { ], ), ], + ), ), ), ), ), - bottomSheet: authenticationViewModel.user == null - ? SizedBox( - height: 0, - ) - : Container( - // color: Colors.green, - height: SizeConfig.heightMultiplier * 10, - width: double.infinity, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).useAnotherAccount, - color: Color(0xFFD02127), - fontWeight: FontWeight.w700, - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 8 : 6), - hPadding: 1, - onPressed: () { - authenticationViewModel.deleteUser(); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, - ), - ], - ), + bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( + height: 90, + width: double.infinity, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SecondaryButton( + label: TranslationBase + .of(context) + .useAnotherAccount, + color: Color(0xFFD02127), + //fontWeight: FontWeight.w700, + onTap: () { + authenticationViewModel.deleteUser(); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, ), - ), + + SizedBox(height: 25,) + ], ), + ), + ),), ); } @@ -368,9 +366,7 @@ class _VerificationMethodsScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); } else { - authenticationViewModel - .setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes); - sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password!); + GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType); } @@ -390,13 +386,13 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(authenticationViewModel.error); } else { - authenticationViewModel - .setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); + await sharedPref.setString(TOKEN, + authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); - this.startSMSService(authMethodType); + this.startSMSService(authMethodType,isSilentLogin: true); } else { - checkActivationCode(); + checkActivationCode(isSilentLogin: true); } } } @@ -434,7 +430,7 @@ class _VerificationMethodsScreenState extends State { } } - startSMSService(AuthMethodTypes type) { + startSMSService(AuthMethodTypes type,{isSilentLogin: false}) { new SMSOTP( context, type, @@ -448,7 +444,7 @@ class _VerificationMethodsScreenState extends State { return AppLoaderWidget(); }); - this.checkActivationCode(value: value); + this.checkActivationCode(value: value,isSilentLogin: isSilentLogin); }, () => { print('Faild..'), @@ -474,16 +470,22 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({value}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value); + checkActivationCode({String value,bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); } else { await authenticationViewModel.onCheckActivationCodeSuccess(); - Navigator.pop(context); - Navigator.pop(context); - navigateToLandingPage(); + if(value !=null){ + if(Navigator.canPop(context)) + Navigator.pop(context); + } + if(Navigator.canPop(context)) + Navigator.pop(context); + navigateToLandingPage(); + + } } @@ -494,4 +496,5 @@ class _VerificationMethodsScreenState extends State { authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); } } + } diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart deleted file mode 100644 index 9b4017a4..00000000 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ /dev/null @@ -1,283 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class DoctorReplayChat extends StatelessWidget { - final ListGtMyPatientsQuestions reply; - TextEditingController msgController = TextEditingController(); - final DoctorReplayViewModel previousModel; - DoctorReplayChat({ - Key? key, - required this.reply, - required this.previousModel, - }); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Container( - height: MediaQuery.of(context).size.height * 1, - color: Color(0XFFF2F2F2), - child: Stack( - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - height: 115, - child: Container( - padding: EdgeInsets.only(left: 10, right: 10), - margin: EdgeInsets.only(top: 40), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: reply.patientName.toString(), - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 20)), - ], - ), - ), - ), - InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Icon(FontAwesomeIcons.times, size: 30, color: Color(0xFF2B353E))) - ], - ), - ], - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - Container( - // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.9, - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Color(0xFF2B353E), - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0.30), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - width: 60, - height: 60, - child: Image.asset( - reply.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - Divider(), - SizedBox( - width: 10, - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: AppText( - reply.patientName.toString(), - fontSize: 14, - fontFamily: 'Poppins', - color: Colors.white, - fontWeight: FontWeight.bold, - // fontSize: 18 - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 4), - child: InkWell( - onTap: () { - launch("tel://" + reply.mobileNumber!); - }, - child: Icon( - Icons.phone, - color: Colors.white, - ), - ), - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - reply.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.getDateTimeFromServerFormat( - reply.createdOn ?? "")) - : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight.w600, - color: Colors.white, - fontSize: 14, - ), - AppText( - reply.createdOn != null - ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( - reply.createdOn ?? "")) - : AppDateUtils.getHour(DateTime.now()), - fontSize: 14, - fontFamily: 'Poppins', - color: Colors.white, - // fontSize: 18 - ), - ], - ), - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.7, - child: AppText( - reply.remarks, - fontSize: 15, - fontFamily: 'Poppins', - color: Colors.white, - // fontSize: 18 - ), - ), - ), - ], - ), - ], - ), - ], - ), - ), - SizedBox( - height: 30, - ), - ], - ), - ), - ), - ) - ], - ), - ), - - // Positioned( - // bottom: 0, - // child: Container( - // width:MediaQuery.of(context).size.width * 1, - // // height: MediaQuery.of(context).size.height * 0.12, - // child: Column( - // mainAxisSize: MainAxisSize.min, - // children: [ - // FractionallySizedBox( - // child: Container( - // - // child: TextFields( - // borderRadius: 0, - // hintText: TranslationBase - // .of(context) - // .typeHereToReply, - // fontSize: 13.5, - // - // suffixIcon: FontAwesomeIcons.arrowRight, - // suffixIconColor: Colors.green, - // onSuffixTap: ()async { - // GifLoaderDialogUtils.showMyDialog(context); - // await model.replay(msgController.text, reply); - // if(model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast("An error happened while you are replaying"); - // } else { - // DrAppToastMsg.showSuccesToast("Thank you for your replay "); - // await previousModel.getDoctorReply(); - // Navigator.pop(context); - // } - // GifLoaderDialogUtils.hideDialog(context); - // - // - // - // - // }, - // // hintColor: Colors.black, - // fontWeight: FontWeight.w600, - // maxLines: 50, - // minLines: 3, - // controller: msgController, - // validator: (value) { - // if (value == null || value == "") - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }), - // - // ), - // ), - // ], - // ), - // ), - // ) - ], - ), - ), - )); - } -} diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart new file mode 100644 index 00000000..ac6736e0 --- /dev/null +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -0,0 +1,95 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +import 'doctor_repaly_chat.dart'; + +class AllDoctorQuestions extends StatefulWidget { + final Function changeCurrentTab; + + const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); + + @override + _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); +} + +class _AllDoctorQuestionsState extends State { + + int pageIndex = 1; + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getDoctorReply(isLocalBusy: false); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: model.listDoctorWorkingHoursTable.isEmpty + ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.listDoctorWorkingHoursTable.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: + model.listDoctorWorkingHoursTable[ + index], + previousModel: model, + ), + settings: RouteSettings( + name: 'DoctorReplayChat'), + )); + }, + child: DoctorReplyWidget( + reply: model + .listDoctorWorkingHoursTable[index]), + ), + if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) + DrAppCircularProgressIndeicator() + + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex); + } + return; + }, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart new file mode 100644 index 00000000..85c06b18 --- /dev/null +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -0,0 +1,468 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class DoctorReplayChat extends StatefulWidget { + + final ListGtMyPatientsQuestions reply; + final DoctorReplayViewModel previousModel; + bool showMsgBox = false; + DoctorReplayChat( + {Key? key, this.reply, this.previousModel, + }); + + @override + _DoctorReplayChatState createState() => _DoctorReplayChatState(); +} + +class _DoctorReplayChatState extends State { + TextEditingController msgController = TextEditingController(); + + + @override + Widget build(BuildContext context) { + if(widget.reply.doctorResponse.isNotEmpty){ + msgController.text = widget.reply.doctorResponse; + + } else { + widget.showMsgBox = true; + + } + return BaseView( + onModelReady: (model) async { + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + height: MediaQuery.of(context).size.height * 1, + color: Color(0XFFF2F2F2), + child: Stack( + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 115, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: 40), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.patientName + .toString(), + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(FontAwesomeIcons.times, + size: 30, + color: Color(0xFF2B353E))) + ], + ), + ], + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox(height: 30,), + Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Color(0xFF2B353E), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 50, + height: 50, + child: Image.asset( + widget.reply.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + Divider(), + SizedBox(width: 10,), + Container( + width: MediaQuery.of(context).size.width * 0.31, + child: AppText( + widget.reply.patientName + .toString(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontFamily: 'Poppins', + color: Colors.white, + fontWeight: FontWeight.bold, + // fontSize: 18 + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 0), + child: InkWell( + onTap: () { + launch("tel://" +widget.reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.white, + ), + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + + children: [ + AppText( + widget.reply.createdOn !=null?getFormattedDate(widget.reply.createdOn):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight + .w500, + color: Colors.white, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, + ), + AppText( + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + widget.reply.remarks, + fontSize: 15, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + SizedBox(height: 30,), + + SizedBox(height: 30,), + if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) + Align( + alignment: Alignment.centerRight, + child: Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 50, + height: 50, + child: Image.asset( + widget.previousModel.doctorProfile.gender == 0 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + Divider(), + SizedBox(width: 10,), + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: AppText( + widget.previousModel.doctorProfile.doctorName, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + // fontSize: 18 + ), + ), + + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + widget.reply.responseDate !=null?getFormattedDate(widget.reply.responseDate):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + fontWeight: FontWeight + .w500, + color: Color(0xFF2B353E), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, + ), + AppText( + widget.reply.responseDate !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.responseDate)):AppDateUtils.getHour(DateTime.now()), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + widget.reply.doctorResponse, + fontSize: 15, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + + + + Positioned( + bottom: !widget.showMsgBox?80:0, + left: !widget.showMsgBox?20:0, + child: !widget.showMsgBox? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText("You already replied to this question."), + SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox(width: 20,), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: Colors.green[600], + title: "Update Your Answer", //TranslationBase.of(context).close, + onPressed: () { + setState(() { + widget.showMsgBox = true; + }); + }, + ), + ), + ), + ], + ) + ], + ):Container( + width:MediaQuery.of(context).size.width * 1, + height: MediaQuery.of(context).size.height * 0.12, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + child: Container( + + child: TextFields( + borderRadius: 0, + hintText: TranslationBase + .of(context) + .typeHereToReply, + fontSize: 13.5, + + suffixIcon: FontAwesomeIcons.arrowRight, + suffixIconColor: Colors.green, + onSuffixTap: ()async { + + if(msgController.text.isEmpty){ + Helpers.showErrorToast("Please Add Doctor Reply"); + return; + } else { + GifLoaderDialogUtils.showMyDialog(context); + await widget.previousModel.createDoctorResponse(msgController.text, widget.reply); + if(widget.previousModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.previousModel.error); + } else { + DrAppToastMsg.showSuccesToast("Thank you for your replay "); + await widget.previousModel.getDoctorReply(isLocalBusy: false); + Navigator.pop(context); + } + GifLoaderDialogUtils.hideDialog(context); + } + }, + // hintColor: Colors.black, + fontWeight: FontWeight.w500, + maxLines: 50, + minLines: 3, + controller: msgController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + + ), + ), + ], + ), + ), + ) + ], + + + ), + ), + )); + } + + + getFormattedDate(date){ + return (AppDateUtils.getDateTimeFromServerFormat( + date) + .day + .toString() + + " " + + AppDateUtils.getMonth( + AppDateUtils.getDateTimeFromServerFormat( + date) + .month) + .toString() + .substring(0, 3) + + ' ' + + AppDateUtils.getDateTimeFromServerFormat( + date) + .year + .toString()); + } +} diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart new file mode 100644 index 00000000..84c951f8 --- /dev/null +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -0,0 +1,185 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'all_doctor_questions.dart'; +import 'not_replaied_Doctor_Questions.dart'; + +/* + *@author: Mohammad Aljammal + *@Date:28/4/2020 + *@param: + *@return: + *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service + */ +class DoctorReplyScreen extends StatefulWidget { + final Function changeCurrentTab; + + const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key); + + @override + _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); +} + +class _DoctorReplyScreenState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + int _activeTab = 0; + int pageIndex = 1; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + setState(() { + _activeTab = _tabController.index; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return WillPopScope( + onWillPop: () async { + widget.changeCurrentTab(); + return false; + }, + child: AppScaffold( + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Scaffold( + extendBodyBehindAppBar: false, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + "Not Replied", + ), + tabWidget( + screenSize, + _activeTab == 1, + TranslationBase.of(context).all, + ), + ], + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + NotRepliedDoctorQuestions(), + AllDoctorQuestions(), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } +} + +Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { + return Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.5, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], + ), + ), + ); +} diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart similarity index 64% rename from lib/widgets/doctor/doctor_reply_widget.dart rename to lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index a8b7d477..77014074 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -29,14 +31,19 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( - bgColor: widget.reply.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), + bgColor:widget.reply.infoStatus == 99 + ? Color(0xFF2B353E) + : widget.reply.infoStatus == 4 ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 3 + ? Color(0xFFD02127) + : Colors.green[600], hasBorder: false, widget: Container( - // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), child: InkWell( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(widget.reply.infoStatus != 0) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -45,16 +52,32 @@ class _DoctorReplyWidgetState extends State { style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: widget.reply.status == 2 - ? "Active" - : widget.reply.status == 1 - ? "Hold" - : "Cancelled", //TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , + text: widget.reply.infoStatus == 99 + ? TranslationBase.of(context).notReplied + : widget.reply.infoStatus == 1 + ? TranslationBase.of(context).replayCallStatus + : widget.reply.infoStatus == 2 + ? TranslationBase.of(context).patientArrived + : widget.reply.infoStatus == 3 + ? TranslationBase.of(context) + .calledAndNoResponse + : widget.reply.infoStatus == 4 + ? TranslationBase.of(context) + .underProcess + : widget.reply.infoStatus == 6 + ? TranslationBase.of(context) + .textResponse + : '', style: TextStyle( - color: widget.reply.status == 2 ? Color(0xFF2E303A) : Color(0xFFD02127), + color: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) + : widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 3 + ? Color(0xFFD02127) + : Colors.green[600], fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 2.0 * SizeConfig.textMultiplier)), + fontSize: 1.8 * SizeConfig.textMultiplier)), ], ), ), @@ -159,67 +182,57 @@ class _DoctorReplyWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - RichText( - text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 14, - color: Color(0xFF575757), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins')), - new TextSpan( - text: widget.reply.patientID.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), - ], - ), + CustomRow( + label: TranslationBase.of(context).fileNumber, + value: widget.reply.patientID.toString(), + isCopyable:false, + ), + CustomRow( + label: TranslationBase.of(context).age + " : ", + isCopyable:false, + value: + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + ), + SizedBox( + height: 8, ), - Container( - width: MediaQuery.of(context).size.width * 0.45, - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).age! + " : ", - style: TextStyle( - fontSize: 14, color: Color(0xFF575757), fontWeight: FontWeight.bold)), - new TextSpan( - text: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), - ], - ), - ), - ) ], ), ], ), + Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( maxLines: 3, overflow: TextOverflow.ellipsis, text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), children: [ new TextSpan( - text: "Patient Question :", //TranslationBase.of(context).doctorResponse + " : ", + text: + TranslationBase.of(context).requestType + + ": ", style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontWeight: FontWeight.bold)), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), new TextSpan( - text: widget.reply.remarks?.trim() ?? '', - style: TextStyle(fontFamily: 'Poppins', color: Color(0xFF575757), fontSize: 12)), + text: + "${widget.reply.requestTypeDescription}", + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), ], ), ), diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart new file mode 100644 index 00000000..65b95217 --- /dev/null +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -0,0 +1,104 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +import 'doctor_repaly_chat.dart'; + +class NotRepliedDoctorQuestions extends StatefulWidget { + final Function changeCurrentTab; + + const NotRepliedDoctorQuestions({Key? key, this.changeCurrentTab}) + : super(key: key); + + @override + _NotRepliedDoctorQuestionsState createState() => + _NotRepliedDoctorQuestionsState(); +} + +class _NotRepliedDoctorQuestionsState extends State { + int pageIndex = 1; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: model.listDoctorNotRepliedQuestions.isEmpty + ? ErrorMessage(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: + model.listDoctorNotRepliedQuestions.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: model + .listDoctorNotRepliedQuestions[ + index], + previousModel: model, + ), + settings: RouteSettings( + name: 'DoctorReplayChat'), + )); + }, + child: DoctorReplyWidget( + reply: + model.listDoctorNotRepliedQuestions[ + index]), + ), + if (model.state == ViewState.BusyLocal && + index == + model.listDoctorNotRepliedQuestions + .length - + 1) + DrAppCircularProgressIndeicator() + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && + t.metrics.pixels >= + t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); + } + return; + }, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart deleted file mode 100644 index 38bc801c..00000000 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -/* - *@author: Mohammad Aljammal - *@Date:28/4/2020 - *@param: - *@return: - *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service - */ -class DoctorReplyScreen extends StatelessWidget { - final Function changeCurrentTab; - - const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) { - model.getDoctorReply(); - }, - builder: (_, model, w) => WillPopScope( - onWillPop: () async { - changeCurrentTab(); - return false; - }, - child: AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2!, - isShowAppBar: false, - body: model.listDoctorWorkingHoursTable.isEmpty - ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem ?? "") - : Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model.listDoctorWorkingHoursTable.map((reply) { - return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => DoctorReplayChat( - reply: reply, - previousModel: model, - ))); - }, - child: DoctorReplyWidget(reply: reply), - ); - }).toList(), - ) - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/screens/doctor/my_referral_patient_screen.dart b/lib/screens/doctor/my_referral_patient_screen.dart deleted file mode 100644 index 7f648b0e..00000000 --- a/lib/screens/doctor/my_referral_patient_screen.dart +++ /dev/null @@ -1,72 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/doctor/my_referral_patient_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; - -import '../../widgets/shared/app_scaffold_widget.dart'; - -class MyReferralPatient extends StatefulWidget { - int expandedItemIndex = -1; - - @override - _MyReferralPatientState createState() => _MyReferralPatientState(); -} - -class _MyReferralPatientState extends State { - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getMyReferralPatient(), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).myReferralPatient ?? "", - body: model.listMyReferralPatientModel.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Container( - child: Column( - children: [ - ...List.generate( - model.listMyReferralPatientModel.length, - (index) => MyReferralPatientWidget( - myReferralPatientModel: model.listMyReferralPatientModel[index], - model: model, - expandClick: () { - setState(() { - if (widget.expandedItemIndex == index) { - widget.expandedItemIndex = -1; - } else { - widget.expandedItemIndex = index; - } - }); - }, - isExpand: widget.expandedItemIndex == index, - ), - ) - ], - ), - ), - ], - ), - ], - ), - ), - )); - } -} diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index 5e45c9b4..8f51d553 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -82,8 +82,8 @@ class _DashboardSwipeWidgetState extends State { raduis: 16, showBorder: false, borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, + shadowWidth: 0.1, + shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[1], @@ -95,8 +95,8 @@ class _DashboardSwipeWidgetState extends State { raduis: 16, showBorder: false, borderColor: Colors.white, - shadowWidth: 0.2, - shadowSpreadRadius: 3, + shadowWidth: 0.1, + shadowSpreadRadius: 2, shadowDy: 1, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding(padding: const EdgeInsets.all(5.0), child: GetOutPatientStack(dashboardItemList[0]))); diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 798b73cd..704c9eb3 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { final Color backgroundColor; final IconData cardIcon; + final String cardIconImage; final Color backgroundIconColor; final String text; final Color textColor; @@ -16,6 +17,7 @@ class HomePatientCard extends StatelessWidget { required this.backgroundColor, required this.backgroundIconColor, required this.cardIcon, + required this.cardIconImage, required this.text, required this.textColor, required this.onTap, @@ -39,29 +41,44 @@ class HomePatientCard extends StatelessWidget { Expanded( child: Stack( children: [ - Positioned( - top: SizeConfig.isHeightVeryShort ? 8 : 8, - left: SizeConfig.isHeightVeryShort ? 5 : 10, - width: SizeConfig.getWidthMultiplier(width: width) * 10, - height: SizeConfig.getWidthMultiplier(width: width) * 15, - child: Icon( - cardIcon, - size: SizeConfig.getWidthMultiplier(width: width) * - (SizeConfig.isHeightVeryShort ? 45 : 60), - color: backgroundIconColor, - ), + Container( + margin: EdgeInsets.only(top: 18, left: 10), + color: Colors.transparent, + child: cardIcon != null + ? Icon( + cardIcon, + size: iconSize * 2, + color: backgroundIconColor, + ) + : IconButton( + icon: Image.asset( + 'assets/images/patient_register.png', + width: iconSize * 2, + height: iconSize * 2, + fit: BoxFit.fill, + ), + iconSize: iconSize * 2, + color: backgroundIconColor, + onPressed: () => null, + ), ), Container( child: Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - cardIcon, - size: + cardIcon != null + ? Icon( + cardIcon, + size: SizeConfig.getWidthMultiplier(width: width) * 22, - color: textColor, - ), + color: textColor, + ) + : Image.asset( + cardIconImage, + height: iconSize, + width: iconSize, + ), SizedBox( height: 4, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 5c97cb9c..c609ad7a 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -1,28 +1,36 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; +import 'package:doctor_app_flutter/screens/patients/In_patient/in_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPatientPage.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../routes.dart'; import 'home_screen_header.dart'; import 'label.dart'; @@ -60,11 +68,7 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - await model.setFirebaseNotification(projectsProvider, authenticationViewModel); - await model.getDashboard(); - await model.getDoctorProfile(isGetProfile: true); - await model.checkDoctorHasLiveCare(); - // await model.getSpecialClinicalCareList(); + model.startHomeScreenServices(projectsProvider, authenticationViewModel); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -77,107 +81,251 @@ class _HomeScreenState extends State { ), body: ListView(children: [ Column(children: [ - // SizedBox( - // height: SizeConfig.heightMultiplier * 1.4, - // ), - model.dashboardItemsList.length > 0 - ? DashboardSwipeWidget( - model.dashboardItemsList, - model, - (sliderIndex) { - setState(() { - sliderActiveIndex = sliderIndex; - }); - }, - ) - : SizedBox(), - - // SizedBox( - // height: SizeConfig.heightMultiplier * 1.4, - // ), - model.dashboardItemsList.length > 0 - ? FractionallySizedBox( - widthFactor: 0.94, + StickyHeader( + header: Container( + color: Colors.grey[100], + padding: EdgeInsets.only(top: 10), + child: Stack(children: [ + IconButton( + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), + iconSize: 18, + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), + Column(children: [ + ProfileWelcomeWidget( + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * .6, + child: projectsProvider.doctorClinicsList.length > + 0 + ? Stack( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Container( + padding: + EdgeInsets.all(2), + margin: + EdgeInsets.all(2), + decoration: + new BoxDecoration( + color: + Colors.red[800], + borderRadius: + BorderRadius + .circular( + 20), + ), + constraints: + BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + projectsProvider + .doctorClinicsList + .length + .toString(), + color: + Colors.white, + fontSize: + projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign + .center, + ), + )), + ], + ), + AppText(item.clinicName, + fontSize: 12, + color: Colors.black, + fontWeight: + FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + clinicId = newValue; + GifLoaderDialogUtils.showMyDialog( + context); + await model.changeClinic(newValue, + authenticationViewModel); + GifLoaderDialogUtils.hideDialog( + context); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: AppText( + item.clinicName, + textAlign: TextAlign.left, + ), + value: item.clinicID, + ); + }).toList(), + )), + ], + ) + : AppText( + TranslationBase.of(context).noClinic), + ), + ], + ), + isClinic: true, + height: 50, + ), + ]) + ])), + content: Column( + children: [ + if (model.state != ViewState.ErrorLocal) + Column( + mainAxisSize: MainAxisSize.min, + children: [ + model.dashboardItemsList.length > 0 + ? DashboardSwipeWidget( + model.dashboardItemsList, + model, + (sliderIndex) { + setState(() { + sliderActiveIndex = sliderIndex; + }); + }, + ) + : SizedBox(), + model.dashboardItemsList.length > 0 + ? FractionallySizedBox( + widthFactor: 0.90, + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + sliderActiveIndex == 1 + ? DashboardSliderItemWidget( + model.dashboardItemsList[4]) + : sliderActiveIndex == 0 + ? DashboardSliderItemWidget( + model.dashboardItemsList[3]) + : DashboardSliderItemWidget( + model.dashboardItemsList[6]), + ]))) + : SizedBox(), + ], + ) + else + Container( + child: ErrorMessage( + error: model.error, + )), + FractionallySizedBox( + // widthFactor: 0.90, child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + )), + padding: EdgeInsets.only(left: 20, top: 10, right: 20), + margin: EdgeInsets.only(top: 10), child: Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * 3, + height: 10, + ), + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patients, + fontSize: 12, + fontWeight: FontWeight.bold, + fontHeight: .5, + ), + AppText( + TranslationBase.of(context).services, + fontSize: 22, + fontWeight: FontWeight.bold, + ), + ], + )), + SizedBox( + height: 10, + ), + Container( + height: 120, + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + ...homePatientsCardsWidget( + model, projectsProvider), + ])), + SizedBox( + height: 20, ), - sliderActiveIndex == 1 - ? DashboardSliderItemWidget(model.dashboardItemsList[4]) - : sliderActiveIndex == 0 - ? DashboardSliderItemWidget(model.dashboardItemsList[3]) - : DashboardSliderItemWidget(model.dashboardItemsList[6]), - ], - ), - ), - ) - : SizedBox(), - SizedBox( - height: SizeConfig.heightMultiplier * 1.4, - ), - FractionallySizedBox( - // widthFactor: 0.90, - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topRight: Radius.circular(70), - )), - padding: EdgeInsets.only( - left: SizeConfig.widthMultiplier * 3.1, top: 10, right: SizeConfig.widthMultiplier * 3.1), - margin: EdgeInsets.only(top: 10), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.heightMultiplier * 1, - ), - Container( - child: Label( - firstLine: TranslationBase.of(context).patients!, - secondLine: TranslationBase.of(context).services!, - )), - SizedBox( - height: SizeConfig.heightMultiplier * .6, - ), - Container( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 16 - : SizeConfig.isHeightShort - ? 14 - : SizeConfig.isHeightLarge - ? 15 - : 13), - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - ...homePatientsCardsWidget(model, projectsProvider), ], ), ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 3 - : SizeConfig.isHeightShort - ? 4 - : 2)) - ], - ), + ), + ], ), - ), + ) ]), ]), ), ); } - List homePatientsCardsWidget(DashboardViewModel model, projectsProvider) { + List homePatientsCardsWidget( + DashboardViewModel model, projectsProvider) { colorIndex = 0; // List backgroundColors = List(3); @@ -220,6 +368,23 @@ class _HomeScreenState extends State { iconSize: 21, text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", onTap: () { + // TODO MOSA TEST + // PatiantInformtion patient = PatiantInformtion( + // patientStatusType: 43, + // episodeNo: 0, + // vcId: 42342, + // fullName: "mosa test", + // dateofBirth: "2000-05-01 10:42:35.790004" + // ); + // Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + // "patient": patient, + // "patientType": "0", + // "isSearch": false, + // "isInpatient": false, + // "arrivalType": "0", + // "isSearchAndOut": false, + // "isFromLiveCare": true, + // }); Navigator.push( context, FadePage( @@ -241,7 +406,7 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen( + page: InPatientScreen( specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!), ), ), @@ -250,6 +415,24 @@ class _HomeScreenState extends State { )); changeColorIndex(); + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + //TODO Elham* match the of the icon + cardIcon: DoctorApp.arrival_patients, + textColor: textColors[colorIndex], + text: TranslationBase.of(context).registerNewPatient, + onTap: () { + Navigator.push( + context, + FadePage( + page: RegisterPatientPage(), + ), + ); + }, + )); + changeColorIndex(); + patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], @@ -265,7 +448,9 @@ class _HomeScreenState extends State { MaterialPageRoute( builder: (context) => OutPatientsScreen( patientSearchRequestModel: PatientSearchRequestModel( - from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID)), + from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID), + ), + settings: RouteSettings(name: 'OutPatientsScreen'), )); }, )); @@ -282,6 +467,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => PatientReferralScreen(), + settings: RouteSettings(name: 'PatientReferralScreen'), ), ); }, @@ -299,6 +485,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => PatientSearchScreen(), + settings: RouteSettings(name: 'PatientSearchScreen'), )); }, )); @@ -315,6 +502,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => MedicineSearchScreen(), + settings: RouteSettings(name: 'MedicineSearchScreen'), )); }, )); diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index ceec4474..886061c8 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -78,6 +78,7 @@ class _EndCallScreenState extends State { kSessionId: liveCareModel.startCallRes.openSessionID, kApiKey: '46209962', vcId: patient!.vcId, + isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording: false, patientName: patient!.fullName ?? (patient!.firstName != null ? "${patient!.firstName} ${patient!.lastName}" : "-"), tokenID: await liveCareModel.getToken(), generalId: GENERAL_ID, @@ -170,7 +171,8 @@ class _EndCallScreenState extends State { TranslationBase.of(context).transferTo!, TranslationBase.of(context).admin!, '', 'patient/health_summary.png', onTap: () { Navigator.push(context, - MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!))); + MaterialPageRoute(builder: (BuildContext context) => LivaCareTransferToAdmin(patient: patient!), + settings: RouteSettings(name: 'LivaCareTransferToAdmin'),),); }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index aee028cf..0e13c867 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -2,18 +2,24 @@ import 'dart:async'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; +import '../../locator.dart'; import '../../routes.dart'; class LiveCarePatientScreen extends StatefulWidget { @@ -86,43 +92,20 @@ class _LiveCarePatientScreenState extends State { SizedBox( height: 20, ), - Center( - child: FractionallySizedBox( - widthFactor: .9, - child: Container( - width: double.maxFinite, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: Color(0xffCCCCCC), - ), - color: Colors.white), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - onPressed: () {}, + AppTextFieldCustomSearch( + searchController: _controller, + onChangeFun: (value) { + model.searchData(value); + }, + marginTop: 5, + suffixIcon: IconButton( + onPressed: () {}, icon: Icon( DoctorApp.filter_1, color: Colors.black, ), iconSize: 20, - padding: EdgeInsets.only(bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + ), ), model.state == ViewState.Idle @@ -131,7 +114,8 @@ class _LiveCarePatientScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context).youDontHaveAnyPatient!, + error: TranslationBase.of(context) + .youDontHaveAnyPatient!, ), ) : ListView.builder( @@ -142,7 +126,8 @@ class _LiveCarePatientScreenState extends State { return Padding( padding: EdgeInsets.all(8.0), child: PatientCard( - patientInfo: model.filterData[index], + patientInfo: PatiantInformtion.fromJson( + model.filterData[index].toJson()), patientType: "0", arrivalType: "0", isFromSearch: false, @@ -150,15 +135,20 @@ class _LiveCarePatientScreenState extends State { isFromLiveCare: true, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filterData[index], - "patientType": "0", - "isSearch": false, - "isInpatient": false, - "arrivalType": "0", - "isSearchAndOut": false, - "isFromLiveCare": true, - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": + PatiantInformtion.fromJson( + model.filterData[index] + .toJson()), + "patientType": "0", + "isSearch": false, + "isInpatient": false, + "arrivalType": "0", + "isSearchAndOut": false, + "isFromLiveCare": true, + }); }, // isFromSearch: widget.isSearch, ), @@ -169,9 +159,28 @@ class _LiveCarePatientScreenState extends State { child: AppLoaderWidget( containerColor: Colors.transparent, )), + // AppButton( + // fontWeight: FontWeight.w700, + // color:Colors.green[600], + // title: TranslationBase.of(context).initiateCall, + // disabled: model.state == ViewState.BusyLocal, + // onPressed: () async { + // AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ + // locator().openVideo(model.startCallRes, PatiantInformtion( + // vcId: 454353, + // fullName: "test mosa" + // ), callConnected, callDisconnected); + // }); + // + // }, + // ), ], ), ), ); } + + callConnected() {} + + callDisconnected() {} } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 6c959f3a..f78bef85 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -66,6 +66,7 @@ class _VideoCallPageState extends State { //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', vcId: widget.patientData.vcId, + isRecording: tokenData != null ? tokenData.isRecording: false, patientName: widget.patientData.fullName != null ? widget.patientData.fullName! : widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index e2af3da8..9b8450e3 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -80,11 +82,14 @@ class _HealthSummaryPageState extends State { itemCount: model.medicalFileList[0].entityList![0].timelines!.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( - onTap: () { + onTap: () async{ if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0] .consulations!.length != 0) - Navigator.push( + await locator().logEvent( + eventCategory: "Health Summary Page", + eventAction: "Health Summary Details", + );Navigator.push( context, MaterialPageRoute( builder: (context) => MedicalFileDetails( @@ -96,26 +101,29 @@ class _HealthSummaryPageState extends State { pp: patient.patientId, patient: patient, doctorName: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty + .timeLineEvents![0].consulations!.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index].doctorName : "", clinicName: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty + .timeLineEvents![0].consulations!.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index].clinicName : "", doctorImage: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.isNotEmpty + .timeLineEvents![0].consulations!.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index].doctorImage : "", episode: model.medicalFileList[0].entityList![0].timelines![index] .timeLineEvents![0].consulations!.isNotEmpty - ? model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations![0].episodeID + ? model.medicalFileList[0].entityList![0].timelines![index] + .timeLineEvents![0] + .consulations![0].episodeID .toString() : "", vistDate: model.medicalFileList[0].entityList![0].timelines![index].date - .toString())), - ); + .toString()), + settings: RouteSettings(name: 'MedicalFileDetails'), + ), + ); }, child: DoctorCard( doctorName: @@ -128,8 +136,7 @@ class _HealthSummaryPageState extends State { model.medicalFileList[0].entityList![0].timelines![index].date ?? "", ), isPrescriptions: true, - isShowEye: model.medicalFileList[0].entityList![0].timelines![index] - .timeLineEvents![0].consulations!.length != + isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length != 0 ? true : false), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index b5027c33..ec58385a 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -133,21 +134,13 @@ class _MedicineSearchState extends State { ), FractionallySizedBox( widthFactor: 0.9, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, + child: AppTextFieldCustomSearch( hintText: TranslationBase.of(context).searchMedicineNameHere, - controller: myController, - onSaved: (value) {}, - onFieldSubmitted: (value) { - searchMedicine(context, model); - }, - inputFormatter: ONLY_LETTERS, - ), + searchController: myController, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + marginTop: 5, ), ), SizedBox( @@ -210,6 +203,8 @@ class _MedicineSearchState extends State { builder: (context) => PharmaciesListScreen( itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]), + settings: RouteSettings( + name: 'PharmaciesListScreen'), ), ); }, diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart new file mode 100644 index 00000000..8c9f0f1d --- /dev/null +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -0,0 +1,346 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; + +Helpers helpers = Helpers(); + +class AddPatientSickLeaveScreen extends StatefulWidget { + final appointmentNo; + final patientMRN; + final PatiantInformtion patient; + final SickLeaveViewModel previousModel; + + AddPatientSickLeaveScreen( + {this.appointmentNo, + this.patientMRN, + this.patient, this.previousModel}); + + @override + _AddPatientSickLeaveScreenState createState() => + _AddPatientSickLeaveScreenState(); +} + +class _AddPatientSickLeaveScreenState extends State { + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + TextEditingController _toDateController = new TextEditingController(); + TextEditingController _numberOfDayController = new TextEditingController(); + TextEditingController _clinicController = new TextEditingController(); + TextEditingController _doctorController = new TextEditingController(); + TextEditingController _remarkController = new TextEditingController(); + DateTime currentDate; + + AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); + bool isFormSubmitted = false; + void _presentDatePicker() { + showDatePicker( + context: context, + initialDate: currentDate??DateTime.now(), + firstDate: DateTime(DateTime.now().year-1), + lastDate: DateTime(DateTime.now().year+1), + ).then((pickedDate) { + if (pickedDate == null) { + return; + } + setState(() { + final df = new DateFormat('yyyy-MM-dd'); + addSickLeave.startDate = df.format(pickedDate); + currentDate = pickedDate; + _toDateController.text = AppDateUtils.getDayMonthYearDateFormatted(pickedDate,isMonthShort: true ); + }); + }); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async { + await model.getDoctorProfile(); + _clinicController.text = model.doctorProfile.clinicDescription; + _doctorController.text = model.doctorProfile.doctorName; + await model.preSickLeaveStatistics( + widget.appointmentNo, widget.patientMRN); + }, + builder: (_, model, w) => GestureDetector( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addSickLeave, + ), + isShowAppBar: true, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + SizedBox( + height: 30, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).sickLeave + + ' ' + + TranslationBase.of(context).days, + maxLines: 1, + minLines: 1, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + inputType:TextInputType.number, + controller: _numberOfDayController, + onChanged: (value) { + if(value.isNotEmpty) + setState(() { + addSickLeave.noOfDays = value; + }); + + }, + validationError: isFormSubmitted && + (addSickLeave.noOfDays == null) + ? TranslationBase.of(context) + .pleaseEnterNoOfDays + : null, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: () { + Helpers.hideKeyboard(context); + _presentDatePicker(); + }, + hintText: TranslationBase.of(context) + .sickLeaveDate, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon(Icons.calendar_today)), + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + controller: _toDateController, + onChanged: (value) { + setState(() { + addSickLeave.startDate = value; + }); + + }, + validationError: isFormSubmitted && + (addSickLeave.startDate == null) + ? TranslationBase.of(context) + .pleaseEnterDate + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).clinic, + enabled: false, + maxLines: 1, + minLines: 1, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + controller: _clinicController, + onChanged: (value) {}, + ), + SizedBox( + height: 10, + ), + model.sickLeaveStatistics.recommendedSickLeaveDays!= + null + ? Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + SizedBox( + width: 10, + ), + Icon( + DoctorApp.warning, + size: 20, + color: IN_PROGRESS_COLOR, + ), + SizedBox( + width: 10, + ), + Expanded( + child: AppText( + model.sickLeaveStatistics.recommendedSickLeaveDays, + textAlign: TextAlign.start, + fontSize: 12, + color: IN_PROGRESS_COLOR, + ), + ), + ], + ) + : SizedBox( + height: 10, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).doctor, + enabled: false, + maxLines: 1, + minLines: 1, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + controller: _doctorController, + onChanged: (value) {}, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).remarks, + maxLines: 30, + minLines: 5, + dropDownColor: Colors.white, + isTextFieldHasSuffix: true, + controller: _remarkController, + onChanged: (value) { + setState(() { + addSickLeave.remarks = value; + }); + }, + ), + + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10) +20, + ), + ], + ), + ), + ), + ), + bottomSheet: model.state == ViewState.Busy || + model.state == ViewState.Busy + ? Container( + height: 0, + ) + : Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all( + color: HexColor('#707070'), width: 0), + ), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: AppButton( + title: TranslationBase.of(context) + .addSickLeaverequest, + color: Colors.green, + onPressed: () async { + submitForm(model); + }), + ), + SizedBox( + height: 5, + ), + ], + ), + )), + )); + } + + submitForm(SickLeaveViewModel model) async { + { + try { + setState(() { + isFormSubmitted = true; + }); + if (addSickLeave.noOfDays == null || + addSickLeave.startDate == null ) { + return; + } else { + GifLoaderDialogUtils.showMyDialog(context); + addSickLeave.patientMRN = widget.patient.patientMRN.toString(); + addSickLeave.appointmentNo = + widget.patient.appointmentNo.toString(); + await model.addSickLeave(addSickLeave); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } else { + await widget.previousModel + .getSickLeaveForPatient(widget.patient, isLocalBusy: true); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).replySuccessfully); + Navigator.of(context).pop(); + } + + GifLoaderDialogUtils.hideDialog(context); + } + } catch (err) { + print(err); + } + + } + } + +} diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart new file mode 100644 index 00000000..51c5b35b --- /dev/null +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -0,0 +1,297 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PatientSickLeaveScreen extends StatelessWidget { + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; + return BaseView( + onModelReady: (model) async { + await model.getSickLeaveForPatient(patient); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: Column(children: [ + patient.patientStatusType == 43 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.isHeightVeryShort + ? 30 + : SizeConfig.isHeightShort + ? 35 + : 10, + ), + if (!projectsProvider.isArabic) + AppText( + TranslationBase.of(context).patient, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 3 : 4), + fontWeight: FontWeight.w700, + letterSpacing: -0.72, + color: Color(0xFF2E303A), + ), + AppText( + TranslationBase.of(context).sickLeave, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 6 : 6), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + color: Color(0xFF2E303A), + ), + ], + ), + ), + AddNewOrder( + label: TranslationBase.of(context).noSickLeaveApplied, + onTap: () async { + await locator().logEvent( + eventCategory: "Add Sick Leave Screen" + "Leave Screen", + eventAction: "apply For Sick Leave", + ); + openSickLeave(context, model); + }), + ], + ) + : SizedBox(), + model.getAllSIckLeavePatient.length > 0 + ? Expanded( + child: FractionallySizedBox( + widthFactor: 0.95, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.getAllSIckLeavePatient.length, + itemBuilder: (BuildContext ctxt, int index) { + SickLeavePatientModel item = + model.getAllSIckLeavePatient[index]; + return Column( + children: [ + CardWithBgWidget( + padding: 0, + marginLeft: 10, + marginSymmetric: 10, + hasBorder: false, + bgColor: Colors.black, + widget: Container( + color: Colors.white, + padding: EdgeInsets.all(20), + child: InkWell( + child: Column( + children: [ + if(item.doctorName != null) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + Helpers.capitalize( + item.doctorName ?? ""), + fontSize: 18, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: + TextOverflow.ellipsis, + ), + ), + ]), + SizedBox( + height: 10, + ), + Row( + children: [ + ClipRRect( + borderRadius: + BorderRadius.circular(50.0), + child: CachedNetworkImage( + imageUrl: item + .doctorImageURL ?? + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + height: 30, + width: 30, + errorWidget: + (context, url, error) => + AppText( + 'No Image', + fontSize: 10, + ), + ), + ), + SizedBox( + width: 10, + ), + Column( + children: [ + CustomRow( + label: TranslationBase.of( + context) + .daysSickleave , + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: (item.sickLeaveDays + .toString() != + null && + item.sickLeaveDays + .toString() != + "null") + ? item.sickLeaveDays + .toString() + : item.noOfDays + .toString(), + ), + CustomRow( + label: TranslationBase.of( + context) + .startDate + + ' ' ?? + "", + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: AppDateUtils + .getDayMonthYearDateFormatted( + item.startDate.contains( + "/Date(") + ? AppDateUtils + .convertStringToDate( + item + .startDate) + : DateTime.parse( + item.startDate), + ), + ), + CustomRow( + label: TranslationBase.of( + context) + .endDate + + ' ' ?? + "", + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: AppDateUtils + .getDayMonthYearDateFormatted( + item.startDate.contains( + "/Date(") + ? AppDateUtils + .convertStringToDate( + item.endDate ?? + "") + .add( + Duration( + days: item + .noOfDays ?? + item.sickLeaveDays), + ) + : DateTime.parse( + item.startDate ?? + "") + .add( + Duration( + days: + item.noOfDays ?? + ""), + ), + ), + ), + ], + crossAxisAlignment: + CrossAxisAlignment.start, + ), + ], + ), + ], + ), + ), + ), + ), + ], + ); + }), + ), + ) + : patient.patientStatusType != 43 + ? ErrorMessage( + error: TranslationBase.of(context).noSickLeave, + ) + : SizedBox(), + SizedBox( + height: 100, + ) + ]), + ), + ); + } + + openSickLeave(BuildContext context, model) { + Navigator.push( + context, + SlideUpPageRoute( + fullscreenDialog: true, + widget: AddPatientSickLeaveScreen( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN, + patient: patient, + previousModel: model, + ), + ), + ); + } +} diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index b1e3c754..6791785a 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -28,7 +29,7 @@ class _DischargedPatientState extends State { builder: (_, model, w) => AppScaffold( //appBarTitle: 'Discharged Patient', //subtitle: "Last Three Months", - backgroundColor: Colors.grey[200]!, + backgroundColor: Colors.grey[200], isShowAppBar: false, baseViewModel: model, body: model.myDischargedPatient.isEmpty @@ -58,46 +59,24 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), + SizedBox( height: 12, ), - Container( - width: double.maxFinite, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: Color(0xffCCCCCC), - ), - color: Colors.white), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - onPressed: () {}, - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: EdgeInsets.only(bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + AppTextFieldCustomSearch( + searchController: _controller, + onChangeFun: (value) { + model.searchData(value); + }, + marginTop: 0, + suffixIcon: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + ), + ), SizedBox( height: 5, ), @@ -109,84 +88,136 @@ class _DischargedPatientState extends State { model.filterData.length, (index) => InkWell( onTap: () { - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filterData[index], - "patientType": "1", - "isSearch": false, - "isInpatient": true, - "isDischargedPatient": true - }); + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": + model.filterData[index], + "patientType": "1", + "isSearch": false, + "isInpatient": true, + "isDischargedPatient": true + }); }, child: Container( width: double.maxFinite, margin: EdgeInsets.all(8), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only( + left: 0, + right: 5, + bottom: 5, + top: 5), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), + borderRadius: + BorderRadius.circular(15), color: Colors.white, ), child: Column( children: [ Padding( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only( + left: 12.0), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, children: [ Row(children: [ Container( width: 170, child: AppText( - (Helpers.capitalize(model.filterData[index].firstName) + + (Helpers.capitalize(model + .filterData[ + index] + .firstName) + " " + - Helpers.capitalize( - model.filterData[index].lastName)), + Helpers.capitalize(model + .filterData[ + index] + .lastName)), fontSize: 16, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, + fontWeight: + FontWeight + .bold, + fontFamily: + 'Poppins', + textOverflow: + TextOverflow + .ellipsis, ), ), - model.filterData[index].gender == 1 + model.filterData[index] + .gender == + 1 ? Icon( - DoctorApp.male_2, - color: Colors.blue, + DoctorApp + .male_2, + color: Colors + .blue, ) : Icon( - DoctorApp.female_1, - color: Colors.pink, + DoctorApp + .female_1, + color: Colors + .pink, ), ]), Row( children: [ AppText( - model.filterData[index].nationalityName != null - ? model.filterData[index].nationalityName!.trim() - : model.filterData[index].nationality != null - ? model.filterData[index].nationality!.trim() - : model.filterData[index].nationalityId != null + model.filterData[index].nationalityName != + null + ? model + .filterData[ + index] + .nationalityName + .trim() + : model.filterData[index].nationality != + null + ? model + .filterData[ + index] + .nationality + .trim() + : model.filterData[index].nationalityId != + null ? model.filterData[index].nationalityId : "", - fontWeight: FontWeight.bold, + fontWeight: + FontWeight + .bold, fontSize: 14, - textOverflow: TextOverflow.ellipsis, + textOverflow: + TextOverflow + .ellipsis, ), - model.filterData[index].nationality != null || - model.filterData[index].nationalityId != null + model.filterData[index].nationality != + null || + model.filterData[index].nationalityId != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( + borderRadius: + BorderRadius.circular( + 20.0), + child: Image + .network( model.filterData[index].nationalityFlagURL != null - ? model - .filterData[index].nationalityFlagURL! + ? model.filterData[index].nationalityFlagURL : '', - height: 25, - width: 30, + height: + 25, + width: + 30, errorBuilder: (BuildContext context, - Object exception, StackTrace? stackTrace) { + Object + exception, + StackTrace + stackTrace) { return AppText( '', - fontSize: 10, + fontSize: + 10, ); }, )) @@ -198,18 +229,26 @@ class _DischargedPatientState extends State { Row( children: [ Column( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment + .start, children: [ Padding( - padding: EdgeInsets.only(left: 12.0), + padding: + EdgeInsets.only( + left: 12.0), child: Container( width: 60, height: 60, - child: Image.asset( - model.filterData[index].gender == 1 + child: + Image.asset( + model.filterData[index] + .gender == + 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + fit: BoxFit + .cover, ), ), ), @@ -220,80 +259,118 @@ class _DischargedPatientState extends State { ), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment + .start, children: [ Container( child: RichText( - text: new TextSpan( + text: + new TextSpan( style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ + fontSize: 2.0 * + SizeConfig + .textMultiplier, + color: Colors + .black), + children: < + TextSpan>[ new TextSpan( - text: TranslationBase.of(context).fileNumber, + text: TranslationBase.of(context) + .fileNumber, style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), + fontSize: + 14, + fontFamily: + 'Poppins')), new TextSpan( - text: model.filterData[index].patientId + text: model + .filterData[ + index] + .patientId .toString(), style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), + fontWeight: FontWeight + .w700, + fontFamily: + 'Poppins', + fontSize: + 15)), ], ), ), ), Container( child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + text: + new TextSpan( + style: + new TextStyle( + fontSize: 2.0 * + SizeConfig + .textMultiplier, + color: Colors + .black, + fontFamily: + 'Poppins', ), - children: [ + children: < + TextSpan>[ new TextSpan( text: model.filterData[index].admissionDate == null ? "" - : TranslationBase.of(context) - .admissionDate! + + : TranslationBase.of(context).admissionDate + " : ", - style: TextStyle(fontSize: 14)), + style: TextStyle( + fontSize: + 14)), new TextSpan( text: model.filterData[index].admissionDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 15)), + fontWeight: + FontWeight.w700, + fontSize: 15)), ], ), ), ), Container( child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + text: + new TextSpan( + style: + new TextStyle( + fontSize: 2.0 * + SizeConfig + .textMultiplier, + color: Colors + .black, + fontFamily: + 'Poppins', ), - children: [ + children: < + TextSpan>[ new TextSpan( text: model.filterData[index].dischargeDate == null ? "" : "Discharge Date : ", - style: TextStyle(fontSize: 14)), + style: TextStyle( + fontSize: + 14)), new TextSpan( text: model.filterData[index].dischargeDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( - fontWeight: FontWeight.w700, fontSize: 15)), + fontWeight: + FontWeight.w700, + fontSize: 15)), ], ), ), @@ -303,17 +380,26 @@ class _DischargedPatientState extends State { AppText( "${TranslationBase.of(context).numOfDays}: ", fontSize: 14, - fontWeight: FontWeight.w300, + fontWeight: + FontWeight + .w300, ), AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate ?? "")).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + fontSize: + 15, + fontWeight: + FontWeight + .w700), ], ), ], ), - ) + ), + Icon( + Icons.arrow_forward, + size: 24, + ), ], ) ], diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart deleted file mode 100644 index 0a1bb65a..00000000 --- a/lib/screens/patients/InPatientPage.dart +++ /dev/null @@ -1,147 +0,0 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:flutter/material.dart'; - -import '../../routes.dart'; - -class InPatientPage extends StatefulWidget { - final bool isMyInPatient; - - InPatientPage(this.isMyInPatient); - - @override - _InPatientPageState createState() => _InPatientPageState(); -} - -class _InPatientPageState extends State { - TextEditingController _searchController = TextEditingController(); - - @override - void dispose() { - _searchController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async { - await model.setDefaultInPatientList(); - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - Container( - margin: EdgeInsets.all(16.0), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - model.filterSearchResults(value); - }), - ), - model.state == ViewState.Idle - ? model.filteredInPatientItems.length > 0 - ? Expanded( - child: ListView.builder( - //physics: BouncingScrollPhysics(), - // scrollDirection: Axis.vertical, - //shrinkWrap: true, - itemCount: model.filteredInPatientItems.length, - itemBuilder: (context, index) { - if (!widget.isMyInPatient) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: - model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else if (model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID && - widget.isMyInPatient) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: - model.filteredInPatientItems[index].doctorId == model.doctorProfile!.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else - return SizedBox(); - }), - ) - : Expanded( - child: SingleChildScrollView( - child: - Container(child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable ?? "")), - ), - ) - : Center( - child: Container( - height: 300, - width: 300, - child: Image.asset("assets/images/progress-loading-red.gif"), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart new file mode 100644 index 00000000..f2d0f74e --- /dev/null +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -0,0 +1,129 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +class InPatientHeader extends StatelessWidget with PreferredSizeWidget { + InPatientHeader( + {this.model, + this.specialClinic, + this.activeTab, + this.selectedMapId, + this.onChangeFunc}) + : super(); + final PatientSearchViewModel model; + final GetSpecialClinicalCareListResponseModel specialClinic; + final activeTab; + final selectedMapId; + final onChangeFunc; + + @override + Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + + return Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + TranslationBase.of(context).inPatient, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + ), + if (model.specialClinicalCareMappingList.isNotEmpty && + specialClinic != null && + activeTab != 2) + Container( + width: MediaQuery.of(context).size.width * .3, + child + : DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.specialClinicalCareMappingList.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + model.specialClinicalCareMappingList + .length + .toString(), + color: Colors.white, + fontSize: projectsProvider.isArabic + ? 10 + : 11, + textAlign: TextAlign.center, + ), + )), + ], + ), + AppText(selectedMapId == null?TranslationBase.of(context).all:item.description, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + onChangeFunc(newValue); + }, + items: model.specialClinicalCareMappingList.map((item) { + return DropdownMenuItem( + child: AppText( + item.description, + textAlign: TextAlign.left, + ), + value: item.nursingStationID, + ); + }).toList(), + )), + ), + ]), + ), + ); + } + + @override + Size get preferredSize => Size(double.maxFinite, 85); +} diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart new file mode 100644 index 00000000..0c48cd2a --- /dev/null +++ b/lib/screens/patients/In_patient/NoData.dart @@ -0,0 +1,20 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +class NoData extends StatelessWidget { + const NoData({ + Key key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable)), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart new file mode 100644 index 00000000..6e9ad14f --- /dev/null +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -0,0 +1,306 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +import 'NoData.dart'; +import 'list_of_all_in_patient.dart'; +import 'list_of_my_inpatient.dart'; + +class InPatientListPage extends StatefulWidget { + final bool isMyInPatient; + final PatientSearchViewModel patientSearchViewModel; + + final bool isAllClinic; + final bool showBottomSheet; + final String selectedClinicName; + final Function onChangeValue; + + InPatientListPage( + {this.isMyInPatient, + this.patientSearchViewModel, + this.selectedClinicName, + this.onChangeValue, + this.isAllClinic, + this.showBottomSheet}); + + @override + _InPatientListPageState createState() => _InPatientListPageState(); +} + +class _InPatientListPageState extends State { + TextEditingController _searchController = TextEditingController(); + + bool isSortDes = false; + bool hasQuery = false; + + @override + void dispose() { + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + baseViewModel: widget.patientSearchViewModel, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (!widget.isMyInPatient && + widget.patientSearchViewModel.inPatientList.isNotEmpty) + Container( + margin: EdgeInsets.only(left: 10.0, right: 10, top: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + child: Row( + children: [ + Radio( + value: 1, + groupValue: widget.isAllClinic ? 1 : 2, + onChanged: (value) { + setState(() { + widget.onChangeValue( + isAllClinic: true, + showBottomSheet: false, + selectedClinicName: null); + + widget.patientSearchViewModel + .setDefaultInPatientList(); + }); + }, + activeColor: Colors.red, + ), + AppText( + "${TranslationBase.of(context).allClinic}", + fontSize: 15, + ), + ], + ), + onTap: () { + widget.onChangeValue( + isAllClinic: true, + showBottomSheet: false, + selectedClinicName: null); + + widget.patientSearchViewModel.setDefaultInPatientList(); + }, + ), + if (widget + .patientSearchViewModel.InpatientClinicList.isNotEmpty) + InkWell( + onTap: () { + if (widget.patientSearchViewModel.InpatientClinicList + .length > + 0) { + widget.onChangeValue( + isAllClinic: false, + showBottomSheet: true, + selectedClinicName: widget.selectedClinicName); + } + }, + child: Row( + children: [ + Radio( + value: 2, + groupValue: widget.isAllClinic ? 1 : 2, + onChanged: (value) { + if (widget.patientSearchViewModel + .InpatientClinicList.length > + 0) { + widget.onChangeValue( + isAllClinic: false, + showBottomSheet: true, + selectedClinicName: + widget.selectedClinicName); + } + }, + activeColor: Colors.red, + ), + AppText( + widget.selectedClinicName ?? + TranslationBase.of(context).clinicSelect, + fontSize: 15, + ), + Container( + margin: EdgeInsets.only(bottom: 10), + child: Icon(FontAwesomeIcons.sortDown)) + ], + )), + ], + ), + ), + AppTextFieldCustomSearch( + searchController: _searchController, + onChangeFun: (value) { + setState(() { + hasQuery = true; + }); + widget.patientSearchViewModel.filterSearchResults(value, + isAllClinic: widget.isAllClinic, + isMyInPatient: widget.isMyInPatient); + }, + marginTop: widget.isMyInPatient ? 15 : 5, + positionedChild: IconButton( + icon: Icon( + isSortDes + ? FontAwesomeIcons.sortAmountDown + : FontAwesomeIcons.sortAmountUp, + color: Colors.black, + ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + onPressed: () { + GifLoaderDialogUtils.showMyDialog(context); + widget.patientSearchViewModel.sortInPatient( + isDes: isSortDes, + isAllClinic: widget.isAllClinic, + isMyInPatient: widget.isMyInPatient); + isSortDes = !isSortDes; + GifLoaderDialogUtils.hideDialog(context); + }, + ), + ), + widget.patientSearchViewModel.state == ViewState.Idle + ? (widget.isMyInPatient && + widget.patientSearchViewModel.myIinPatientList.length > 0) + ? ListOfMyInpatient( + isAllClinic: widget.isAllClinic, + hasQuery: hasQuery, + patientSearchViewModel: widget.patientSearchViewModel) + : widget.patientSearchViewModel.filteredInPatientItems + .length > + 0 + ? (widget.isMyInPatient && + widget.patientSearchViewModel.myIinPatientList + .length == + 0) + ? NoData() + : ListOfAllInPatient( + isAllClinic: widget.isAllClinic, + hasQuery: hasQuery, + patientSearchViewModel: + widget.patientSearchViewModel) + : NoData() + : Center( + child: Container( + height: 300, + width: 300, + ), + ), + ], + ), + bottomSheet: !widget.showBottomSheet + ? Container( + height: 0, + ) + : Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + height: MediaQuery.of(context).size.height * 0.5, + padding: EdgeInsets.only(top: 13, left: 10, right: 10), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + InkWell( + onTap: () { + widget.onChangeValue( + isAllClinic: widget.isAllClinic, + showBottomSheet: false, + selectedClinicName: widget.selectedClinicName); + }, + child: Icon(DoctorApp.close_1, + size: SizeConfig.getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2B353E))) + ], + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).clinicSelect} :", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 18, + ), + ], + ), + SizedBox( + height: 10, + ), + Expanded( + child: ListView.builder( + itemCount: widget + .patientSearchViewModel.InpatientClinicList.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + widget.onChangeValue( + isAllClinic: false, + showBottomSheet: false, + selectedClinicName: widget + .patientSearchViewModel + .InpatientClinicList[index]); + + widget.patientSearchViewModel.filterByClinic( + clinicName: widget.patientSearchViewModel + .InpatientClinicList[index]); + }, + child: Row( + children: [ + Radio( + value: widget.patientSearchViewModel + .InpatientClinicList[index], + groupValue: widget.selectedClinicName, + onChanged: (value) { + setState(() { + widget.onChangeValue( + isAllClinic: false, + showBottomSheet: false, + selectedClinicName: widget + .patientSearchViewModel + .InpatientClinicList[index]); + widget.patientSearchViewModel + .filterByClinic(clinicName: value); + }); + }, + activeColor: Colors.red, + ), + AppText( + widget.patientSearchViewModel + .InpatientClinicList[index], + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + )); + }), + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart new file mode 100644 index 00000000..b70d5788 --- /dev/null +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -0,0 +1,238 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../DischargedPatientPage.dart'; +import 'in_patient_list_page.dart'; + +class InPatientScreen extends StatefulWidget { + GetSpecialClinicalCareListResponseModel specialClinic; + + bool isAllClinic = true; + bool showBottomSheet = false; + String selectedClinicName; + InPatientScreen({Key? key, this.specialClinic}); + + @override + _InPatientScreenState createState() => _InPatientScreenState(); +} + +class _InPatientScreenState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + int _activeTab = 0; + int selectedMapId; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + Helpers.hideKeyboard(context); + setState(() { + widget.showBottomSheet = false; + _activeTab = _tabController.index; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + ProjectViewModel projectsProvider = Provider.of(context); + + return BaseView( + onModelReady: (model) async { + model.clearPatientList(); + if (widget.specialClinic != null) { + await model + .getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); + // requestModel.nursingStationID = + // model.specialClinicalCareMappingList[0].nursingStationID; + } + requestModel.clinicID = 0; + await model.getInPatientList(requestModel); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBar: InPatientHeader( + model: model, + selectedMapId: selectedMapId, + specialClinic: widget.specialClinic, + activeTab: _activeTab, + onChangeFunc: (newValue) async { + setState(() { + selectedMapId = newValue; + }); + model.clearPatientList(); + GifLoaderDialogUtils.showMyDialog(context); + + PatientSearchRequestModel requestModel = + PatientSearchRequestModel( + nursingStationID: selectedMapId, clinicID: 0); + await model.getInPatientList(requestModel, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + onChangeState( + isAllClinic: true, + showBottomSheet: false, + selectedClinicName: null); + } + }), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Scaffold( + extendBodyBehindAppBar: false, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget(screenSize, _activeTab == 0, + TranslationBase.of(context).inPatientAll, + counter: model.inPatientList.length), + tabWidget(screenSize, _activeTab == 1, + TranslationBase.of(context).myInPatientTitle, + counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, + TranslationBase.of(context).discharged), + ], + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + InPatientListPage( + isMyInPatient: false, + patientSearchViewModel: model, + isAllClinic: widget.isAllClinic, + showBottomSheet: widget.showBottomSheet, + selectedClinicName: widget.selectedClinicName, + onChangeValue: onChangeState), + InPatientListPage( + isMyInPatient: true, + patientSearchViewModel: model, + isAllClinic: widget.isAllClinic, + showBottomSheet: widget.showBottomSheet, + selectedClinicName: widget.selectedClinicName, + onChangeValue: onChangeState), + DischargedPatient(), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } + + onChangeState({isAllClinic, showBottomSheet, selectedClinicName}) { + setState(() { + widget.isAllClinic = isAllClinic; + widget.showBottomSheet = showBottomSheet; + widget.selectedClinicName = selectedClinicName; + }); + } + + Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { + return Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.5, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart new file mode 100644 index 00000000..06634819 --- /dev/null +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -0,0 +1,86 @@ +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; +import 'package:flutter/material.dart'; + +import '../../../routes.dart'; +import 'NoData.dart'; + +class ListOfAllInPatient extends StatelessWidget { + const ListOfAllInPatient({ + Key key, + @required this.isAllClinic, + @required this.hasQuery, + this.patientSearchViewModel, + }) : super(key: key); + + final bool isAllClinic; + final bool hasQuery; + + + final PatientSearchViewModel patientSearchViewModel; + + @override + Widget build(BuildContext context) { + return Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: patientSearchViewModel.filteredInPatientItems.length == 0 + ? NoData() + : NotificationListener( + child: ListView.builder( + itemCount: + patientSearchViewModel.filteredInPatientItems.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics (), + itemBuilder: (context, index) { + return PatientCard( + patientInfo: patientSearchViewModel + .filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: patientSearchViewModel + .filteredInPatientItems[index].doctorId == + patientSearchViewModel.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientSearchViewModel + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + "isMyPatient": patientSearchViewModel + .filteredInPatientItems[index].doctorId == + patientSearchViewModel.doctorProfile.doctorID, + }); + }, + ); + }), + onNotification: (notification) { + if (isAllClinic && !hasQuery) if (notification + is ScrollUpdateNotification) { + if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) { + patientSearchViewModel.addOnFilteredList(); + } + + if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) { + patientSearchViewModel.removeOnFilteredList(); + } + } + return; + }, + ), + ), + ); + } +} diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart new file mode 100644 index 00000000..f5f7c070 --- /dev/null +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -0,0 +1,66 @@ +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; +import 'package:flutter/material.dart'; + +import '../../../routes.dart'; +import 'NoData.dart'; +class ListOfMyInpatient extends StatelessWidget { + const ListOfMyInpatient({ + Key key, + @required this.isAllClinic, + @required this.hasQuery, + this.patientSearchViewModel, + }) : super(key: key); + + final bool isAllClinic; + final bool hasQuery; + final PatientSearchViewModel patientSearchViewModel; + + @override + Widget build(BuildContext context) { + return Expanded( + child:Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: patientSearchViewModel.filteredMyInPatientItems.length == 0 + ? NoData():NotificationListener( + child: ListView.builder( + itemCount: patientSearchViewModel.filteredMyInPatientItems.length, + scrollDirection: Axis.vertical, + // physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return PatientCard( + patientInfo: patientSearchViewModel.filteredMyInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: true, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": + patientSearchViewModel.filteredMyInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + "isMyPatient": true, + }); + }, + ); + }), + onNotification: (t) { + return; + }, + ), + ), + ); + } +} diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart deleted file mode 100644 index c1c96c95..00000000 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ /dev/null @@ -1,319 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/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/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import 'DischargedPatientPage.dart'; -import 'InPatientPage.dart'; - -class PatientInPatientScreen extends StatefulWidget { - GetSpecialClinicalCareListResponseModel? specialClinic; - - PatientInPatientScreen({Key? key, this.specialClinic}); - - @override - _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); -} - -class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin { - late TabController _tabController; - int _activeTab = 0; - - int? selectedMapId; - - - @override - void initState() { - super.initState(); - _tabController = TabController(length: 3, vsync: this); - _tabController.addListener(_handleTabSelection); - } - - @override - void dispose() { - super.dispose(); - _tabController.dispose(); - } - - _handleTabSelection() { - setState(() { - _activeTab = _tabController.index; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery - .of(context) - .size; - PatientSearchRequestModel requestModel = PatientSearchRequestModel(); - ProjectViewModel projectsProvider = Provider.of(context); - - - return BaseView( - onModelReady: (model) async { - model.clearPatientList(); - // if (widget.specialClinic != null) { - // await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); - // requestModel.nursingStationID = - // model.specialClinicalCareMappingList[0].nursingStationID; - // requestModel.clinicID = 0; - // } - model.getInPatientList(requestModel); - }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - TranslationBase - .of(context) - .inPatient, - fontSize: SizeConfig.textMultiplier * 2.8, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - ), - if (model.specialClinicalCareMappingList.isNotEmpty && - widget.specialClinic != null && - _activeTab != 2) - Container( - width: MediaQuery.of(context).size.width * .3, - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedMapId == null ? model - .specialClinicalCareMappingList[0] - .nursingStationID : selectedMapId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .specialClinicalCareMappingList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Container( - padding: - EdgeInsets.all(2), - margin: - EdgeInsets.all(2), - decoration: - new BoxDecoration( - color: - Colors.red[800], - borderRadius: - BorderRadius - .circular( - 20), - ), - constraints: - BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: Center( - child: AppText( - model - .specialClinicalCareMappingList - .length - .toString(), - color: - Colors.white, - fontSize: - projectsProvider - .isArabic - ? 10 - : 11, - textAlign: - TextAlign - .center, - ), - )), - ], - ), - AppText(item.description, - fontSize: 12, - color: Colors.black, - fontWeight: - FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (int? newValue) async { - setState(() { - selectedMapId = newValue; - }); - model.clearPatientList(); - GifLoaderDialogUtils.showMyDialog( - context); - - PatientSearchRequestModel requestModel = PatientSearchRequestModel( - nursingStationID: selectedMapId, clinicID: 0); - await model.getInPatientList(requestModel, isLocalBusy: true); - GifLoaderDialogUtils.hideDialog( - context); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } - }, - items: model - .specialClinicalCareMappingList - .map((item) { - return DropdownMenuItem( - child: AppText( - item.description, - textAlign: TextAlign.left, - ), - value: item.nursingStationID, - ); - }).toList(), - )), - ) - ]), - ), - ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), - child: Container( - height: MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll ?? "", - counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, "My InPatients", - counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged ?? ""), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - InPatientPage(false), - InPatientPage(true), - DischargedPatient(), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ), - ); - } - - Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}) { - return Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 411228ed..bd7e3efb 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; @@ -37,7 +39,7 @@ class _InsuranceApprovalScreenNewState extends State ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, projectId: patient.projectId) + appointmentNo: int.parse(patient.appointmentNo.toString()), projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( patientProfileAppBarModel: PatientProfileAppBarModel( @@ -92,11 +94,13 @@ class _InsuranceApprovalScreenNewState extends State Navigator.push( context, MaterialPageRoute( - builder: (context) => InsuranceApprovalsDetails( - patient: patient, - indexInsurance: index, - patientType: patientType, - )), + builder: (context) => InsuranceApprovalsDetails( + patient: patient, + indexInsurance: index, + patientType: patientType, + ), + settings: RouteSettings(name: 'InsuranceApprovalsDetails'), + ), ); }, child: DoctorCardInsurance( @@ -175,15 +179,21 @@ class _InsuranceApprovalScreenNewState extends State model.insuranceApproval.length, (index) => Container( child: InkWell( - onTap: () { + onTap: () async { + await locator().logEvent( + eventCategory: "Insurance Approval Screen New", + eventAction: "Insurance Approval Details", + ); Navigator.push( context, MaterialPageRoute( - builder: (context) => InsuranceApprovalsDetails( - patient: patient, - indexInsurance: index, - patientType: patientType, - )), + builder: (context) => InsuranceApprovalsDetails( + patient: patient, + indexInsurance: index, + patientType: patientType, + ), + settings: RouteSettings(name: 'InsuranceApprovalsDetails'), + ), ); }, child: DoctorCardInsurance( diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index d97678a3..3a7cce7e 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; @@ -77,6 +78,7 @@ class _OutPatientsScreenState extends State { late PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; + bool isSortDes = true; @override Widget build(BuildContext context) { @@ -183,34 +185,19 @@ class _OutPatientsScreenState extends State { ), ), SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( + AppTextFieldCustomSearch( + searchController: _controller, + onChangeFun: (value) { + model.searchData(value); + }, + marginTop: 5, + suffixIcon: IconButton( icon: Icon( _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, - padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 ? null : () { @@ -220,13 +207,26 @@ class _OutPatientsScreenState extends State { builder: (BuildContext context) => FilterDatePage( outPatientFilterType: outPatientFilterType, patientSearchViewModel: model, - ))); - }, + ), + settings: RouteSettings( + name: 'FilterOutPatentDateScreen'), + )); + }, + ), + positionedChild: IconButton( + icon: Icon( + isSortDes + ? FontAwesomeIcons.sortAmountDown + : FontAwesomeIcons.sortAmountUp, + color: Colors.black, + ), + iconSize: 20, + onPressed: () { + model.sortOutPatient(isDes: isSortDes); + isSortDes = !isSortDes; + }, ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + ), SizedBox( height: 10.0, ), diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 956c0d93..de135ff1 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dar import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -77,40 +78,22 @@ class _PatientsSearchResultScreenState extends State body: Column( children: [ SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 10, top: 10), - child: AppText( - TranslationBase.of(context).searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( + AppTextFieldCustomSearch( + searchController: _controller, + onChangeFun: (value) { + model.searchData(value); + }, + marginTop: 5, + suffixIcon: IconButton( icon: Icon( DoctorApp.filter_1, color: Colors.black, ), iconSize: 20, - padding: EdgeInsets.only(bottom: 30), + // padding: EdgeInsets.only(bottom: 30), onPressed: () {}, ), - onChanged: (String str) { - model.searchData(str); - }), - ])), + ), SizedBox( height: 10.0, ), diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index a524a7b9..b61de12a 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -46,44 +47,45 @@ class _PatientSearchScreenState extends State { children: [ BottomSheetTitle(title: TranslationBase.of(context).searchPatient!), FractionallySizedBox( - widthFactor: 0.9, + // widthFactor: 0.9, child: Container( color: Theme.of(context).scaffoldBackgroundColor, - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).patpatientIDMobilenationalientID, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - inputType: TextInputType.number, - hasBorder: true, - controller: patientFileInfoController, - inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], - onChanged: (_) {}, - validationError: (isFormSubmitted && - (patientFileInfoController.text.isEmpty && - firstNameInfoController.text.isEmpty && - middleNameInfoController.text.isEmpty && - lastNameFileInfoController.text.isEmpty)) - ? TranslationBase.of(context).emptyMessage - : null, - ), - ), - SizedBox( - height: 5, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ), - ])), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustomSearch( + searchController: patientFileInfoController, + onChangeFun: (value) {}, + marginTop: 5, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + inputType: TextInputType.number, + validationError: (isFormSubmitted && + (patientFileInfoController.text.isEmpty && + firstNameInfoController + .text.isEmpty && + middleNameInfoController + .text.isEmpty && + lastNameFileInfoController + .text.isEmpty)) + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + ])), ), ], ), @@ -183,6 +185,7 @@ class _PatientSearchScreenState extends State { searchKey: patientFileInfoController.text, isInpatient: false, ), + settings: RouteSettings(name: 'PatientsSearchResultScreen'), ), ); } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 78529f16..e50c6ae1 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -9,48 +9,74 @@ import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../../../routes.dart'; class UcafDetailScreen extends StatefulWidget { + final PatiantInformtion patient; + final UcafViewModel model; + final Function changeLoadingState; + + UcafDetailScreen(this.patient, this.model, {this.changeLoadingState}); + @override - _UcafDetailScreenState createState() => _UcafDetailScreenState(); + _UcafDetailScreenState createState() => _UcafDetailScreenState(this.patient, this.model); } class _UcafDetailScreenState extends State { + + final PatiantInformtion patient; + final UcafViewModel model; + + UcafViewModel ucafModel; + int _activeTap = 0; + _UcafDetailScreenState(this.patient, this.model); + @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + void initState() { + model.saveUCAFOnTap = () async{ + widget.changeLoadingState(true); + await ucafModel.postUCAF(patient); + widget.changeLoadingState(false); + if (ucafModel.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .postUcafSuccessMsg); + Navigator.of(context).popUntil((route) { + return route.settings.name == + PATIENTS_PROFILE; + }); + } else { + DrAppToastMsg.showErrorToast(ucafModel.error); + } + }; + super.initState(); + } + @override + Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - model.resetDataInFirst(); + ucafModel = model; + model.resetDataInFirst(firstPage: false); await model.getLanguage(); await model.getPatientAssessment(patient); + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - - - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - appBarTitle: TranslationBase.of(context).ucaf ?? "", + isShowAppBar: false, body: Column( children: [ Expanded( @@ -59,35 +85,6 @@ class _UcafDetailScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // PatientHeaderWidgetNoAvatar(patient), - Container( - margin: EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).patient}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, - ), - AppText( - "${TranslationBase.of(context).ucaf}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - ) - ], - ), - ), - PageStepperWidget( - stepsCount: 2, - currentStepIndex: 2, - screenSize: screenSize, - ), - SizedBox( - height: 10, - ), Container( margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( @@ -105,60 +102,6 @@ class _UcafDetailScreenState extends State { ), ), ), - Container( - margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), - child: Row( - children: [ - Expanded( - child: Container( - child: AppButton( - title: TranslationBase.of(context).cancel, - hasBorder: true, - vPadding: 8, - hPadding: 8, - borderColor: Colors.white, - color: Colors.white, - fontColor: HexColor("#B8382B"), - fontSize: 2.2, - onPressed: () { - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - }, - ), - ), - ), - SizedBox( - width: 8, - ), - Expanded( - child: Container( - child: AppButton( - title: TranslationBase.of(context).save, - hasBorder: true, - vPadding: 8, - hPadding: 8, - borderColor: HexColor("#B8382B"), - color: HexColor("#B8382B"), - fontColor: Colors.white, - fontSize: 2.0, - onPressed: () async { - await model.postUCAF(patient); - if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - } else { - DrAppToastMsg.showErrorToast(model.error); - } - }, - ), - ), - ), - ], - ), - ), ], ), )); @@ -199,12 +142,18 @@ class _UcafDetailScreenState extends State { onTap: () async { print(__treatmentSteps.indexOf(item)); if (__treatmentSteps.indexOf(item) == 0) { + widget.changeLoadingState(true); await model.getPatientAssessment(patient); + widget.changeLoadingState(false); } else if (__treatmentSteps.indexOf(item) == 1) { + widget.changeLoadingState(true); await model.getPrescription(patient); + widget.changeLoadingState(false); } if (__treatmentSteps.indexOf(item) == 2) { + widget.changeLoadingState(true); await model.getOrderProcedures(patient); + widget.changeLoadingState(false); } setState(() { _activeTap = __treatmentSteps.indexOf(item); @@ -222,8 +171,13 @@ class _UcafDetailScreenState extends State { case 0: if (model.patientAssessmentList != null) { return [ - ...List.generate(model.patientAssessmentList.length, - (index) => DiagnosisWidget(model, model.patientAssessmentList[index])).toList() + ListView.builder(itemCount: model.patientAssessmentList.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return DiagnosisWidget(model, model.patientAssessmentList[index]); + }) ]; } else { return [ @@ -233,15 +187,25 @@ class _UcafDetailScreenState extends State { break; case 1: return [ - ...List.generate(model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, - (index) => MedicationWidget(model, model.prescriptionList!.entityList![index])).toList() + ListView.builder(itemCount:model.prescriptionList != null ? model.prescriptionList!.entityList!.length : 0, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return MedicationWidget(model, model.prescriptionList!.entityList![index]); + }) ]; break; case 2: if (model.orderProcedures != null) { return [ - ...List.generate( - model.orderProcedures.length, (index) => ProceduresWidget(model, model.orderProcedures[index])).toList() + ListView.builder( + itemCount:model.orderProcedures.length, scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return ProceduresWidget(model, model.orderProcedures[index]); + }) ]; } else { return [ @@ -255,6 +219,7 @@ class _UcafDetailScreenState extends State { ]; } } + } class DiagnosisWidget extends StatelessWidget { diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 63faca8e..1d1d549b 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -18,11 +18,20 @@ import 'package:hexcolor/hexcolor.dart'; import '../../../../routes.dart'; class UCAFInputScreen extends StatefulWidget { + final PatiantInformtion patient; + final Function changeLoadingState; + + UCAFInputScreen(this.patient, {this.changeLoadingState}); + @override - _UCAFInputScreenState createState() => _UCAFInputScreenState(); + _UCAFInputScreenState createState() => _UCAFInputScreenState(this.patient); } class _UCAFInputScreenState extends State { + final PatiantInformtion patient; + + _UCAFInputScreenState(this.patient); + bool _inPatient = false; bool _emergencyCase = false; final _durationOfIllnessController = TextEditingController(); @@ -52,21 +61,17 @@ class _UCAFInputScreenState extends State { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - - final screenSize = MediaQuery.of(context).size; - return BaseView( - onModelReady: (model) => model.getUCAFData(patient), + onModelReady: (model) async { + model.resetDataInFirst(); + await model.getUCAFData(patient); + widget.changeLoadingState(false); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - patientProfileAppBarModel: PatientProfileAppBarModel(patient:patient), - appBarTitle: TranslationBase.of(context).ucaf ?? "", - body: model.patientVitalSignsHistory.length > 0 && + isShowAppBar: false, + body: model.patientVitalSignsHistory != null && + model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 ? Column( @@ -77,31 +82,6 @@ class _UCAFInputScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ // PatientHeaderWidgetNoAvatar(patient), - Container( - margin: EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).patient}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, - ), - AppText( - "${TranslationBase.of(context).ucaf}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - ) - ], - ), - ), - PageStepperWidget( - stepsCount: 2, - currentStepIndex: 1, - screenSize: screenSize, - ), Container( margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( @@ -386,20 +366,11 @@ class _UCAFInputScreenState extends State { ), ), ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#D02127"), - onPressed: () { - Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, - arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType}); - }, - ), - ), ], ) - : Center( + : model.patientChiefComplaintList != null || + model.patientVitalSignsHistory != null + ?Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -410,7 +381,7 @@ class _UCAFInputScreenState extends State { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - model.patientVitalSignsHistory.length == 0 + model.patientVitalSignsHistory == null ||model.patientVitalSignsHistory.length == 0 ? TranslationBase.of(context).vitalSignEmptyMsg : TranslationBase.of(context).chiefComplaintEmptyMsg, fontWeight: FontWeight.normal, @@ -421,7 +392,7 @@ class _UCAFInputScreenState extends State { ) ], ), - ), + ): Container(), ), ); } diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 7e25e300..78f7f6db 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -16,8 +16,9 @@ class PageStepperWidget extends StatelessWidget { final int stepsCount; final int currentStepIndex; final Size screenSize; + final List stepsTitles; - PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize}); + PageStepperWidget({required this.stepsCount, required this.currentStepIndex, required this.screenSize, this.stepsTitles}); @override Widget build(BuildContext context) { @@ -32,9 +33,9 @@ class PageStepperWidget extends StatelessWidget { children: [ for (int i = 1; i <= stepsCount; i++) if (i == currentStepIndex) - StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth) + StepWidget(i, true, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) else - StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth) + StepWidget(i, false, i == stepsCount, i < currentStepIndex, dividerWidth, stepsTitles: stepsTitles,) ], ) ], @@ -49,8 +50,9 @@ class StepWidget extends StatelessWidget { final bool isFinalStep; final bool isStepFinish; final double dividerWidth; + final List stepsTitles; - StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth); + StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles}); @override Widget build(BuildContext context) { @@ -110,7 +112,7 @@ class StepWidget extends StatelessWidget { height: 8, ), AppText( - "${TranslationBase.of(context).step} $index", + stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles[index - 1]}", fontWeight: FontWeight.bold, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, fontFamily: 'Poppins', diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart new file mode 100644 index 00000000..87be05b2 --- /dev/null +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -0,0 +1,214 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; +import 'UCAF-detail-screen.dart'; +import 'UCAF-input-screen.dart'; + +class UCAFPagerScreen extends StatefulWidget { + const UCAFPagerScreen({Key? key}) : super(key: key); + + @override + _UCAFPagerScreenState createState() => _UCAFPagerScreenState(); +} + +class _UCAFPagerScreenState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + bool _isLoading = true; + + PatiantInformtion patient; + String patientType; + String arrivalType; + + changePageViewIndex(pageIndex, {isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); + _controller.jumpToPage(pageIndex); + setState(() { + _currentIndex = pageIndex; + }); + } + + void changeLoadingState(bool isLoading) { + setState(() { + _isLoading = isLoading; + }); + } + + @override + void initState() { + _controller = new PageController(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + isLoading: _isLoading, + appBar: PatientProfileAppBar(patient), + appBarTitle: TranslationBase.of(context).ucaf, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // PatientHeaderWidgetNoAvatar(patient), + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).patient}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).ucaf}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + PageStepperWidget( + stepsCount: 2, + currentStepIndex: _currentIndex + 1, + screenSize: screenSize, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UCAFInputScreen( + patient, + changeLoadingState: changeLoadingState, + ), + UcafDetailScreen( + patient, + model, + changeLoadingState: changeLoadingState, + ), + ]), + ), + ), + ], + ), + ), + ), + _isLoading + ? Container( + height: 0, + ) + : ucafButtons(model), + ], + ), + )); + } + + Widget ucafButtons(UcafViewModel model) { + switch (_currentIndex) { + case 0: + return Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: Color(0xFFD02127), + onPressed: () { + changePageViewIndex(1); + // Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: { + // 'patient': patient, + // 'patientType': patientType, + // 'arrivalType': arrivalType + // }); + }, + ), + ); + case 1: + return Container( + margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 8, + hPadding: 8, + borderColor: Colors.white, + color: Colors.white, + fontColor: Color(0xFFB8382B), + fontSize: 2.2, + onPressed: () { + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).save, + hasBorder: true, + vPadding: 8, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () { + model.saveUCAFOnTap(); + }, + ), + ), + ), + ], + ), + ); + default: + return Container(); + } + } +} diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart new file mode 100644 index 00000000..41b8d0ee --- /dev/null +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -0,0 +1,293 @@ +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class AdmissionOrdersScreen extends StatefulWidget { + const AdmissionOrdersScreen({Key? key}) : super(key: key); + + @override + _AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState(); +} + +class _AdmissionOrdersScreenState extends State { + bool isDischargedPatient = false; + + AuthenticationViewModel authenticationViewModel; + + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String arrivalType = routeArgs['arrivalType']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => model.getAdmissionOrders( + admissionNo: 2014005178, patientId: patient.patientMRN), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + //appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.admissionOrderList == null || + model.admissionOrderList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noDataAvailable) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).admission, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.admissionOrderList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy + .toString(), + fontSize: 13, + ), + Expanded( + child: AppText( + model + .admissionOrderList[ + index] + .createdByName + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .procedureName + .toString() + + ": ", + fontSize: 13, + ), + Expanded( + child: AppText( + model + .admissionOrderList[ + index] + .procedureName + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .orderNo + .toString(), + fontSize: 13, + ), + Expanded( + child: AppText( + model + .admissionOrderList[ + index] + .orderNo + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .admissionOrderList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .admissionOrderList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .admissionOrderList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .admissionOrderList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // Expanded( + // child: AppText( + // model + // .admissionOrderList[ + // index] + // .notes, + // fontSize: 10, + // isCopyable: true, + // ), + // ), + // ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 82b9bc1c..c17c36e3 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -1,8 +1,10 @@ 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/admissionRequest/admission-request.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -326,7 +328,11 @@ class _AdmissionRequestThirdScreenState extends State().logEvent( + eventCategory: "Admission Request First Screen", + eventAction: "Go To Admission Request Two", + ); model.admissionRequestData = AdmissionRequest(); if (_selectedClinic != null && _selectedDoctor != null && diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index 9766e3fd..9887ac14 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -2,8 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -239,6 +241,10 @@ class _AdmissionRequestThirdScreenState extends State().logEvent( + eventCategory: "Admission Request Third Screen", + eventAction: "Submit Admission Request", + ); if (_selectedDiagnosis != null && _selectedIcd != null && _selectedDiagnosisType != null) { model.admissionRequestData = admissionRequest; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 0ffc188c..a92912dc 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -3,8 +3,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -408,6 +410,10 @@ class _AdmissionRequestSecondScreenState extends State().logEvent( + eventCategory: "Admission Request Second Screen", + eventAction: "Go To Admission Request Three", + ); if (_estimatedCostController.text != "" && _postPlansEstimatedCostController.text != "" && _expectedDaysController.text != "" && diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart new file mode 100644 index 00000000..1aea89c2 --- /dev/null +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -0,0 +1,255 @@ +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/diabetic_chart/DiabeticType.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import 'diabetic_details_blood_pressurewideget.dart'; + +class DiabeticChart extends StatefulWidget { + DiabeticChart({ + Key key, + }) : super(key: key); + + @override + _DiabeticChartState createState() => _DiabeticChartState(); +} + +class _DiabeticChartState extends State { + List timeSeriesData1 = []; + + List timeSeriesData2 = []; + + List diabeticType = [ + DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1), + DiabeticType(nameAr: "Urine Acet", nameEn: "Urine Acet", value: 2), + DiabeticType(nameAr: "Blood Glucose", nameEn: "Blood Glucose", value: 3), + DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) + ]; + + DiabeticType selectedDiabeticType; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + ProjectViewModel projectsProvider = Provider.of(context); + return BaseView( + onModelReady: (model) async { + selectedDiabeticType = diabeticType[2]; + + await model.getDiabeticChartValues(patient, selectedDiabeticType.value, isLocalBusy: false); + generateData(model); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: SingleChildScrollView( + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.7, + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedDiabeticType.value, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return diabeticType + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: + BorderRadius.circular( + 20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + diabeticType + .length + .toString(), + color: Colors.white, + fontSize: projectsProvider + .isArabic + ? 10 + : 11, + textAlign: + TextAlign.center, + ), + )), + ], + ), + AppText( + selectedDiabeticType.nameEn, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + await onChangeFunc(newValue, model, patient); + setState(() { + + }); + }, + items: diabeticType + .map((item) { + return DropdownMenuItem( + child: AppText( + item.nameEn, + textAlign: TextAlign.left, + ), + value: item.value, + ); + }).toList(), + )), + ), + timeSeriesData1.length != 0 || timeSeriesData2.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: LineChartForDiabetic( + title: selectedDiabeticType.nameEn, + isOX: false, + timeSeries1: timeSeriesData1, + // timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + ), + Container( + margin: EdgeInsets.symmetric( + horizontal: 8, vertical: 16), + padding: EdgeInsets.only( + top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.3, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + DiabeticDetails( + diabeticDetailsList: + model.diabeticChartValuesList, + ), + ], + ), + ), + ], + ), + ) + : ErrorMessage(error: TranslationBase.of(context).noItem), + ], + ), + )), + ); + } + + generateData(PatientViewModel model) { + if (model.diabeticChartValuesList.length > 0) { + model.diabeticChartValuesList.toList().forEach( + (element) { + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(element.dateChart); + if (element.resultValue.toInt() != 0) + timeSeriesData1.add( + TimeSeriesSales2( + new DateTime( + elementDate.year, elementDate.month, elementDate.day), + element.resultValue.toDouble(), + ), + ); + if (element.resultValue.toInt() != 0) + timeSeriesData2.add( + TimeSeriesSales2( + new DateTime( + elementDate.year, elementDate.month, elementDate.day), + element.resultValue.toDouble(), + ), + ); + }, + ); + } + } + + onChangeFunc(newValue, PatientViewModel model, patient) async { + GifLoaderDialogUtils.showMyDialog(context); + setState(() { + selectedDiabeticType = diabeticType[newValue-1]; + timeSeriesData1.clear(); + timeSeriesData2.clear(); + }); + + await model.getDiabeticChartValues(patient, selectedDiabeticType.value,isLocalBusy:true); + if(model.state == ViewState.ErrorLocal){ + Helpers.showErrorToast(model.error); + } + generateData(model); + GifLoaderDialogUtils.hideDialog(context); + + + + + } +} diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart new file mode 100644 index 00000000..c68f848f --- /dev/null +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -0,0 +1,123 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class DiabeticDetails extends StatefulWidget { + final List diabeticDetailsList; + + DiabeticDetails( + {Key? key, this.diabeticDetailsList,}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(0), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + child: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + + fontFamily: 'Poppins', + ), + // height: 60, + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + child: AppText( + "Result", + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ), + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), + Table( + border: TableBorder( + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + widget.diabeticDetailsList.forEach((diabetic) { + var data = diabetic.resultValue; + DateTime elementDate = + AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart); + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: AppText( + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(elementDate.weekday) : AppDateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(elementDate.month) : AppDateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${AppDateUtils.getHour(elementDate)}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + + fontFamily: 'Poppins', + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: AppText( + '${diabetic.resultValue}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + + fontFamily: 'Poppins', + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart new file mode 100644 index 00000000..1159e970 --- /dev/null +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -0,0 +1,237 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartForDiabetic extends StatelessWidget { + final String title; + final List timeSeries1; + final int indexes; + final bool isOX; + + LineChartForDiabetic( + {this.title, this.timeSeries1, this.indexes, this.isOX= false}); + + List xAxixs = []; + List yAxixs = []; + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Container( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textAlign: TextAlign.center, + ), + ], + ), + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + //rotateAngle:-65, + interval: 100, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = []; + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = []; + // for (int index = 0; index < timeSeries2.length; index++) { + // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + // } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Colors.red], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + List lineChartData = []; + if(spots.isNotEmpty){ + lineChartData.add(lineChartBarData1); + } + if(spots2.isNotEmpty){ + lineChartData.add(lineChartBarData2); + } + return lineChartData; + } +} diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart new file mode 100644 index 00000000..caa7421b --- /dev/null +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -0,0 +1,265 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class DiagnosisScreen extends StatefulWidget { + const DiagnosisScreen({Key? key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + getDiagnosisForInPatient(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + + print(type); + GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = + GetDiagnosisForInPatientRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); + model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); + } + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => getDiagnosisForInPatient(context, model), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.diagnosisForInPatientList == null || + model.diagnosisForInPatientList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noItem) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: + model.diagnosisForInPatientList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 12, + ), + Expanded( + child: AppText( + model + .diagnosisForInPatientList[ + index] + .createdByName + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .diagnosisForInPatientList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .diagnosisForInPatientList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .diagnosisForInPatientList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .diagnosisForInPatientList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of( + context) + .icd + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .diagnosisForInPatientList[ + index] + .iCDCode10ID, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText("Ascii Desc : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .diagnosisForInPatientList[ + index] + .asciiDesc, + fontSize: 12, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart new file mode 100644 index 00000000..73317d8d --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -0,0 +1,67 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +import 'discharge_Summary_widget.dart'; + + +class AllDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; + + const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key); + + @override + _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); +} + +class _AllDischargeSummaryState extends State { + + int pageIndex = 1; + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getPendingDischargeSummary(); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: model.pendingDischargeSummaryList.isEmpty + ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.pendingDischargeSummaryList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DischargeSummaryWidget( + dischargeSummary: model + .pendingDischargeSummaryList[index]), + ), + + ], + ); + }), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart new file mode 100644 index 00000000..8d5b02ae --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -0,0 +1,171 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class DischargeSummaryWidget extends StatefulWidget { + final GetDischargeSummaryResModel dischargeSummary; + bool isShowMore = false; + + DischargeSummaryWidget({Key? key, this.dischargeSummary}); + + @override + _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); +} + +class _DischargeSummaryWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return Container( + child: CardWithBgWidget( + bgColor:Colors.transparent, + hasBorder: false, + widget: Container( + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + AppDateUtils.getDateTimeFromServerFormat( + widget.dischargeSummary.createdOn) + .day + .toString() + + " " + + AppDateUtils.getMonth( + AppDateUtils.getDateTimeFromServerFormat( + widget.dischargeSummary.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + AppDateUtils.getDateTimeFromServerFormat( + widget.dischargeSummary.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + AppText( + AppDateUtils.getDateTimeFromServerFormat( + widget.dischargeSummary.createdOn) + .hour + .toString() + + ":" + + AppDateUtils.getDateTimeFromServerFormat( + widget.dischargeSummary.createdOn) + .minute + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + ], + ), + SizedBox( + height: 20, + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of(context).fileNumber, + value: widget.dischargeSummary.patientID.toString(), + isCopyable:false, + ), + SizedBox( + height: 8, + ), + ], + ), + ], + ), + + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: + TranslationBase.of(context).requestType + + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: + "${widget.dischargeSummary.dischargeInstructions}", + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), + ), + ), + ], + ) + ], + ), + // Container( + // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // child: Icon(FontAwesomeIcons.arrowRight, + // size: 20, color: Colors.black),) + ], + ), + // onTap: onTap, + )), + ), + ); + } +} diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart new file mode 100644 index 00000000..3bcd673a --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -0,0 +1,187 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'all_discharge_summary.dart'; +import 'pending_discharge_summary.dart'; + +class DischargeSummaryPage extends StatefulWidget { + final Function changeCurrentTab; + + const DischargeSummaryPage({Key? key, this.changeCurrentTab}) : super(key: key); + + @override + _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); +} + +class _DoctorReplyScreenState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + int _activeTab = 0; + int pageIndex = 1; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + setState(() { + _activeTab = _tabController.index; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return WillPopScope( + onWillPop: () async { + widget.changeCurrentTab(); + return false; + }, + child: AppScaffold( + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: true, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Scaffold( + extendBodyBehindAppBar: false, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + "Pending", + ), + tabWidget( + screenSize, + _activeTab == 1, + TranslationBase.of(context).all, + ), + ], + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PendingDischargeSummary(patient:patient ,), + AllDischargeSummary(), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } +} + +Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { + return Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.5, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], + ), + ), + ); +} diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart new file mode 100644 index 00000000..317eeb4d --- /dev/null +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -0,0 +1,75 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +import 'discharge_Summary_widget.dart'; + +class PendingDischargeSummary extends StatefulWidget { + final Function changeCurrentTab; + final PatiantInformtion patient; + + const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient}) + : super(key: key); + + @override + _PendingDischargeSummaryState createState() => + _PendingDischargeSummaryState(); +} + +class _PendingDischargeSummaryState extends State { + int pageIndex = 1; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getPendingDischargeSummary( + patientId: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), + + ); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: model.pendingDischargeSummaryList.isEmpty + ? ErrorMessage( + error: TranslationBase.of(context) + .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.pendingDischargeSummaryList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DischargeSummaryWidget( + dischargeSummary: model + .pendingDischargeSummaryList[index]), + ), + ], + ); + }), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index d125336a..3bf6929b 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -10,6 +10,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'lab_result_history_chart_and_detials.dart'; import 'lab_result_chart_and_detials.dart'; class FlowChartPage extends StatelessWidget { @@ -19,46 +20,56 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); + {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, patient: patient), + onModelReady: (model) => model.getPatientLabResultHistoryByDescription( + patientLabOrder: patientLabOrder, + procedureDescription: filterName, + patient: patient), + // onModelReady: (model) => model.getPatientLabOrdersResults( + // patientLabOrder: patientLabOrder, + // procedure: filterName, + // patient: patient), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, baseViewModel: model, - body: model.labOrdersResultsList.isNotEmpty + body: model.labOrdersResultHistoryList.isNotEmpty ? SingleChildScrollView( - child: Container( - child: LabResultChartAndDetails( - name: filterName, - labResult: model.labOrdersResultsList, - ), - ), - ) + child: Container( + child: LabResultHistoryChartAndDetails( + name: filterName, + labResultHistory: model.labOrdersResultHistoryList, + ), + // child: LabResultChartAndDetails( + // name: filterName, + // labResult: model.labOrdersResultsList, + // ), + ), + ) : Container( - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, ), - ), - ), + ) + ], + ), + ), + ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart new file mode 100644 index 00000000..118bc476 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -0,0 +1,141 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +class LabResultHistoryPage extends StatelessWidget { + final PatientLabOrders patientLabOrder; + final String filterName; + final PatiantInformtion patient; + + LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); +// TODO mosa UI changes + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientLabResultHistoryByDescription( + patientLabOrder: patientLabOrder, + procedureDescription: filterName, + patient: patient), + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: filterName, + baseViewModel: model, + body: model.labOrdersResultHistoryList.length > 0 + ? SingleChildScrollView( + child: Column( + children: [ + ...List.generate(model.labOrdersResultHistoryList.length, + (index) { + return Container( + margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).description, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + model.labOrdersResultHistoryList[index].description, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ), + Row( + children: [ + AppText( + "Reference Range", + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + model.labOrdersResultHistoryList[index].referanceRange, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ), + Row( + children: [ + AppText( + "Result Value", + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + model.labOrdersResultHistoryList[index].resultValue, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ), + Row( + children: [ + AppText( + "Verified On", + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + model.labOrdersResultHistoryList[index].verifiedOn, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ), + Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + SizedBox( + height: 10, + ), + ], + ), + ); + }), + ], + ), + ) + : ErrorMessage( + error: "No data", + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index fd07bc07..67e50e53 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -10,6 +11,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'LabResultHistoryPage.dart'; + class LabResultWidget extends StatelessWidget { final String filterName; final List patientLabResultList; @@ -40,28 +43,38 @@ class LabResultWidget extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - isInpatient: isInpatient, - ), - ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, - ), + Row( + children: [ + AppText( + filterName, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w700, + ), + ], ), + //InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: FlowChartPage( + // filterName: filterName, + // patientLabOrder: patientLabOrder, + // patient: patient, + // isInpatient: isInpatient, + // ), + // ), + // ); + // }, + // // child: AppText( + // // TranslationBase.of(context).showMoreBtn, + // // textDecoration: TextDecoration.underline, + // // color: Colors.blue, + // // ), + //), ], + ),SizedBox( + height: 8, ), Row( children: [ @@ -71,7 +84,8 @@ class LabResultWidget extends StatelessWidget { child: AppText( TranslationBase.of(context).description, color: Colors.black, - bold: true, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w700, ), ), ), @@ -82,7 +96,8 @@ class LabResultWidget extends StatelessWidget { child: AppText( TranslationBase.of(context).value, color: Colors.black, - bold: true, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w700, ), ), ), @@ -92,73 +107,160 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( TranslationBase.of(context).range, - color: Colors.black, - bold: true, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w700, ), ), ), + ), + Expanded( + child: Container(), ) ], ), - SizedBox( - height: 7, - ), Divider( - color: Colors.black, + color: Colors.grey.shade500, thickness: 1, ), SizedBox( height: 12, ), - ...List.generate( - patientLabResultList.length, - (index) => Column( - children: [ - Row( + ListView.builder( + itemCount: patientLabResultList.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Color(0X55F2F2F2), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + ), + child: Row( children: [ Expanded( child: Container( padding: EdgeInsets.all(10), - color: Colors.white, child: Center( child: AppText( - '${patientLabResultList[index].testCode}\n' + - patientLabResultList[index].description!, + /*'${patientLabResultList[index].testCode}\n' +*/ + patientLabResultList[index].description!, textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + isCopyable: true, ), ), ), ), Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: AppText( - patientLabResultList[index].resultValue ?? + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if(patientLabResultList[index].checkResultStatus() != 0) + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red.shade700, + // borderRadius: BorderRadius.all( + // Radius.circular(25.0), + // ), + ), + child: Icon( + patientLabResultList[index].checkResultStatus() == 1 ? Icons.arrow_upward : Icons.arrow_downward, + color: Colors.white, + size: 16, + ), + ), + Expanded( + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + vertical: 10, horizontal: 4), + child: Center( + child: AppText( + patientLabResultList[index].resultValue ?? + "" + " " + "${patientLabResultList[index].uOM ?? ""}", - textAlign: TextAlign.center, + textAlign: TextAlign.center, + isCopyable: true, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + ), + ), ), - ), + ], ), ), Expanded( child: Container( padding: EdgeInsets.all(10), - color: Colors.white, + // color: Colors.white, child: Center( child: AppText( patientLabResultList[index].referanceRange, textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + isCopyable: true, + ), + ), + ), + ), + Expanded( + child: Container( + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: + patientLabResultList[index].description, + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient, + ), + // page: LabResultHistoryPage( + // filterName: patientLabResultList[index].description, + // patientLabOrder: patientLabOrder, + // patient: patient, + // ), + ), + ); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.red.shade700, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w700, + ), + ], ), ), ), ), ], ), - Divider(), - ], - )) + ), + SizedBox( + height: 16, + ), + ], + ); + }), + SizedBox( + height: 8, + ), + Divider(), // Table( // border: TableBorder.symmetric( // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart new file mode 100644 index 00000000..490d0ec4 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -0,0 +1,116 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class LabResultHistoryDetailsWidget extends StatefulWidget { + final List labResultHistory; + + LabResultHistoryDetailsWidget({ + this.labResultHistory, + }); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + /* decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ),*/ + margin: EdgeInsets.all(0), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + child: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + child: AppText( + TranslationBase.of(context).labResult, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.bold, + ), + // height: 60 + ), + ), + ) + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 1.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + widget.labResultHistory.forEach((vital) { + var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime); + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(8), + color: Colors.white, + child: AppText( + '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(8), + color: Colors.white, + child: AppText( + '${vital.resultValue}', + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + ), + ), + ), + ])); + }); + return tableRow; + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart new file mode 100644 index 00000000..e0d0323b --- /dev/null +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -0,0 +1,231 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurvedLabHistory extends StatefulWidget { + final String title; + final List labResultHistory; + + LineChartCurvedLabHistory({this.title, this.labResultHistory}); + + @override + State createState() => LineChartCurvedLabHistoryState(); +} + +class LineChartCurvedLabHistoryState extends State { + bool isShowingMainData; + List xAxixs = []; + int indexes = 0; + + @override + void initState() { + super.initState(); + getXaxix(); + isShowingMainData = true; + } + + getXaxix() { + indexes = widget.labResultHistory.length ~/ 3.5; + for (int index = 0; index < widget.labResultHistory.length; index++) { + int mIndex = indexes * index; + if (mIndex < widget.labResultHistory.length) { + xAxixs.add(mIndex); + } + } + } + + @override + Widget build(BuildContext context) { + return AspectRatio( + aspectRatio: 1.23, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + AppText( + widget.title, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textAlign: TextAlign.center, + ), + const SizedBox( + height: 12, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 16.0, left: 8.0), + child: LineChart( + sampleData1(), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + LineChartData sampleData1() { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 11, + ), + margin: 28, + rotateAngle: -65, + getTitles: (value) { + print(value); + DateTime date = AppDateUtils.convertStringToDate( + widget.labResultHistory[value.toInt()].verifiedOnDateTime); + if (widget.labResultHistory.length < 8) { + if (widget.labResultHistory.length > value.toInt()) { + return '${date.day}/ ${date.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResultHistory.length - 1) + return '${date.day}/ ${date.year}'; + if (xAxixs.contains(value.toInt())) { + return '${date.day}/ ${date.year}'; + } + } + + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 8, + //reservedSize: 30, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (widget.labResultHistory.length - 1).toDouble(), + maxY: getMaxY() + 2, + minY: getMinY(), + lineBarsData: getData(), + ); + } + + double getMaxY() { + double max = 0; + widget.labResultHistory.forEach((element) { + try { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble; + } catch (e) { + print(e); + } + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = 0; + try { + min = double.parse(widget.labResultHistory[0].resultValue); + + widget.labResultHistory.forEach((element) { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble < min) min = resultValueDouble; + }); + } catch (e) { + print(e); + } + int value = min.toInt(); + + return value.toDouble(); + } + + List getData() { + List spots = []; + for (int index = 0; index < widget.labResultHistory.length; index++) { + try { + var resultValueDouble = + double.parse(widget.labResultHistory[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } catch (e) { + print(e); + spots.add(FlSpot(index.toDouble(), 0.0)); + } + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 3, + isStrokeCapRound: true, + curveSmoothness: 0.12, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart new file mode 100644 index 00000000..4393b26f --- /dev/null +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -0,0 +1,213 @@ +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class AllLabSpecialResult extends StatefulWidget { + const AllLabSpecialResult({Key? key}) : super(key: key); + + @override + _AllLabSpecialResultState createState() => _AllLabSpecialResultState(); +} + +class _AllLabSpecialResultState extends State { + String patientType; + + String arrivalType; + PatiantInformtion patient; + bool isInpatient; + bool isFromLiveCare; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + isInpatient = routeArgs['isInpatient']; + isFromLiveCare = routeArgs['isFromLiveCare']; + + print(arrivalType); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => + model.getAllSpecialLabResult(patientId: patient.patientMRN), + builder: (context, LabsViewModel model, widget) => AppScaffold( + baseViewModel: model, + backgroundColor: Colors.grey[100], + isShowAppBar: true, + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).special + + " " + + TranslationBase.of(context).lab, + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + TranslationBase.of(context).result, + bold: true, + fontSize: 22, + ), + ], + ), + ), + ListView.builder( + physics: NeverScrollableScrollPhysics(), + itemCount: model.allSpecialLabList.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + color: model.allSpecialLabList[index] + .isLiveCareAppointment + ? Colors.red[900] + : !model.allSpecialLabList[index] + .isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + topRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0)), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.allSpecialLabList[index] + .isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.allSpecialLabList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: SpecialLabResultDetailsPage( + resultData: model.allSpecialLabList[index] + .resultDataHTML, + patient: patient, + ), + ), + ), + doctorName: + model.allSpecialLabList[index].doctorName, + invoiceNO: + ' ${model.allSpecialLabList[index].invoiceNo}', + profileUrl: model + .allSpecialLabList[index].doctorImageURL, + branch: + model.allSpecialLabList[index].projectName, + clinic: model + .allSpecialLabList[index].clinicDescription, + appointmentDate: + AppDateUtils.getDateTimeFromServerFormat( + model.allSpecialLabList[index].createdOn, + ), + orderNo: model.allSpecialLabList[index].orderNo, + isShowTime: false, + ), + ), + ], + ), + ); + }), + if (model.allSpecialLabList.isEmpty && + patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Lab Result Found'), + ) + ], + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 26018768..371cabec 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'Lab_Result_details_wideget.dart'; import 'LineChartCurved.dart'; +import 'Lab_Result_details_wideget.dart'; class LabResultChartAndDetails extends StatelessWidget { LabResultChartAndDetails({ diff --git a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart new file mode 100644 index 00000000..322eb817 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart @@ -0,0 +1,62 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +import 'Lab_Result_history_details_wideget.dart'; +import 'LineChartCurvedLabHistory.dart'; + +class LabResultHistoryChartAndDetails extends StatelessWidget { + LabResultHistoryChartAndDetails({ + Key key, + @required this.labResultHistory, + @required this.name, + }) : super(key: key); + + final List labResultHistory; + final String name; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: LineChartCurvedLabHistory( + title: name, + labResultHistory: labResultHistory, + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).graphDetails, + fontSize: SizeConfig.textMultiplier * 2.1, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 8, + ), + LabResultHistoryDetailsWidget( + labResultHistory: labResultHistory.reversed.toList(), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index d807ba54..ee220b06 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -46,19 +46,15 @@ class _LaboratoryResultPageState extends State { body: AppScaffold( isShowAppBar: false, body: SingleChildScrollView( - child: Column( - children: [ - LaboratoryResultWidget( - onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo!, + child: LaboratoryResultWidget( + onTap: () async {}, + billNo: widget.patientLabOrders.invoiceNo!, details: model.patientLabSpecialResult.length > 0 ? model.patientLabSpecialResult[0].resultDataHTML : null, orderNo: widget.patientLabOrders.orderNo!, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: widget.patientType == "1", - ), - ], + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + isInpatient: widget.patientType == "1", ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 67d0c63b..54d894b6 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResult import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -83,15 +85,16 @@ class _LaboratoryResultWidgetState extends State { color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(5.0), - )), + ),), child: Row( children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(left: 0, right: 0), child: AppText( TranslationBase.of(context).generalResult, - bold: true, + fontSize: SizeConfig.textMultiplier * 2.3, + bold: false, ))), Container( width: 25, @@ -124,22 +127,32 @@ class _LaboratoryResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ...List.generate( - model.labResultLists.length, - (index) => LabResultWidget( + ListView.builder( + itemCount: model.labResultLists.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return LabResultWidget( patientLabOrder: widget.patientLabOrder, filterName: model.labResultLists[index].filterName, patientLabResultList: model.labResultLists[index].patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, - ), - ) + ); + }), ], ), ), ), ], ), + ) + else if (widget.details == null) + Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), ), SizedBox( height: 15, @@ -166,10 +179,11 @@ class _LaboratoryResultWidgetState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.only(left: 0, right: 0), child: AppText( TranslationBase.of(context).specialResult, - bold: true, + fontSize: SizeConfig.textMultiplier * 2.3, + bold: false, ))), Container( width: 25, diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 8d233825..d600f7c2 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -28,7 +29,6 @@ class _LabsHomePageState extends State { late PatiantInformtion patient; late bool isInpatient; late bool isFromLiveCare; - @override void didChangeDependencies() { super.didChangeDependencies(); @@ -115,6 +115,7 @@ class _LabsHomePageState extends State { model: model, procedureType: ProcedureType.LAB_RESULT, ), + settings: RouteSettings(name: 'AddProcedureTabPage'), ), ); }, @@ -133,11 +134,15 @@ class _LabsHomePageState extends State { Radius.circular(8.0), ), color: Colors.white), - child: Row( + child: Stack( children: [ - Container( - width: 20, - height: 160, + Positioned( + bottom: 1, + top: 1, + left: 1, + child: Container( + width: 20, + decoration: BoxDecoration( color: model.patientLabOrdersList[index].isLiveCareAppointment! ? Colors.red[900] @@ -159,11 +164,15 @@ class _LabsHomePageState extends State { : !model.patientLabOrdersList[index].isInOutPatient! ? TranslationBase.of(context).inPatientLabel!.toUpperCase() : TranslationBase.of(context).outpatient!.toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), + style: TextStyle(color: Colors.white), + ), + )), + ), ), - Expanded( + Container( + color: Colors.white, + padding: EdgeInsets.all(0), + margin: EdgeInsets.only(left: 20), child: DoctorCard( isNoMargin: true, onTap: () => Navigator.push( diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart new file mode 100644 index 00000000..9a20209a --- /dev/null +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -0,0 +1,83 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; + +class SpecialLabResultDetailsPage extends StatelessWidget { + final String resultData; + final PatiantInformtion patient; + + const SpecialLabResultDetailsPage({Key? key, this.resultData, this.patient}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + ), + body: Container( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Special Lab ", + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + ), + AppText( + "Result", + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + ) + ], + ), + ), + resultData != null + ? Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.white, + width: 1.0, + ), + ), + ), + child: Html(data: resultData ?? ""), + ) + : Container( + child: ErrorMessage( + error: "No Data", + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index b898f849..3f35fd80 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -1,12 +1,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/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/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -14,9 +12,27 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/html_rich_editor.d import 'package:flutter/material.dart'; import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:provider/provider.dart'; class AddVerifyMedicalReport extends StatefulWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final MedicalReportModel medicalReport; + final PatientMedicalReportViewModel model; + final MedicalReportStatus status; + final String medicalNote; + + const AddVerifyMedicalReport( + {Key? key, + this.patient, + this.patientType, + this.arrivalType, + this.medicalReport, + this.model, + this.status, + this.medicalNote}) + : super(key: key); + @override _AddVerifyMedicalReportState createState() => _AddVerifyMedicalReportState(); } @@ -25,110 +41,123 @@ class _AddVerifyMedicalReportState extends State { HtmlEditorController _controller = HtmlEditorController(); @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - MedicalReportStatus status = routeArgs['status']; - MedicalReportModel medicalReport = routeArgs.containsKey("medicalReport") ? routeArgs['medicalReport'] : null; + String txtOfMedicalReport; return BaseView( - onModelReady: (model) => model.getMedicalReportTemplate(), + onModelReady: (model) async { + model.getMedicalReportTemplate(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: status == MedicalReportStatus.ADD + appBarTitle: widget.status == MedicalReportStatus.ADD ? TranslationBase.of(context).medicalReportAdd! : TranslationBase.of(context).medicalReportVerify!, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: model.state == ViewState.BusyLocal - ? AppLoaderWidget() - : Column( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(16), - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // if (model.medicalReportTemplate.length > 0) - HtmlRichEditor( - initialText: (medicalReport != null - ? medicalReport.reportDataHtml - : model.medicalReportTemplate.length > 0 - ? model.medicalReportTemplate[0].templateTextHtml! - : ""), - hint: "Write the medical report ", - controller: _controller, - height: MediaQuery.of(context).size.height * 0.75, - ), - ], + body: Column( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(16), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.medicalReportTemplate.length > 0) + HtmlRichEditor( + initialText: (widget.medicalReport != null + ? widget.medicalNote + : widget.model.medicalReportTemplate[0].templateText.length > 0 + ? widget.model.medicalReportTemplate[0].templateText + : ""), + hint: "Write the medical report ", + height: MediaQuery.of(context).size.height * 0.75, ), - ), - ), + ], ), - ], + ), ), ), - ), - Container( - padding: EdgeInsets.all(16.0), - color: Colors.white, - child: Row( - children: [ - Expanded( - child: AppButton( - title: status == MedicalReportStatus.ADD - ? TranslationBase.of(context).save - : TranslationBase.of(context).save, - color: Color(0xffEAEAEA), - fontColor: Colors.black, - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - String txtOfMedicalReport = await _controller.getText(); + ], + ), + ), + ), + Container( + padding: EdgeInsets.all(16.0), + color: Colors.white, + child: Row( + children: [ + Expanded( + child: AppButton( + title: widget.status == MedicalReportStatus.ADD + ? TranslationBase.of(context).save + : TranslationBase.of(context).save, + color: Color(0xffEAEAEA), + fontColor: Colors.black, + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + txtOfMedicalReport = await HtmlEditor.getText(); - if (txtOfMedicalReport.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await model.insertMedicalReport(patient, txtOfMedicalReport); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - } - }, - ), - ), - SizedBox( - width: 8, - ), - if (medicalReport != null) - Expanded( - child: AppButton( - title: status == MedicalReportStatus.ADD - ? TranslationBase.of(context).add - : TranslationBase.of(context).verify, - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.verifyMedicalReport(patient, medicalReport); - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } - }, - ), - ), - ], + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + widget.medicalReport != null + ?await widget.model.updateMedicalReport( + widget.patient, + txtOfMedicalReport, + widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, + widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) + : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); + //model.getMedicalReportList(patient); + + Navigator.pop(context); + + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); + } + } else { + DrAppToastMsg.showErrorToast("Please enter medical note"); + } + }, ), ), + SizedBox( + width: 8, + ), + if (widget.medicalReport != null) + Expanded( + child: AppButton( + title: widget.status == MedicalReportStatus.ADD + ? TranslationBase.of(context).add + : TranslationBase.of(context).verify, + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + txtOfMedicalReport = await HtmlEditor.getText(); + if (txtOfMedicalReport.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); + GifLoaderDialogUtils.hideDialog(context); + Navigator.pop(context); + if (widget.model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(widget.model.error); + } + } else { + DrAppToastMsg.showErrorToast("Please enter medical note"); + } + }, + ), + ), ], ), + ), + ], + ), )); } diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 47ab7ac1..e0155547 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -23,7 +25,12 @@ import 'package:provider/provider.dart'; import '../../../../routes.dart'; import 'AddVerifyMedicalReport.dart'; -class MedicalReportPage extends StatelessWidget { +class MedicalReportPage extends StatefulWidget { + @override + _MedicalReportPageState createState() => _MedicalReportPageState(); +} + +class _MedicalReportPageState extends State { @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; @@ -35,9 +42,7 @@ class MedicalReportPage extends StatelessWidget { return BaseView( onModelReady: (model) async { await model.getMedicalReportList(patient); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } + await model.getMedicalReportTemplate(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -71,48 +76,63 @@ class MedicalReportPage extends StatelessWidget { ), ), AddNewOrder( - onTap: () { - if (model.hasOnHold()) { - Helpers.showErrorToast( - "Please Verified the on hold report to be able to add new one"); - } else {Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD - });} + onTap: () async { + // if (model.hasOnHold()) { + // Helpers.showErrorToast("Please Verified the on hold report to be able to add new one"); + // } else + await locator().logEvent( + eventCategory: "Medical Report Page", + eventAction: "Add New Medical Report", + );Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddVerifyMedicalReport( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + model: model, + status: MedicalReportStatus.ADD, + ), + settings: RouteSettings(name: 'AddVerifyMedicalReport'), + ), + ); }, label: TranslationBase.of(context).createNewMedicalReport!, ), - if (model.state != ViewState.ErrorLocal) - ...List.generate( - model.medicalReportList.length, - (index) => InkWell( - onTap: () { - if (model.medicalReportList[index].status == 1) { - Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'medicalReport': model.medicalReportList[index] - }); + // if (model.state != ViewState.ErrorLocal)ß + ...List.generate( + model.medicalReportList.length, + (index) => InkWell( + onTap: () { + if (model.medicalReportList[index].status == 1) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddVerifyMedicalReport( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + medicalReport: model.medicalReportList[index], + model: model, + medicalNote: model.medicalReportList[index].reportDataHtml, + ), + settings: RouteSettings(name: 'AddVerifyMedicalReport')),); } else { Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_DETAIL, arguments: { 'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'type': MedicalReportStatus.ADD, - 'medicalReport': model.medicalReportList[index] - }); - } - }, - child: Container( - margin: EdgeInsets.symmetric(horizontal: 8), - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 - ? Color(0xFFCC9B14) - : Colors.green[700]!, + 'medicalReport': model.medicalReportList[index], + 'model': model, + }); + } + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 8), + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.medicalReportList[index].status == 1 ? Color(0xFFCC9B14) : Colors.green[700]!, widget: Column( children: [ Row( @@ -133,8 +153,8 @@ class MedicalReportPage extends StatelessWidget { ), AppText( projectViewModel.isArabic - ? model.medicalReportList[index].doctorNameN - : model.medicalReportList[index].doctorName, + ? model.medicalReportList[index].doctorNameN?? "" + : model.medicalReportList[index].doctorName?? "", fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart similarity index 70% rename from lib/screens/patients/profile/note/progress_note_screen.dart rename to lib/screens/patients/profile/notes/note/progress_note_screen.dart index bcf09283..9fae26f4 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -1,16 +1,23 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/note/update_note.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -19,11 +26,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; -import '../../../../config/shared_pref_kay.dart'; -import '../../../../models/patient/patiant_info_model.dart'; -import '../../../../util/dr_app_shared_pref.dart'; -import '../../../../widgets/shared/app_scaffold_widget.dart'; -import '../../../../widgets/shared/app_texts_widget.dart'; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -76,107 +79,165 @@ class _ProgressNoteState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, isInpatient: true, ), - body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 - ? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoProgressNote ?? "") + body: model.patientProgressNoteList == null || + model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) : Container( color: Colors.grey[200], child: Column( children: [ if (!isDischargedPatient) - // AddNewOrder( - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => UpdateNoteOrder( - // patientModel: model, - // patient: patient, - // visitType: widget.visitType, - // isUpdate: false, - // )), - // ); - // }, - // label: widget.visitType == 3 - // ? TranslationBase.of(context).addNewOrderSheet! - // : TranslationBase.of(context).addProgressNote!, - // ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != - model.patientProgressNoteList[index].createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index].status == 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index].status == 2 - ? Colors.green[600]! - : Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (model.patientProgressNoteList[index].status == 1 && - authenticationViewModel.doctorProfile!.doctorID != - model.patientProgressNoteList[index].createdBy) - AppText( - TranslationBase.of(context).notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status == 4) - AppText( - TranslationBase.of(context).noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status == 2) - AppText( - TranslationBase.of(context).noteVerified, - fontWeight: FontWeight.bold, - color: Colors.green[600], - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status != 2 && - model.patientProgressNoteList[index].status != 4 && - authenticationViewModel.doctorProfile!.doctorID == - model.patientProgressNoteList[index].createdBy) - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - note: model.patientProgressNoteList[index], - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - // color:Colors.red[600], + AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Progress Note Screen", + eventAction: "Update Progress Note", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + ), + settings: RouteSettings(name: 'UpdateNoteOrder'), + ), + ); + }, + label: widget.visitType == 3 + ? TranslationBase.of(context).addNewOrderSheet + : TranslationBase.of(context).addProgressNote, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authenticationViewModel + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index] + .status == + 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index] + .status == + 2 + ? Colors.green[600] + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authenticationViewModel + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + + TranslationBase.of(context) + .notePending, + + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + TranslationBase.of(context) + .noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + TranslationBase.of(context) + .noteVerified, + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authenticationViewModel + .doctorProfile.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], child: Row( children: [ @@ -337,7 +398,7 @@ class _ProgressNoteState extends State { model.patientProgressNoteList[index].doctorName ?? '', fontWeight: FontWeight.w600, fontSize: 12, - ), + isCopyable:true,), ), ], ), @@ -351,12 +412,12 @@ class _ProgressNoteState extends State { ? AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDateTimeFromServerFormat( model.patientProgressNoteList[index].createdOn ?? ""), - isArabic: projectViewModel.isArabic) - : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), + isArabic: projectViewModel.isArabic, + isMonthShort: true): AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, fontSize: 14, - ), + isCopyable:true,), AppText( model.patientProgressNoteList[index].createdOn != null ? AppDateUtils.getHour( @@ -364,7 +425,7 @@ class _ProgressNoteState extends State { model.patientProgressNoteList[index].createdOn ?? "")) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, - fontSize: 14, + fontSize: 14,isCopyable:true, ), ], crossAxisAlignment: CrossAxisAlignment.end, @@ -378,7 +439,7 @@ class _ProgressNoteState extends State { Expanded( child: AppText( model.patientProgressNoteList[index].notes, - fontSize: 10, + fontSize: 10,isCopyable:true, ), ), ]) diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart similarity index 100% rename from lib/screens/patients/profile/note/update_note.dart rename to lib/screens/patients/profile/notes/note/update_note.dart diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart new file mode 100644 index 00000000..50d76dfb --- /dev/null +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -0,0 +1,240 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class NursingProgressNoteScreen extends StatefulWidget { + const NursingProgressNoteScreen({Key? key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + List notesList; + var filteredNotesList; + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + getProgressNoteList(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + + print(type); + GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = + GetNursingProgressNoteRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientTypeID: patient.patientType, + patientID: patient.patientId, setupID: "010266"); + model.getNursingProgressNote(getNursingProgressNoteRequestModel); + } + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => getProgressNoteList(context, model), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.patientNursingProgressNoteList == null || + model.patientNursingProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: + model.patientNursingProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientNursingProgressNoteList[ + index] + .createdByName + .toString() ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .patientNursingProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientNursingProgressNoteList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .patientNursingProgressNoteList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .patientNursingProgressNoteList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + model + .patientNursingProgressNoteList[ + index] + .notes, + fontSize: 10, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart new file mode 100644 index 00000000..bc5ca8d7 --- /dev/null +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -0,0 +1,372 @@ +import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/operation_report/update_operation_report.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import '../../../../config/shared_pref_kay.dart'; +import '../../../../models/patient/patiant_info_model.dart'; +import '../../../../util/dr_app_shared_pref.dart'; +import '../../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../../widgets/shared/app_texts_widget.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class OperationReportScreen extends StatefulWidget { + final int visitType; + + const OperationReportScreen({Key? key, this.visitType}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + List notesList; + var filteredNotesList; + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => model.getReservations(patient.patientMRN), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: Container( + color: Colors.grey[200], + child: Column( + children: [ + model.reservationList == null || + model.reservationList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Expanded( + child: Container( + child: ListView.builder( + itemCount: model.reservationList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.white, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .createdBy, + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .reservationList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .reservationList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Reservation: ", + fontSize: 10, + ), + Expanded( + child: AppText( + model.reservationList[index].oTReservationID.toString(), + fontSize: 10, + ), + ) + ]), + SizedBox( + height: 8, + ), + if (model.reservationList[index] + .operationDate != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Date : ", + fontSize: 10, + ), + Expanded( + child: AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .operationDate), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontSize: 10, + ), + ) + ]), + if (model.reservationList[index] + .timeStart != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Time Start : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .timeStart, + fontSize: 10, + ), + ) + ]), + if (model.reservationList[index] + .remarks != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Remarks : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .remarks ?? + '', + fontSize: 10, + ), + ), + ]) + ], + ), + + SizedBox( + height: 20, + ), + + // if ( + // authenticationViewModel + // .doctorProfile.doctorID == + // model + // .operationReportList[ + // index] + // .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { + await locator() + .logEvent( + eventCategory: + "Operation Report Screen", + eventAction: + "Update Operation Report ", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateOperationReport( + reservation: model + .reservationList[ + index], + patient: patient, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "Operation Reports", + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ), + ], + ), + + SizedBox( + height: 10, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart new file mode 100644 index 00000000..8148e2a9 --- /dev/null +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -0,0 +1,666 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; +import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class UpdateOperationReport extends StatefulWidget { + final GetReservationsResponseModel reservation; + // final OperationReportViewModel operationReportViewModel; + final PatiantInformtion patient; + final int visitType; + final bool isUpdate; + + const UpdateOperationReport( + {Key? key, + // this.operationReportViewModel, + this.patient, + this.visitType, + this.isUpdate, + this.reservation}) + : super(key: key); + + @override + _UpdateOperationReportState createState() => _UpdateOperationReportState(); +} + +class _UpdateOperationReportState extends State { + int selectedType; + bool isSubmitted = false; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + ProjectViewModel projectViewModel; + + TextEditingController preOpDiagmosisController = TextEditingController(); + TextEditingController postOpDiagmosisNoteController = TextEditingController(); + TextEditingController surgeonController = TextEditingController(); + TextEditingController assistantNoteController = TextEditingController(); + TextEditingController operationController = TextEditingController(); + TextEditingController inasionController = TextEditingController(); + TextEditingController findingController = TextEditingController(); + TextEditingController surgeryProcedureController = TextEditingController(); + TextEditingController postOpInstructionController = TextEditingController(); + TextEditingController complicationDetailsController = TextEditingController(); + TextEditingController bloodLossDetailController = TextEditingController(); + TextEditingController histopathSpecimenController = TextEditingController(); + TextEditingController microbiologySpecimenController = + TextEditingController(); + TextEditingController otherSpecimenController = TextEditingController(); + TextEditingController scrubNurseController = TextEditingController(); + TextEditingController circulatingNurseController = TextEditingController(); + TextEditingController BloodTransfusedDetailController = + TextEditingController(); + TextEditingController anasthetistController = TextEditingController(); + TextEditingController OTReservationID = TextEditingController(); + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + //TODO Elham* add translation to hints + + return BaseView( + onModelReady: (model) async { + await model + .getOperationReportDetails(widget.reservation); + OTReservationID.text = widget.reservation.oTReservationID.toString(); + + if (model.operationDetailsList.isNotEmpty) { + GetOperationDetailsResponseModel oldDetails = + model.operationDetailsList[0]; + + postOpDiagmosisNoteController.text = oldDetails.postOpInstruction; + preOpDiagmosisController.text = oldDetails.preOpDiagnosis; + surgeonController.text = oldDetails.surgeon; + assistantNoteController.text = oldDetails.assistant; + operationController.text = oldDetails.operation; + inasionController.text = oldDetails.inasion; + findingController.text = oldDetails.finding; + surgeryProcedureController.text = oldDetails.surgeryProcedure; + postOpInstructionController.text = oldDetails.postOpInstruction; + complicationDetailsController.text = oldDetails.complicationDetail; + bloodLossDetailController.text = oldDetails.bloodLossDetail; + histopathSpecimenController.text = oldDetails.histopathSpecimen; + microbiologySpecimenController.text = + oldDetails.microbiologySpecimen; + otherSpecimenController.text = oldDetails.otherSpecimen; + scrubNurseController.text = oldDetails.scrubNurse; + circulatingNurseController.text = oldDetails.circulatingNurse; + BloodTransfusedDetailController.text = + oldDetails.bloodTransfusedDetail; + anasthetistController.text = oldDetails.anasthetist; + } + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).operationReports, + ), + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.0, + ), + SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + AppTextFieldCustom( + hintText: "Reservation No", + //TranslationBase.of(context).addoperationReports, + controller: OTReservationID, + maxLines: 1, + minLines: 1, + enabled: false, + hasBorder: true, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Pre Op Diagmosis", + //TranslationBase.of(context).addoperationReports, + controller: preOpDiagmosisController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: preOpDiagmosisController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Post Op Diagmosis", + //TranslationBase.of(context).addoperationReports, + controller: postOpDiagmosisNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + postOpDiagmosisNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Surgeon", + //TranslationBase.of(context).addoperationReports, + controller: surgeonController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + surgeonController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "assistant", + //TranslationBase.of(context).addoperationReports, + controller: assistantNoteController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: assistantNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Operation", + //TranslationBase.of(context).addoperationReports, + controller: operationController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + operationController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "inasion", + //TranslationBase.of(context).addoperationReports, + controller: inasionController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + inasionController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "finding", + //TranslationBase.of(context).addoperationReports, + controller: findingController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + findingController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Surgery Procedure", + //TranslationBase.of(context).addoperationReports, + controller: surgeryProcedureController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + surgeryProcedureController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Post Op Instruction", + //TranslationBase.of(context).addoperationReports, + controller: postOpInstructionController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + postOpInstructionController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Complication Details", + //TranslationBase.of(context).addoperationReports, + controller: complicationDetailsController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + complicationDetailsController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Blood Loss Detail", + //TranslationBase.of(context).addoperationReports, + controller: bloodLossDetailController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: bloodLossDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "histopal the Specimen", + //TranslationBase.of(context).addoperationReports, + controller: histopathSpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + histopathSpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "microbiology Specimen ", + //TranslationBase.of(context).addoperationReports, + controller: + microbiologySpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + microbiologySpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "other Specimen", + //TranslationBase.of(context).addoperationReports, + controller: otherSpecimenController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: otherSpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "scrub Nurse", + //TranslationBase.of(context).addoperationReports, + controller: scrubNurseController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + scrubNurseController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "circulating Nurse", + //TranslationBase.of(context).addoperationReports, + controller: circulatingNurseController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + circulatingNurseController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Blood Transfused Detail", + //TranslationBase.of(context).addoperationReports, + controller: + BloodTransfusedDetailController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + BloodTransfusedDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 4, + ), + AppTextFieldCustom( + hintText: "Anasthetist", + //TranslationBase.of(context).addoperationReports, + controller: anasthetistController, + maxLines: 1, + minLines: 1, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: + anasthetistController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 250, + ), + ], + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + bottomSheet: model.state != ViewState.Idle?Container(height: 0,): Container( + height: 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).operationReports, + color: Color(0xff359846), + // disabled: operationReportsController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (isFormValid()) { + GifLoaderDialogUtils.showMyDialog(context); + await model + .getDoctorProfile(); + + CreateUpdateOperationReportRequestModel + createUpdateOperationReportRequestModel = + CreateUpdateOperationReportRequestModel( + inasion: inasionController.text, + + /// TODO Elham* Add dynamic reservation + reservationNo: + widget.reservation.oTReservationID, + preOpDiagmosis: + preOpDiagmosisController.text, + postOpDiagmosis: + postOpDiagmosisNoteController.text, + surgeon: surgeonController.text, + assistant: assistantNoteController.text, + anasthetist: assistantNoteController.text, + operation: operationController.text, + finding: findingController.text, + surgeryProcedure: surgeonController.text, + postOpInstruction: + postOpInstructionController.text, + complicationDetails: + complicationDetailsController.text, + bloodLossDetail: + bloodLossDetailController.text, + histopathSpecimen: + histopathSpecimenController.text, + microbiologySpecimen: + microbiologySpecimenController.text, + otherSpecimen: otherSpecimenController.text, + scrubNurse: surgeonController.text, + circulatingNurse: + circulatingNurseController.text, + bloodTransfusedDetail: + bloodLossDetailController.text, + patientID: widget.patient.patientId, + admissionNo: + int.parse(widget.patient.admissionNo), + createdBy: model + .doctorProfile.doctorID, + setupID: "010266"); + await model + .updateOperationReport( + createUpdateOperationReportRequestModel); + + if (model.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + model.error); + } else { + // await model.( + // operationReportsRequest.toJson()); + + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + ), + ], + ), + ), + )); + } + + isFormValid() { + if (preOpDiagmosisController.text != null && + preOpDiagmosisController.text.isNotEmpty && + postOpDiagmosisNoteController.text != null && + postOpDiagmosisNoteController.text.isNotEmpty && + surgeonController.text != null && + surgeonController.text.isNotEmpty && + assistantNoteController.text != null && + assistantNoteController.text.isNotEmpty && + operationController.text != null && + operationController.text.isNotEmpty && + inasionController.text != null && + inasionController.text.isNotEmpty && + findingController.text != null && + findingController.text.isNotEmpty && + surgeryProcedureController.text != null && + surgeryProcedureController.text.isNotEmpty && + postOpInstructionController.text != null && + postOpInstructionController.text.isNotEmpty && + complicationDetailsController.text != null && + complicationDetailsController.text.isNotEmpty && + bloodLossDetailController.text != null && + bloodLossDetailController.text.isNotEmpty && + histopathSpecimenController.text != null && + histopathSpecimenController.text.isNotEmpty && + microbiologySpecimenController.text != null && + microbiologySpecimenController.text.isNotEmpty && + otherSpecimenController.text != null && + otherSpecimenController.text.isNotEmpty && + scrubNurseController.text != null && + scrubNurseController.text.isNotEmpty && + circulatingNurseController.text != null && + circulatingNurseController.text.isNotEmpty && + BloodTransfusedDetailController.text != null && + BloodTransfusedDetailController.text.isNotEmpty && + anasthetistController.text != null && + anasthetistController.text.isNotEmpty) { + return true; + } else { + return false; + } + } +} diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart new file mode 100644 index 00000000..c820fded --- /dev/null +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -0,0 +1,64 @@ +import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:flutter/material.dart'; + +class PendingOrdersScreen extends StatelessWidget { + const PendingOrdersScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + bool isInpatient = routeArgs['isInpatient']; + return BaseView( + onModelReady: (model) => model.getPendingOrders( + patientId: patient.patientMRN, + admissionNo: int.parse(patient.admissionNo)), + builder: + (BuildContext context, PendingOrdersViewModel model, Widget child) => + AppScaffold( + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Pending Orders", + body: model.pendingOrdersList == null || + model.pendingOrdersList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noDataAvailable) + : Container( + child: ListView.builder( + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: + AppText(model.pendingOrdersList[index].notes), + ), + ), + ); + })), + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index e5f858e7..2aa9e669 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,10 +1,12 @@ import 'dart:async'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -15,6 +17,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -33,14 +36,17 @@ class PatientProfileScreen extends StatefulWidget { class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { late PatiantInformtion patient; + LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); bool isFromSearch = false; bool isFromLiveCare = false; bool isInpatient = false; + bool isMyPatient = false; bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; + bool isCallStarted = false; late String patientType; late String arrivalType; late String from; @@ -63,6 +69,9 @@ class _PatientProfileScreenState extends State with Single void dispose() { _tabController.dispose(); super.dispose(); + if (isFromLiveCare) { + _liveCareViewModel.removePatientFromDoctorList(patient.vcId); + } } @override @@ -92,6 +101,9 @@ class _PatientProfileScreenState extends State with Single if (routeArgs.containsKey("isCallFinished")) { isCallFinished = routeArgs['isCallFinished']; } + if (routeArgs.containsKey("isMyPatient")) { + isMyPatient = routeArgs['isMyPatient']; + } if (isInpatient) _activeTab = 0; else @@ -99,28 +111,37 @@ class _PatientProfileScreenState extends State with Single } late StreamSubscription callTimer; + callConnected() { - callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) - ..onDone(() { - callTimer.cancel(); - }) - ..onData((data) { - var t = Helpers.timeFrom(duration: data.elapsed); - videoCallDurationStreamController.sink.add(t); - }); + callTimer = + CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) + ..onDone(() { + callTimer.cancel(); + }) + ..onData((data) { + var t = Helpers.timeFrom(duration: data.elapsed); + videoCallDurationStreamController.sink.add(t); + }); } callDisconnected() { callTimer.cancel(); videoCallDurationStreamController.sink.add(''); + + setState(() { + isCallStarted = false; + }); } @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, + onModelReady: (model) async { + if (isFromLiveCare && patient.patientStatus == 1) + await model.addPatientToDoctorList(patient.vcId); + },builder: (_, model, w) => AppScaffold( + baseViewModel: model,isLoading: true, appBarTitle: TranslationBase.of(context).patientProfile ?? "", isShowAppBar: false, body: Column( @@ -190,23 +211,33 @@ class _PatientProfileScreenState extends State with Single ), ], ), - if (isFromLiveCare + if ((isInpatient && !isDischargedPatient) + ? true + :isFromLiveCare ? patient.episodeNo != null : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( - onModelReady: (model) async {}, + onModelReady: (model) async { + model.getDoctorProfile(); + if (isInpatient) { + await model.getEpisodeForInpatient(patient); + } + }, builder: (_, model, w) => Positioned( top: 180, left: 20, right: 20, - child: Row( + child: Row( children: [ Expanded(child: Container()), if (patient.episodeNo == 0) AppButton( + loading: model.state== ViewState.BusyLocal, + disabled: model.state== ViewState.BusyLocal, + title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: isFromLiveCare + color: isFromLiveCare || isInpatient ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700 @@ -224,25 +255,21 @@ class _PatientProfileScreenState extends State with Single ), onPressed: () async { if ((isFromLiveCare && - patient.appointmentNo != null && - patient.appointmentNo != 0) || - patient.patientStatusType == 43) { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); - GifLoaderDialogUtils.showMyDialog(context); - await model.postEpisode(postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog(context); - patient.episodeNo = model.episodeID; - Navigator.of(context) - .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + patient.appointmentNo != null) || + patient.patientStatusType == 43 || isInpatient ) { + createEpisode( + patient: patient, model: model); } }, ), if (patient.episodeNo != 0) AppButton( + loading: model.state== ViewState.BusyLocal, + disabled: model.state== ViewState.BusyLocal, + title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: isFromLiveCare + color: ((isInpatient) || isFromLiveCare) && model.state!= ViewState.BusyLocal ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700 @@ -258,13 +285,20 @@ class _PatientProfileScreenState extends State with Single color: Colors.white, height: 30, ), - onPressed: () { + onPressed: () async { + await locator() + .logEvent( + eventCategory: "Patient Profile ", + eventAction: "Update Episode", + ); if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || - patient.patientStatusType == 43) { - Navigator.of(context) - .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); + patient.patientStatusType == 43 || + isInpatient) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: {'patient': patient}); } }), ], @@ -296,40 +330,75 @@ class _PatientProfileScreenState extends State with Single child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: isCallFinished ? Colors.red[600] : Colors.green[600], + color: isCallFinished + ? Colors.red[600] + : Colors.green[600], title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall, - disabled: model.state == ViewState.BusyLocal, + disabled: isCallStarted || + model.state == ViewState.BusyLocal, onPressed: () async { - // Navigator.push(context, MaterialPageRoute( - // builder: (BuildContext context) => - // EndCallScreen(patient:patient))) + // TODO MOSA TEST + // AppPermissionsUtils + // .requestVideoCallPermission( + // context: context, + // onTapGrant: () { + // locator() + // .openVideo( + // model.startCallRes, + // patient, + // model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, + // callDisconnected); + // }); if (isCallFinished) { Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => EndCallScreen(patient: patient))); + context, + MaterialPageRoute( + builder: (BuildContext context) => + EndCallScreen(patient: patient), + settings: + RouteSettings(name: 'EndCallScreen'), + ), + ); } else { GifLoaderDialogUtils.showMyDialog(context); - await model.startCall(isReCall: false, vCID: patient.vcId!); + await model.startCall( + isReCall: false, vCID: patient.vcId); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(model.error); } else { await model.getDoctorProfile(); - patient.appointmentNo = model.startCallRes.appointmentNo; + patient.appointmentNo = int.parse(model + .startCallRes.appointmentNo + .toString()); patient.episodeNo = 0; - + model.updateInCallPatient( + patient: patient, + appointmentNo: int.parse(model + .startCallRes.appointmentNo + .toString())); + setState(() { + isCallStarted = true; + }); GifLoaderDialogUtils.hideDialog(context); - AppPermissionsUtils.requestVideoCallPermission( - context: context, - onTapGrant: () { - locator() - .openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }, - type: ''); + AppPermissionsUtils + .requestVideoCallPermission( + context: context, + onTapGrant: () { + locator() + .openVideo( + model.startCallRes, + patient, + model.startCallRes != null + ? model.startCallRes + .isRecording + : true, + callConnected, + callDisconnected); + }); } } }, @@ -347,6 +416,36 @@ class _PatientProfileScreenState extends State with Single ), ); } + + createEpisode({PatiantInformtion patient, SOAPViewModel model}) async { + await locator().logEvent( + eventCategory: "Patient Profile", + eventAction: "Create Episode", + ); + GifLoaderDialogUtils.showMyDialog(context); + if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { + PostEpisodeForInpatientRequestModel postEpisodeReqModel = + PostEpisodeForInpatientRequestModel( + admissionNo: int.parse(patient.admissionNo), + patientID: patient.patientId); + await model.postEpisodeForInPatient(postEpisodeReqModel); + } else { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: int.parse(patient.appointmentNo.toString()), + patientMRN: patient.patientMRN); + + await model.postEpisode(postEpisodeReqModel); + } + + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } else { + patient.episodeNo = model.episodeID; + Navigator.of(context) + .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + } + } } class AvatarWidget extends StatelessWidget { diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index a95f1c4a..e9451e54 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -41,6 +41,12 @@ class ProfileGridForInPatient extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).lab ?? "", TranslationBase.of(context).result ?? "", LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).special, + ALL_SPECIAL_LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).result!, RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), @@ -73,9 +79,10 @@ class ProfileGridForInPatient extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).approvals!, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, null, + PatientProfileCardModel(TranslationBase.of(context).discharge!, TranslationBase.of(context).report!, DISCHARGE_SUMMARY, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, isDisable: true), + isInPatient: isInpatient, ) + , PatientProfileCardModel( TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, @@ -83,34 +90,81 @@ class ProfileGridForInPatient extends StatelessWidget { 'patient/patient_sick_leave.png', isInPatient: isInpatient, ), + PatientProfileCardModel( + "Operation", + "Report", + GET_OPERATION_REPORT, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + "Pending", + "Orders", + PENDING_ORDERS, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + "Admission", + "Orders", + ADMISSION_ORDERS, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + "Nursing", + "Progress Note", + NURSING_PROGRESS_NOTE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + "Diagnosis", + "", + DIAGNOSIS_FOR_IN_PATIENT, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + "Diabetic", + "Chart", + DIABETIC_CHART_VALUES, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), ]; return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: StaggeredGridView.countBuilder( + child: GridView( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, + + physics: BouncingScrollPhysics(), + // if you want IOS bouncing effect, otherwise remove this line + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 10, + mainAxisSpacing: 10, + crossAxisCount: 3, ), + //change the number as you want + children: cardsList.map((item) { + return PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: item.nameLine1, + nameLine2: item.nameLine2, + route: item.route, + icon: item.icon, + isInPatient: item.isInPatient, + isDischargedPatient: item.isDischargedPatient, + isDisable: item.isDisable, + onTap: item.onTap, + isLoading: item.isLoading, + ); + }).toList(), ), ); } diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 8e1e906d..7045f6c7 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -33,23 +33,24 @@ class ProfileGridForOther extends StatelessWidget { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, - VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!, + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, + ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, ORDER_PROCEDURE, 'patient/Order_Procedures.png', @@ -57,8 +58,7 @@ class ProfileGridForOther extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, - ADD_SICKLEAVE, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index a4e65543..47097c43 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -30,23 +30,24 @@ class ProfileGridForSearch extends StatelessWidget { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, - VITAL_SIGN_DETAILS, 'patient/vital_signs.png', + PatientProfileCardModel(TranslationBase.of(context).vital!, TranslationBase.of(context).signs!, VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).lab!, TranslationBase.of(context).result!, LAB_RESULT, 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).radiology!, TranslationBase.of(context).service!, + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, + ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).prescription!, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).health!, TranslationBase.of(context).summary!, HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patient!, "ECG", PATIENT_ECG, 'patient/patient_sick_leave.png', isInPatient: isInpatient), PatientProfileCardModel(TranslationBase.of(context).orders!, TranslationBase.of(context).procedures!, ORDER_PROCEDURE, 'patient/Order_Procedures.png', @@ -54,8 +55,7 @@ class ProfileGridForSearch extends StatelessWidget { PatientProfileCardModel(TranslationBase.of(context).insurance!, TranslationBase.of(context).service!, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, - ADD_SICKLEAVE, 'patient/patient_sick_leave.png', + PatientProfileCardModel(TranslationBase.of(context).patientSick!, TranslationBase.of(context).leave!, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileCardModel(TranslationBase.of(context).patient!, TranslationBase.of(context).ucaf!, diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 79bb7614..779776a4 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; @@ -11,6 +12,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../../../../locator.dart'; + class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; @@ -73,6 +76,7 @@ class RadiologyDetailsPage extends StatelessWidget { child: AppText( '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, + isCopyable: true, fontSize: 17, color: Color(0xff575757), ), @@ -96,7 +100,11 @@ class RadiologyDetailsPage extends StatelessWidget { color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", textColor: Color(0xffFFFFFF), - onTap: () { + onTap: () async { + await locator().logEvent( + eventCategory: "RadiologyDetailsPage", + eventAction: "Open Radiology Image", + ); launch(model.radImageURL); }, label: TranslationBase.of(context).openRad ?? "", diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 22f96c09..6714460f 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -106,13 +107,13 @@ class _RadiologyHomePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - model: model, - procedureType: ProcedureType.RADIOLOGY, - ), - ), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.RADIOLOGY, + ), + settingRoute: 'AddProcedureTabPage'), ); }, label: TranslationBase.of(context).applyForRadiologyOrder ?? "", @@ -176,10 +177,9 @@ class _RadiologyHomePageState extends State { context, FadePage( page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], - patient: patient, - isInpatient:isInpatient - ), + finalRadiology: model.radiologyList[index], + patient: patient, + isInpatient: isInpatient), ), ); }, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 76fabbbf..2ab83a88 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -3,8 +3,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -135,6 +137,10 @@ class _AddReplayOnReferralPatientState extends State Expanded( child: AppButton( onPressed: () async { + await locator().logEvent( + eventCategory: "Add Replay On Referral Patient", + eventAction: "Add Replay on Referral", + ); if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); await widget.patientReferralViewModel.replayReferred( @@ -146,14 +152,6 @@ class _AddReplayOnReferralPatientState extends State DrAppToastMsg.showSuccesToast("Has been rejected"); Navigator.of(context).pop(); Navigator.of(context).pop(); - - // Navigator.push( - // context, - // FadePage( - // page: ReplySummeryOnReferralPatient( - // widget.myReferralInPatientModel, replayOnReferralController.text.trim()), - // ), - // ); } } else { Helpers.showErrorToast("You can't add empty reply"); @@ -187,14 +185,6 @@ class _AddReplayOnReferralPatientState extends State DrAppToastMsg.showSuccesToast("Your Reply Added Successfully"); Navigator.of(context).pop(); Navigator.of(context).pop(); - - // Navigator.push( - // context, - // FadePage( - // page: ReplySummeryOnReferralPatient( - // widget.myReferralInPatientModel, replayOnReferralController.text.trim()), - // ), - // ); } } else { Helpers.showErrorToast("You can't add empty reply"); @@ -211,48 +201,6 @@ class _AddReplayOnReferralPatientState extends State ], ), ), - // Container( - // margin: EdgeInsets.all(5), - // child: AppButton( - // title: 'Submit Reply', - // color: Color(0xff359846), - // fontWeight: FontWeight.w700, - // onPressed: () async { - // setState(() { - // isSubmitted = true; - // }); - // if (replayOnReferralController.text.isNotEmpty) { - // GifLoaderDialogUtils.showMyDialog(context); - // await widget.patientReferralViewModel.replay( - // replayOnReferralController.text.trim(), - // widget.myReferralInPatientModel); - // if (widget.patientReferralViewModel.state == - // ViewState.ErrorLocal) { - // Helpers.showErrorToast( - // widget.patientReferralViewModel.error); - // } else { - // GifLoaderDialogUtils.hideDialog(context); - // DrAppToastMsg.showSuccesToast( - // "Your Reply Added Successfully"); - // Navigator.of(context).pop(); - // Navigator.of(context).pop(); - // - // Navigator.push( - // context, - // FadePage( - // page: ReplySummeryOnReferralPatient( - // widget.myReferralInPatientModel, - // replayOnReferralController.text.trim()), - // ), - // ); - // } - // } else { - // Helpers.showErrorToast("You can't add empty reply"); - // setState(() { - // isSubmitted = false; - // }); - // } - // })), ], ), ), diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 5a33c00d..ac8ddd16 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -1,8 +1,8 @@ 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/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -13,388 +13,356 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; // ignore: must_be_immutable class MyReferralDetailScreen extends StatelessWidget { - late PendingReferral pendingReferral; + final MyReferralPatientModel referralPatient; + + const MyReferralDetailScreen({Key? key, this.referralPatient}) : super(key: key); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; - pendingReferral = routeArgs['referral']; + // final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + // pendingReferral = routeArgs['referral']; return BaseView( - onModelReady: (model) => model.getPatientDetails( - AppDateUtils.convertStringToDateFormat( - DateTime.now() /*.subtract(Duration(days: 350))*/ .toString(), "yyyy-MM-dd"), - AppDateUtils.convertStringToDateFormat(DateTime.now().toString(), "yyyy-MM-dd"), - pendingReferral.patientID!, - pendingReferral.sourceAppointmentNo!), + onModelReady: (model) => model.getDoctorProfile(), builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient!, - isShowAppBar: false, - body: model.patientArrivalList != null && model.patientArrivalList.length > 0 - ? Column( - children: [ - Container( - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Column( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).referPatient, + isShowAppBar: false, + body: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + (Helpers.capitalize(referralPatient.firstName + " " + referralPatient.lastName)), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + referralPatient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( + Padding( padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), + child: Container( + width: 60, + height: 60, + child: Image.asset( + referralPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, ), - Expanded( - child: AppText( - (Helpers.capitalize(model.patientArrivalList[0].patientDetails!.fullName)), - fontSize: SizeConfig.textMultiplier * 2.5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - ), - ), - model.patientArrivalList[0].patientDetails!.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), + ), + ), + SizedBox( + width: 10, ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - pendingReferral.patientDetails?.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + referralPatient.referralStatus != null + ? model.getReferralStatusNameByCode(referralPatient.referralStatus, context) + : "", + fontFamily: 'Poppins', + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: referralPatient.referralStatus == 1 + ? Color(0xffc4aa54) + : referralPatient.referralStatus == 46 || referralPatient.referralStatus == 2 + ? Colors.green[700] + : Colors.red[700], + ), + AppText( + AppDateUtils.getDayMonthYearDateFormatted(referralPatient.referralDate), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Color(0XFF28353E), + ) + ], ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "", - fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700, - color: pendingReferral.referralStatus != null - ? pendingReferral.referralStatus == 'Pending' - ? Color(0xffc4aa54) - : pendingReferral.referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] - : Colors.grey[500], - ), - AppText( - pendingReferral.referredOn!.split(" ")[0], + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Color(0XFF28353E), - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).fileNumber, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - "${pendingReferral.patientID}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), - ], + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), AppText( - pendingReferral.referredOn!.split(" ")[1], + "${referralPatient.patientID}", fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ) + color: Color(0XFF2E303A), + ), ], ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( + AppText( + AppDateUtils.getTimeHHMMA(referralPatient.referralDate), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).referredFrom, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - pendingReferral.isReferralDoctorSameBranch! - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), - ], + AppText( + TranslationBase.of(context).referredFrom, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks ?? "" + " : ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - pendingReferral.remarksFromSource, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), - ), - ), - ], + AppText( + referralPatient.targetProjectId == referralPatient.sourceProjectId + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), ), ], ), - ), - Row( - children: [ - AppText( - pendingReferral.patientDetails!.nationalityName != null - ? pendingReferral.patientDetails!.nationalityName - : "", - fontWeight: FontWeight.bold, - color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, - ), - pendingReferral.nationalityFlagUrl != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - pendingReferral.nationalityFlagUrl ?? "", - height: 25, - width: 30, - errorBuilder: (BuildContext context, Object exception, - StackTrace? stackTrace) { - return Text('No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 0), - child: Image.asset( - 'assets/images/patient/ic_ref_arrow_up.png', - height: 50, - width: 30, - ), - ), - Container( - margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), - child: Container( - width: 40, - height: 40, - child: CircleAvatar( - radius: 25.0, - backgroundImage: NetworkImage(pendingReferral.doctorImageUrl ?? ""), - backgroundColor: Colors.transparent, - ), - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), - child: Column( - children: [ - AppText( - pendingReferral.referredByDoctorInfo, + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks + " : ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referralPatient.referringDoctorRemarks ?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), - ], - ), + ), + ], ), + ], + ), + ), + Row( + children: [ + AppText( + referralPatient.nationalityName != null + ? referralPatient.nationalityName + : "", + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + fontSize: 1.4 * SizeConfig.textMultiplier, ), + referralPatient.nationalityFlagURL != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + referralPatient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext context, Object exception, StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() ], + ) + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_up.png', + height: 50, + width: 30, + ), + ), + Container( + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: Container( + width: 40, + height: 40, + child: CircleAvatar( + radius: 25.0, + backgroundImage: NetworkImage(referralPatient.doctorImageURL), + backgroundColor: Colors.transparent, + ), + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0), + child: Column( + children: [ + AppText( + referralPatient.doctorName, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), ), ], ), - ), - ], + ], + ), ), ], ), - ), + ], ), - Expanded( - child: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: SizedBox( - child: ProfileMedicalInfoWidgetSearch( - patient: model.patientArrivalList[0], - patientType: "7", - from: "", - to: "", - ), - ), - ), - ], - ), - ), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: Row( + ), + ), + Expanded( + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).accept, - color: Color(0xFF4BA821), - fontColor: Colors.white, - fontSize: 1.6, - hPadding: 8, - vPadding: 12, - onPressed: () async { - await model.responseReferral(pendingReferral, true); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); - Navigator.pop(context); - Navigator.pop(context); - } - }, - ), - ), SizedBox( - width: 8, + height: 16, ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).reject, - color: Color(0xFFB9382C), - fontColor: Colors.white, - fontSize: 1.6, - hPadding: 8, - vPadding: 12, - onPressed: () async { - await model.responseReferral(pendingReferral, true); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); - } else { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); - Navigator.pop(context); - Navigator.pop(context); - } - }, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: SizedBox( + child: ProfileMedicalInfoWidgetSearch( + patient: model.getPatientFromReferralO(referralPatient), + patientType: "7", + isInpatient: false, + from: null, + to: null, + ), ), ), ], ), ), - ], - ) - : Column( - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), + ), + ), + if (referralPatient.referralStatus == 1) + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: Row( + children: [ Expanded( - child: AppText( - "", - fontSize: SizeConfig.textMultiplier * 2.5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', + child: AppButton( + title: TranslationBase.of(context).accept, + color: Color(0xFF4BA821), + fontColor: Colors.white, + fontSize: 1.6, + hPadding: 8, + vPadding: 12, + disabled: model.state == ViewState.Busy, + onPressed: () async { + await model.responseReferral(referralPatient, true); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); + model.getMyReferralOutPatientService(); + Navigator.pop(context); + Navigator.pop(context); + } + }, ), ), - ]), - ), - Container( - child: Center( - child: AppText( - TranslationBase.of(context).patientNoDetailErrMsg, - color: HexColor("#B8382B"), - fontWeight: FontWeight.bold, - fontSize: 16, + SizedBox( + width: 8, ), - ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).reject, + color: Color(0xFFB9382C), + fontColor: Colors.white, + fontSize: 1.6, + hPadding: 8, + vPadding: 12, + disabled: model.state == ViewState.Busy, + onPressed: () async { + await model.responseReferral(referralPatient, false); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); + model.getMyReferralOutPatientService(); + Navigator.pop(context); + Navigator.pop(context); + } + }, + ), + ), + ], ), - ], - ), - ), + ), + ], + )), ); } } diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index 74d8d3b1..c818639a 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -13,7 +14,15 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -class MyReferralInPatientScreen extends StatelessWidget { +import 'my-referral-patient-screen.dart'; + +class MyReferralInPatientScreen extends StatefulWidget { + @override + _MyReferralInPatientScreenState createState() => + _MyReferralInPatientScreenState(); +} + +class _MyReferralInPatientScreenState extends State { PatientType patientType = PatientType.IN_PATIENT; @override @@ -30,7 +39,9 @@ class MyReferralInPatientScreen extends StatelessWidget { margin: EdgeInsets.only(top: 70), child: PatientTypeRadioWidget( (patientType) async { - this.patientType = patientType; + setState(() { + this.patientType = patientType; + }); GifLoaderDialogUtils.showMyDialog(context); if (patientType == PatientType.IN_PATIENT) { await model.getMyReferralPatientService(localBusy: true); @@ -66,18 +77,32 @@ class MyReferralInPatientScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ...List.generate( - model.myReferralPatients.length, - (index) => InkWell( + ListView.builder( + itemCount:model.myReferralPatients.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return InkWell( onTap: () { - Navigator.push( + if (patientType == + PatientType.OUT_PATIENT) { + Navigator.push( + context, + FadePage( + page: MyReferralDetailScreen( + referralPatient: model + .myReferralPatients[index]), + ), + ); + } else {Navigator.push( context, FadePage( page: ReferralPatientDetailScreen(model.myReferralPatients[index], model), ), ); - }, - child: PatientReferralItemWidget( + } + },child: PatientReferralItemWidget( referralStatus: model.getReferralStatusNameByCode( model.myReferralPatients[index].referralStatus!, context), referralStatusCode: model.myReferralPatients[index].referralStatus, @@ -85,7 +110,9 @@ class MyReferralInPatientScreen extends StatelessWidget { patientGender: model.myReferralPatients[index].gender, referredDate: AppDateUtils.getDayMonthYearDateFormatted( model.myReferralPatients[index].referralDate!), - referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate!), + referredTime: AppDateUtils.getTimeHHMMA( + model.myReferralPatients[index] + .referralDate!), patientID: "${model.myReferralPatients[index].patientID}", isSameBranch: false, isReferral: true, @@ -99,8 +126,8 @@ class MyReferralInPatientScreen extends StatelessWidget { clinicDescription: model.myReferralPatients[index].referringClinicDescription, infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), - ), - ), + ); + }) ], ), ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index f062d8c1..41514739 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -25,10 +25,12 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class PatientMakeInPatientReferralScreen extends StatefulWidget { @override - _PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState(); + _PatientMakeInPatientReferralScreenState createState() => + _PatientMakeInPatientReferralScreenState(); } -class _PatientMakeInPatientReferralScreenState extends State { +class _PatientMakeInPatientReferralScreenState + extends State { late PatiantInformtion patient; late List referToList; dynamic _referTo; @@ -66,7 +68,8 @@ class _PatientMakeInPatientReferralScreenState extends State initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -123,8 +127,14 @@ class _PatientMakeInPatientReferralScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + .getClinics(_selectedBranch[ + 'facilityId']) + .then((_) => + GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } } else { _selectedBranch = null; @@ -224,7 +243,9 @@ class _PatientMakeInPatientReferralScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + .getClinics( + _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } }); }, @@ -269,7 +295,9 @@ class _PatientMakeInPatientReferralScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + patient, + _selectedClinic['ClinicID'], + _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } }); }, @@ -315,41 +351,49 @@ class _PatientMakeInPatientReferralScreenState extends State 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.doctorsList, - attributeName: 'Name', - attributeValueId: 'DoctorID', - usingSearch: true, - hintSearchText: TranslationBase.of(context).doctorSearch, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : () { - if (_selectedClinic == null) { - DrAppToastMsg.showErrorToast("You need to select a clinic first"); - } else if (model.doctorsList == null || model.doctorsList.length == 0) { - DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); - } + onClick: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'Name', + attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: + TranslationBase.of(context) + .doctorSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : () { + if (_selectedClinic == null) { + DrAppToastMsg.showErrorToast( + "You need to select a clinic first"); + } else if (model.doctorsList == null || + model.doctorsList.length == 0) { + DrAppToastMsg.showErrorToast( + "There is no doctors for this clinic"); + } + }, ), SizedBox( height: 10, @@ -377,8 +421,11 @@ class _PatientMakeInPatientReferralScreenState extends State {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ), @@ -452,15 +502,14 @@ class _PatientMakeInPatientReferralScreenState extends State { title: TranslationBase.of(context).refer, fontWeight: FontWeight.w700, color: HexColor("#359846"), - onPressed: () { - setState(() { + onPressed: () async { + setState(() async { + await locator().logEvent( + eventCategory: "Refer Patient", + eventAction: "Submit Refer", + ); if (_referTo == null) { branchError = TranslationBase.of(context).fieldRequired!; } else { diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 68194da5..c9c037e2 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -138,7 +140,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { AppText( "${model.getReferralStatusNameByCode(referredPatient.referralStatus!, context)}", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 ? Color(0xffc4aa54) @@ -152,7 +154,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], @@ -167,14 +169,14 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${referredPatient.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -185,7 +187,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { ), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], @@ -205,7 +207,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -213,7 +215,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.referringClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -227,7 +229,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).frequency! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -235,7 +237,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.frequencyDescription?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -280,7 +282,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).priority! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -288,7 +290,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.priorityDescription?? '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -302,7 +304,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).maxResponseTime! + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( @@ -311,7 +313,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { referredPatient.mAXResponseTime!, "dd MMM,yyyy"): '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -340,7 +342,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { width: 30, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { - return Text('No Image'); + return Text(''); }, )) : Container( @@ -428,7 +430,8 @@ class ReferralPatientDetailScreen extends StatelessWidget { ], ), ), - if (referredPatient.referredDoctorRemarks!.isNotEmpty) + if (referredPatient.referredDoctorRemarks != null && + referredPatient.referredDoctorRemarks!.isNotEmpty) Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 0), @@ -481,13 +484,18 @@ class ReferralPatientDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, onPressed: () async { + await locator().logEvent( + eventCategory: "Referral Patient Detail", + eventAction: "Replay To Patient", + ); Navigator.push( context, SlideUpPageRoute( widget: AddReplayOnReferralPatient( patientReferralViewModel: patientReferralViewModel, myReferralInPatientModel: referredPatient, - isEdited: referredPatient.referredDoctorRemarks!.isNotEmpty, + isEdited: referredPatient.referredDoctorRemarks != null && + referredPatient.referredDoctorRemarks!.isNotEmpty, ), ), ); diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index d7f25f5f..246ab11d 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -12,7 +12,12 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -class ReferredPatientScreen extends StatelessWidget { +class ReferredPatientScreen extends StatefulWidget { + @override + _ReferredPatientScreenState createState() => _ReferredPatientScreenState(); +} + +class _ReferredPatientScreenState extends State { PatientType patientType = PatientType.IN_PATIENT; @override @@ -29,7 +34,9 @@ class ReferredPatientScreen extends StatelessWidget { margin: EdgeInsets.only(top: 70), child: PatientTypeRadioWidget( (patientType) async { - this.patientType = patientType; + setState(() { + this.patientType = patientType; + }); GifLoaderDialogUtils.showMyDialog(context); if (patientType == PatientType.IN_PATIENT) { await model.getMyReferredPatient(isFirstTime: false); @@ -65,14 +72,20 @@ class ReferredPatientScreen extends StatelessWidget { child: Container( child: Column( children: [ - ...List.generate( - model.listMyReferredPatientModel.length, - (index) => InkWell( + ListView.builder( + itemCount: + model.listMyReferredPatientModel.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return InkWell( onTap: () { Navigator.push( context, FadePage( - page: ReferredPatientDetailScreen(model.getReferredPatientItem(index)), + page: ReferredPatientDetailScreen(model.getReferredPatientItem(index), + this.patientType), ), ); }, @@ -98,7 +111,8 @@ class ReferredPatientScreen extends StatelessWidget { clinicDescription: model.getReferredPatientItem(index).referralClinicDescription, infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), ), - ), + ); + }, ), ], ), diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 7e99f2e2..c292497f 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -18,8 +19,9 @@ import '../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { final MyReferredPatientModel referredPatient; + final PatientType patientType; - ReferredPatientDetailScreen(this.referredPatient); + ReferredPatientDetailScreen(this.referredPatient, this.patientType); @override Widget build(BuildContext context) { @@ -71,7 +73,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": true, + "isInpatient": + patientType == PatientType.IN_PATIENT, "arrivalType": "1", "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), @@ -93,7 +96,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": true, + "isInpatient": + patientType == PatientType.IN_PATIENT, "arrivalType": "1", "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), @@ -270,13 +274,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { ) ], ), - if(referredPatient.priorityDescription != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).priority ?? "" + ": ", + if (referredPatient.priorityDescription != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority ?? "" + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -461,8 +466,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { AppText( referredPatient .referredDoctorRemarks == null ?'':referredPatient.referredDoctorRemarks!.isNotEmpty - ? referredPatient.referredDoctorRemarks - : TranslationBase.of(context).notRepliedYet, + ? referredPatient + .referredDoctorRemarks + : TranslationBase.of(context) + .notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -478,7 +485,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), ), - Container( + if (patientType == PatientType.IN_PATIENT)Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( title: TranslationBase.of(context).acknowledged, diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 14702f81..17b8740c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -1,36 +1,38 @@ import 'package:autocomplete_textfield/autocomplete_textfield.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/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) + addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; + AddAssessmentDetails( {Key? key, required this.mySelectedAssessment, @@ -105,25 +107,20 @@ class _AddAssessmentDetailsState extends State { heightFactor: 1, child: BaseView( onModelReady: (model) async { - if (model.listOfDiagnosisCondition.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisCondition); - } - if (model.listOfDiagnosisType.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisType); - } - if (model.listOfICD10.length == 0) { - await model.getMasterLookup(MasterKeysService.ICD10); - } + + model.callAddAssessmentLookupsServices(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addAssessmentDetails), backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( child: Center( child: Column( children: [ - BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails!), FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -135,7 +132,7 @@ class _AddAssessmentDetailsState extends State { margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: AppTextFieldCustom( // height: 55.0, - hintText: TranslationBase.of(context).appointmentNumber, + height: Helpers.getTextFieldHeight(),hintText: TranslationBase.of(context).appointmentNumber, isTextFieldHasSuffix: false, enabled: false, controller: appointmentIdController, @@ -176,7 +173,7 @@ class _AddAssessmentDetailsState extends State { suggestion.code.toLowerCase().startsWith(input.toLowerCase()), ), ) - : AppTextFieldCustom( + : AppTextFieldCustom(height: Helpers.getTextFieldHeight(), onClick: model.listOfICD10 != null ? () { setState(() { @@ -186,7 +183,7 @@ class _AddAssessmentDetailsState extends State { } : null, hintText: TranslationBase.of(context).nameOrICD, - maxLines: 2, + maxLines: 1, minLines: 1, controller: icdNameController, enabled: true, @@ -197,18 +194,43 @@ class _AddAssessmentDetailsState extends State { Icons.search, color: Colors.grey.shade600, )), - )), + )),), + + if(widget.mySelectedAssessment + .selectedICD != null) + Column( + children: [ + SizedBox( + height: 3, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.7, + child: AppText( + widget.mySelectedAssessment + .selectedICD.description + + (' (${widget.mySelectedAssessment + .selectedICD.code} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + ], ), SizedBox( height: 7, ), AppTextFieldCustom( - onClick: model.listOfDiagnosisCondition != null + height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisCondition != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisCondition, okText: TranslationBase.of(context).ok, - okFunction: (MasterKeyModel selectedValue) { + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,okFunction: (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; conditionController.text = projectViewModel.isArabic @@ -227,7 +249,7 @@ class _AddAssessmentDetailsState extends State { } : null, hintText: TranslationBase.of(context).condition, - maxLines: 2, + maxLines: 1, minLines: 1, controller: conditionController, isTextFieldHasSuffix: true, @@ -242,12 +264,12 @@ class _AddAssessmentDetailsState extends State { height: 10, ), AppTextFieldCustom( - onClick: model.listOfDiagnosisType != null + height: Helpers.getTextFieldHeight(),onClick: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisType, okText: TranslationBase.of(context).ok, - okFunction: (MasterKeyModel selectedValue) { + selectedValue: widget.mySelectedAssessment.selectedDiagnosisType,okFunction: (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; typeController.text = @@ -265,7 +287,7 @@ class _AddAssessmentDetailsState extends State { } : null, hintText: TranslationBase.of(context).dType, - maxLines: 2, + maxLines: 1, minLines: 1, enabled: false, isTextFieldHasSuffix: true, @@ -292,39 +314,20 @@ class _AddAssessmentDetailsState extends State { ), ), SizedBox( - height: 10, - ), - ])), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + + ), + ])), ), ], ), ), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: Colors.green, - title: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), - loading: model.state == ViewState.BusyLocal, - onPressed: () async { + bottomSheet: model.state == ViewState.Busy?Container(height: 0,): + + BottomSheetDialogButton( + label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), + onTap: () async { setState(() { isFormSubmitted = true; }); @@ -339,15 +342,7 @@ class _AddAssessmentDetailsState extends State { mySelectedAssessment: widget.mySelectedAssessment); } }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), + ), ), ), @@ -356,6 +351,7 @@ class _AddAssessmentDetailsState extends State { submitAssessment( {required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -385,8 +381,9 @@ class _AddAssessmentDetailsState extends State { await model.postAssessment(postAssessmentRequestModel); } - + GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -394,10 +391,7 @@ class _AddAssessmentDetailsState extends State { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; - - if (!isUpdate) { - widget.addSelectedAssessment(mySelectedAssessment, isUpdate); - } + widget.addSelectedAssessment(mySelectedAssessment, isUpdate); Navigator.of(context).pop(); } } diff --git a/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart b/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart new file mode 100644 index 00000000..331b2d15 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart @@ -0,0 +1,3 @@ +abstract class AssessmentCallBack{ + nextFunction(model); +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 66467177..f42289f9 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -1,73 +1,63 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../shared_soap_widgets/SOAP_open_items.dart'; import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import 'add_assessment_details.dart'; +import 'assessment_call_back.dart'; // ignore: must_be_immutable class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; - List mySelectedAssessmentList; final PatiantInformtion patientInfo; final Function changeLoadingState; final int currentIndex; UpdateAssessmentPage( {Key? key, - required this.changePageViewIndex, - required this.mySelectedAssessmentList, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); } -class _UpdateAssessmentPageState extends State { +class _UpdateAssessmentPageState extends State + implements AssessmentCallBack { bool isAssessmentExpand = false; + List mySelectedAssessmentList = []; + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - widget.mySelectedAssessmentList.clear(); - GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: widget.patientInfo.appointmentNo); - await model.getPatientAssessment(getAssessmentReqModel); + model.setAssessmentCallBack(this); + mySelectedAssessmentList.clear(); + + await model.onUpdateAssessmentStepStart(widget.patientInfo); + if (model.patientAssessmentList.isNotEmpty) { - if (model.listOfDiagnosisCondition.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisCondition); - } - if (model.listOfDiagnosisType.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisType); - } - if (model.listOfICD10.length == 0) { - await model.getMasterLookup(MasterKeysService.ICD10); - } model.patientAssessmentList.forEach((element) { MasterKeyModel? diagnosisType = model.getOneMasterKey( masterKeys: MasterKeysService.DiagnosisType, @@ -82,11 +72,11 @@ class _UpdateAssessmentPageState extends State { id: element.conditionID, ); if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( - appointmentId: element.appointmentNo, + MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, selectedICD: selectedICD, doctorID: element.doctorID, doctorName: element.doctorName, @@ -94,7 +84,7 @@ class _UpdateAssessmentPageState extends State { createdOn: element.createdOn, icdCode10ID: element.icdCode10ID); - widget.mySelectedAssessmentList.add(temMySelectedAssessment); + mySelectedAssessmentList.add(temMySelectedAssessment); } }); } @@ -102,350 +92,394 @@ class _UpdateAssessmentPageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).assessment, - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - SOAPOpenItems( - label: "${TranslationBase.of(context).addAssessment}", - onTap: () { - openAssessmentDialog(context, isUpdate: false, model: model); - }, - ), - SizedBox( - height: 20, - ), - Column( - children: widget.mySelectedAssessmentList.map((assessment) { - return Container( - margin: EdgeInsets.only(left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RichText( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + SOAPOpenItems( + label: + "${TranslationBase.of(context).addAssessment}", + onTap: () { + openAssessmentDialog(context, + isUpdate: false, model: model); + }, + ), + SizedBox( + height: 20, + ), + Column( + children: + mySelectedAssessmentList.map((assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15, bottom: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), + ), + new TextSpan( + text: assessment + .selectedICD.code + .trim() + .toUpperCase() ?? + ""), + ], + ), + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), children: [ new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment.selectedICD!.code.trim().toUpperCase() ?? "", + text: assessment + .selectedICD.description + .toString(), ), ], ), ), - Container( - width: MediaQuery.of(context).size.width * 0.50, - child: RichText( - text: new TextSpan( + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .appointmentNo, style: new TextStyle( - fontSize: 16, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: assessment.selectedICD!.description.toString(), - ), - ], + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), ), - ), + new TextSpan( + text: assessment.appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of(context).appointmentNo, - style: new TextStyle( - color: Color(0xFF575757), - ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), ), - new TextSpan( - text: assessment.appointmentId.toString(), - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), - ), + ), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), ), - ], - ), + ), + ], ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of(context).condition! + " : ", - style: new TextStyle( - color: Color(0xFF575757), - ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .dType + + ' : ', + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), ), - new TextSpan( - text: projectViewModel.isArabic - ? assessment.selectedDiagnosisCondition!.nameAr - : assessment.selectedDiagnosisCondition!.nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), - ), + ), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), ), - ], - ), + ), + ], ), + ), + if (assessment.doctorName != null) RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + fontWeight: + FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of(context).dType! + ' : ', + text: TranslationBase.of( + context) + .doctor + + ' : ', style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel.isArabic - ? assessment.selectedDiagnosisType!.nameAr - : assessment.selectedDiagnosisType!.nameEn, + text: + assessment.doctorName ?? + '', style: new TextStyle( - fontSize: 14, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, color: Color(0xFF2B353E), ), ), ], ), ), - if (assessment.doctorName != null) - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of(context).doc! + ' : ', - style: new TextStyle( - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment.doctorName ?? '', - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), - ), - ), - ], - ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - (assessment.remark != null || assessment.remark != '') - ? TranslationBase.of(context).remarks! + " : " - : '', - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - Container( - width: MediaQuery.of(context).size.width * 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + AppText( + (assessment.remark != null && + assessment.remark != + '') + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + RemarkText( + remark: assessment.remark ?? "", + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, ), - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - DateTime.parse(assessment.createdOn ?? "")) - : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse(assessment.createdOn ?? "")) - : AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], - ), - ], - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.05, - ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, assessment: assessment, model: model); - }, - child: Icon( - DoctorApp.edit, - size: 18, + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], ), - ) - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpanded: isAssessmentExpand, - ), - SizedBox( - height: 130, - ), - ], - ), + ], + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, + ), + ) + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ) + ]), + isExpanded: isAssessmentExpand, + ), + SizedBox( + height: 130, + ), + ], ), ), ), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ), - ), - SizedBox( - width: 5, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, - ), - ), - ], - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - )), + ), + ), ); } openAssessmentDialog(BuildContext context, {MySelectedAssessment? assessment, required bool isUpdate, required SOAPViewModel model}) { if (assessment == null) { - assessment = MySelectedAssessment(remark: '', appointmentId: widget.patientInfo.appointmentNo); + assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -456,12 +490,23 @@ class _UpdateAssessmentPageState extends State { mySelectedAssessment: assessment!, patientInfo: widget.patientInfo, isUpdate: isUpdate, - mySelectedAssessmentList: widget.mySelectedAssessmentList, + mySelectedAssessmentList: mySelectedAssessmentList, addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { - widget.mySelectedAssessmentList.add(mySelectedAssessment); + if (!isUpdate) + mySelectedAssessmentList.add(mySelectedAssessment); }); }); }); } + + @override + nextFunction(model) { + if (mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(3); + } + } } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index ddc6d10f..3f55b8f4 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -1,21 +1,20 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'examinations_list_search_widget.dart'; class AddExaminationPage extends StatefulWidget { final List mySelectedExamination; - final Function addSelectedExamination; + final Function (List)addSelectedExamination; final Function(MasterKeyModel) removeExamination; AddExaminationPage( @@ -26,6 +25,14 @@ class AddExaminationPage extends StatefulWidget { } class _AddExaminationPageState extends State { + List mySelectedExaminationLocal; + + @override + initState() { + super.initState(); + mySelectedExaminationLocal = [...widget.mySelectedExamination]; + } + @override Widget build(BuildContext context) { return BaseView( @@ -36,40 +43,17 @@ class _AddExaminationPageState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: "${TranslationBase.of(context).addExamination}", + ), backgroundColor: Color.fromRGBO(248, 248, 248, 1), body: Column( mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(left: 16, top: 70, right: 16, bottom: 16), - color: Colors.white, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + children: [ Expanded( - child: AppText( - "${TranslationBase.of(context).addExamination}", - fontSize: SizeConfig.textMultiplier * 3.3, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - ), - InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: Icon( - Icons.clear, - size: 40, - ), - ) - ], - ), - ), - Expanded( - child: SingleChildScrollView( + child: SingleChildScrollView( child: Column( children: [ Container( @@ -87,17 +71,18 @@ class _AddExaminationPageState extends State { child: Column( children: [ ExaminationsListSearchWidget( - masterList: model.physicalExaminationList, + mySelectedExamination: + widget.mySelectedExamination,masterList: model.physicalExaminationList, isServiceSelected: (master) => isServiceSelected(master), - removeHistory: (history) { + removeExamination: (selectedExamination) { setState(() { - widget.removeExamination(history); + mySelectedExaminationLocal.remove(selectedExamination); }); }, - addHistory: (selectedExamination) { - setState(() { - widget.mySelectedExamination.add(selectedExamination); - }); + addExamination: (selectedExamination) { + + mySelectedExaminationLocal.insert(0, selectedExamination); + // setState(() {}); }, ), ], @@ -109,47 +94,21 @@ class _AddExaminationPageState extends State { ), ], ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: "${TranslationBase.of(context).addExamination}", + onTap: () { + widget.addSelectedExamination(mySelectedExaminationLocal); + }, ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: "${TranslationBase.of(context).addExamination}", - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addSelectedExamination(); - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - ), )); } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = widget.mySelectedExamination.where((element) => + Iterable exam = mySelectedExaminationLocal.where((element) => masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); if (exam.length > 0) { return true; diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 98e86748..e6df38e7 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; @@ -15,19 +15,21 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class AddExaminationWidget extends StatefulWidget { MasterKeyModel item; - final Function(MasterKeyModel) removeHistory; - final Function(MySelectedExamination) addHistory; + final Function(MySelectedExamination) removeExamination; + final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; bool isExpand; final VoidCallback expandClick; + final List mySelectedExamination; AddExaminationWidget({ required this.item, - required this.removeHistory, - required this.addHistory, + required this.removeExamination, + required this.addExamination, required this.isServiceSelected, required this.isExpand, required this.expandClick, + this.mySelectedExamination, }); @override @@ -35,13 +37,23 @@ class AddExaminationWidget extends StatefulWidget { } class _AddExaminationWidgetState extends State { - int status = 3; + int status = 1; TextEditingController remarksController = TextEditingController(); MySelectedExamination examination = MySelectedExamination(); @override void initState() { - examination.selectedExamination = widget.item; + if (getSelectedExam(widget.item) != null) { + examination = getSelectedExam(widget.item); + status = examination.isNormal + ? 1 + : examination.isAbnormal + ? 2 + : 3; + remarksController.text = examination.remark; + } else { + examination.selectedExamination = widget.item; + } super.initState(); } @@ -54,37 +66,32 @@ class _AddExaminationWidgetState extends State { headerWidget: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child: CheckboxListTile( - title: AppText( - projectViewModel.isArabic - ? widget.item.nameAr != null && widget.item.nameAr != "" - ? widget.item.nameAr - : widget.item.nameEn - : widget.item.nameEn, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, - ), - value: widget.isServiceSelected(widget.item), - activeColor: HexColor("#D02127"), - onChanged: (newValue) { - setState(() { - if (widget.isServiceSelected(widget.item)) { - widget.removeHistory(widget.item); - widget.expandClick(); - } else { - examination.isNormal = status == 1; - examination.isAbnormal = status == 2; - examination.notExamined = status == 3; - examination.remark = remarksController.text; - widget.addHistory(examination); - widget.expandClick(); - } - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), + InkWell( + onTap: (){ + onExamTap(); + }, + child: Row( + children: [ + Checkbox( + value:widget.isServiceSelected(widget.item), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + onExamTap(); + }), + Container( + child: AppText( + projectViewModel.isArabic + ? widget.item.nameAr != null && widget.item.nameAr != "" + ? widget.item.nameAr + : widget.item.nameEn + : widget.item.nameEn, + + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8), + letterSpacing: -0.56, + ), + ), + ], ), ), Container( @@ -112,18 +119,18 @@ class _AddExaminationWidgetState extends State { Row( children: [ Expanded( - child: Row( - children: [ - InkWell( - onTap: () { - setState(() { - status = 1; - }); - examination.isNormal = true; - examination.isAbnormal = false; - examination.notExamined = false; - }, - child: Container( + child: InkWell( + onTap: () { + setState(() { + status = 1; + }); + examination.isNormal = true; + examination.isAbnormal = false; + examination.notExamined = false; + }, + child: Row( + children: [ + Container( padding: EdgeInsets.all(2.0), margin: EdgeInsets.symmetric(horizontal: 6), width: 20, @@ -140,28 +147,28 @@ class _AddExaminationWidgetState extends State { ), ), ), - ), - AppText( - TranslationBase.of(context).normal, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - ), - ], + AppText( + TranslationBase.of(context).normal, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], + ), )), Expanded( - child: Row( - children: [ - InkWell( - onTap: () { - setState(() { - status = 2; - }); - examination.isNormal = false; - examination.isAbnormal = true; - examination.notExamined = false; - }, - child: Container( + child: InkWell( + onTap: () { + setState(() { + status = 2; + }); + examination.isNormal = false; + examination.isAbnormal = true; + examination.notExamined = false; + }, + child: Row( + children: [ + Container( padding: EdgeInsets.all(2.0), margin: EdgeInsets.symmetric(horizontal: 6), width: 20, @@ -178,28 +185,28 @@ class _AddExaminationWidgetState extends State { ), ), ), - ), - AppText( - TranslationBase.of(context).abnormal, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - ), - ], + AppText( + TranslationBase.of(context).abnormal, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], + ), )), - Expanded( + if (!examination.isLocal) + Expanded( + child: InkWell( + onTap: () { + setState(() { + status = 3; + }); + examination.isNormal = false; + examination.isAbnormal = false; + examination.notExamined = true; + }, child: Row( - children: [ - InkWell( - onTap: () { - setState(() { - status = 3; - }); - examination.isNormal = false; - examination.isAbnormal = false; - examination.notExamined = true; - }, - child: Container( + children: [Container( padding: EdgeInsets.all(2.0), margin: EdgeInsets.symmetric(horizontal: 6), width: 20, @@ -216,17 +223,17 @@ class _AddExaminationWidgetState extends State { ), ), ), + Expanded( + child: AppText( + TranslationBase.of(context).notExamined, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ), + ], ), - Expanded( - child: AppText( - TranslationBase.of(context).notExamined, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - ), - ), - ], - )), + )), ], ), Container( @@ -249,4 +256,32 @@ class _AddExaminationWidgetState extends State { ), ); } + + onExamTap(){ + setState(() { + if (widget.isServiceSelected(widget.item)) { + if (examination.isLocal) + widget.removeExamination(examination); + widget.expandClick(); + } else { + examination.isNormal = status == 1; + examination.isAbnormal = status == 2; + examination.notExamined = status == 3; + examination.remark = remarksController.text; + widget.addExamination(examination); + widget.expandClick(); + } + }); + } + + MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { + Iterable exam = widget.mySelectedExamination.where( + (element) => + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + if (exam.length > 0) { + return exam.first; + } + return null; + } } diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 017ee300..7ad9dedd 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -39,52 +41,40 @@ class ExaminationItemCard extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.8, ), )), - Row( - children: [ - AppText( - TranslationBase.of(context).remove, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: Colors.red.shade800, - fontSize: SizeConfig.textMultiplier * 1.8, - ), - InkWell( - onTap: removeExamination, - child: Icon( - Icons.clear, - size: 20, - color: Colors.red.shade800, - ), - ) - ], - ), ], ), - AppText( - !examination.isNormal! - ? examination.isAbnormal! - ? TranslationBase.of(context).abnormal - : TranslationBase.of(context).notExamined - : TranslationBase.of(context).normal, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - color: !examination.isNormal! - ? examination.isAbnormal! - ? Colors.red.shade800 - : Colors.grey.shade800 - : Colors.green.shade800, - fontSize: SizeConfig.textMultiplier * 1.8, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + !examination.isNormal! + ? examination.isAbnormal! + ? TranslationBase.of(context).abnormal + : TranslationBase.of(context).notExamined + : TranslationBase.of(context).normal, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + color: !examination.isNormal! + ? examination.isAbnormal! + ? Colors.red.shade800 + : Colors.grey.shade800 + : Colors.green.shade800, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + if (!examination.notExamined) + RemoveButton( + label: examination.isLocal + ? TranslationBase.of(context).remove + : TranslationBase.of(context).notExamined, + onTap: removeExamination, + ), + ], ), SizedBox( height: 4, ), - AppText( - examination.remark, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontSize: SizeConfig.textMultiplier * 1.8, - ), + if (examination.remark.isNotEmpty) + RemarkText(remark: examination.remark), ], ), ); diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index f6b1d379..c89b30d3 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -8,16 +9,17 @@ import 'package:flutter/material.dart'; import 'add_examination_widget.dart'; class ExaminationsListSearchWidget extends StatefulWidget { - final Function(MasterKeyModel) removeHistory; - final Function(MySelectedExamination) addHistory; + final Function(MySelectedExamination) removeExamination; + final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; + final List mySelectedExamination; ExaminationsListSearchWidget( - {required this.removeHistory, - required this.addHistory, + {required this.removeExamination, + required this.addExamination, required this.isServiceSelected, - required this.masterList}); + required this.masterList, this.mySelectedExamination}); @override _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); @@ -39,10 +41,11 @@ class _ExaminationsListSearchWidgetState extends State mySelectedExamination; final PatiantInformtion patientInfo; UpdateObjectivePage( {Key? key, - required this.changePageViewIndex, - required this.mySelectedExamination, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); } -class _UpdateObjectivePageState extends State { +class _UpdateObjectivePageState extends State + implements ObjectiveCallBack { bool isSysExaminationExpand = false; + List mySelectedExamination = []; BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( @@ -62,204 +62,251 @@ class _UpdateObjectivePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); - - await model.getPatientPhysicalExam(getPhysicalExamReqModel); + model.setObjectiveCallBack(this); + mySelectedExamination.clear(); + model.isAddExamInProgress = true; + await model.getPatientPhysicalExam(widget.patientInfo); if (model.patientPhysicalExamList.isNotEmpty) { if (model.physicalExaminationList.length == 0) { await model.getMasterLookup(MasterKeysService.PhysicalExamination); } model.patientPhysicalExamList.forEach((element) { - MasterKeyModel? examMaster = model.getOneMasterKey( + MasterKeyModel examMaster = model.getOneMasterKey( masterKeys: MasterKeysService.PhysicalExamination, - id: element.examId!, + id: element.examId, + ); + MySelectedExamination tempEam = + SoapUtils.generateMySelectedExamination( + examination: examMaster, + remark: element.remarks, + isNormal: element.isNormal, + createdBy: element.createdBy, + createdOn: element.createdOn, + editedOn: element.editedOn, + notExamined: element.notExamined, + isNew: element.isNew, + isLocal: false, + isAbnormal: element.isAbnormal, ); - MySelectedExamination tempEam = MySelectedExamination( - selectedExamination: examMaster, - remark: element.remarks, - isNormal: element.isNormal, - createdBy: element.createdBy, - notExamined: element.notExamined, - isNew: element.isNew, - isAbnormal: element.isAbnormal); - widget.mySelectedExamination.add(tempEam); + mySelectedExamination.add(tempEam); }); } - widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).physicalSystemExamination, - onTap: () { - setState(() { - isSysExaminationExpand = !isSysExaminationExpand; - }); - }, - child: Column( - children: [ - SOAPOpenItems( - label: "${TranslationBase.of(context).addExamination}", - onTap: () { - openExaminationList(context); - }, - ), - Column( - children: widget.mySelectedExamination.map((examination) { - return ExaminationItemCard(examination, () { - removeExamination(examination.selectedExamination!); - }); - }).toList(), - ) - ], - ), - isExpanded: isSysExaminationExpand, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ) - ], - ), - ), - ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: 5, + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + ExpandableSOAPWidget( + headerTitle: + TranslationBase.of(context).physicalSystemExamination, + onTap: () { + setState(() { + isSysExaminationExpand = !isSysExaminationExpand; + }); + }, + child: Column( + children: [ + SOAPOpenItems( + label: + "${TranslationBase.of(context).addExamination}", + onTap: () { + openExaminationList(context); + }, + ), + if (mySelectedExamination.isNotEmpty && + mySelectedExamination.first.isLocal) + Row( + children: [ + AppText( + "New", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Color(0xFFCC9B14), + ), + ], ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, - ), + Column( + children: mySelectedExamination + .sublist( + 0, + model.getFirstIndexForOldExamination( + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) + .map((examination) { + return ExaminationItemCard(examination, () { + removeExamination( + examination.selectedExamination); + }); + }).toList(), + ), + if (mySelectedExamination.isNotEmpty && + model.getFirstIndexForOldExamination( + mySelectedExamination) > + -1) + Row( + children: [ + AppText( + "Verified", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Colors.green, + ), + ], ), - ], - ), + Column( + children: mySelectedExamination + .sublist(model.getFirstIndexForOldExamination( + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) + .map((examination) { + return ExaminationItemCard(examination, () { + removeExamination( + examination.selectedExamination); + }); + }).toList(), + ) + ], ), + isExpanded: isSysExaminationExpand, ), - ), - SizedBox( - height: 5, - ), - ], + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 14 : 12), + ) + ], + ), ), - )), + ), + ), + ), ); } submitUpdateObjectivePage(SOAPViewModel model) async { - if (widget.mySelectedExamination.isNotEmpty) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + if (mySelectedExamination.isNotEmpty) { + if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + Navigator.of(context).pop(); + }else{ + widget.changeLoadingState(true); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(ListHisProgNotePhysicalExaminationVM( + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = + new PostPhysicalExamRequestModel(); + mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = + []; + ListHisProgNotePhysicalExaminationVM + listHisProgNotePhysicalExaminationVM = + ListHisProgNotePhysicalExaminationVM( patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo == null?0: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo == null?0:widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), + createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination!.id, - examType: exam.selectedExamination!.typeId, + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, isAbnormal: exam.isAbnormal, isNormal: exam.isNormal, notExamined: exam.notExamined, - examinationType: exam.isNormal! + examinationType: exam.isNormal ? 1 - : exam.isAbnormal! - ? 2 - : 3, - examinationTypeName: exam.isNormal! + : exam.isAbnormal + ? 2 + : 3, + examinationTypeName: exam.isNormal ? "Normal" - : exam.isAbnormal! - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); - }); + : exam.isAbnormal + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew, + ); + if (widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = + int.parse(widget.patientInfo.admissionNo); + } else { + listHisProgNotePhysicalExaminationVM.admissionNo = 0; + } + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + .add(listHisProgNotePhysicalExaminationVM); + }); - if (model.patientPhysicalExamList.isEmpty) { - await model.postPhysicalExam(postPhysicalExamRequestModel); - } else { - await model.patchPhysicalExam(postPhysicalExamRequestModel); - } + if (model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); + } else { + await model.patchPhysicalExam(postPhysicalExamRequestModel); + } - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else { - widget.changeLoadingState(true); + if (model.state == ViewState.ErrorLocal) { + widget.changeLoadingState(false); + Helpers.showErrorToast(model.error); + if(widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + // Navigator.of(context).pop(); + model.isAddExamInProgress = false; + } + } else { + if(widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + // Navigator.of(context).pop(); + widget.changeLoadingState(false); + model.isAddExamInProgress = false; + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); + } - widget.changePageViewIndex(2); + } } + } else { Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } } removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination.where((element) => + Iterable history = mySelectedExamination.where( + (element) => masterKey.id == element.selectedExamination?.id && masterKey.typeId == element.selectedExamination?.typeId); - if (history.length > 0) + if (history.length > 0) { setState(() { - widget.mySelectedExamination.remove(history.first); + if (history.first.isLocal) { + mySelectedExamination.remove(history.first); + } else { + history.first.notExamined = true; + history.first.isNormal = false; + history.first.isAbnormal = false; + } }); + } } openExaminationList(BuildContext context) { @@ -267,67 +314,49 @@ class _UpdateObjectivePageState extends State { context, FadePage( page: AddExaminationPage( - mySelectedExamination: widget.mySelectedExamination, - addSelectedExamination: () { + mySelectedExamination: mySelectedExamination, + addSelectedExamination: + (List mySelectedExaminationLocal) { setState(() { - Navigator.of(context).pop(); + { + mySelectedExaminationLocal.forEach((element) { + if ((mySelectedExamination.singleWhere( + (it) => + it.selectedExamination.id == + element.selectedExamination.id, + orElse: () => null)) == + null) { + mySelectedExamination.insert(0,element); + } + }); + + /// remove items. + List removedList = []; + mySelectedExamination.forEach((element) { + if ((mySelectedExaminationLocal.singleWhere( + (it) => + it.selectedExamination.id == + element.selectedExamination.id, + orElse: () => null)) == + null) { + removedList.add(element); + } + }); + + removedList.forEach((element) { + removeExamination(element.selectedExamination); + }); + Navigator.of(context).pop(); + } }); }, removeExamination: (masterKey) => removeExamination(masterKey)), ), ); } -} - -class AddExaminationDailog extends StatefulWidget { - final List mySelectedExamination; - final Function addSelectedExamination; - final Function(MasterKeyModel) removeExamination; - const AddExaminationDailog( - {Key? key, - required this.mySelectedExamination, - required this.addSelectedExamination, - required this.removeExamination}) - : super(key: key); - - @override - _AddExaminationDailogState createState() => _AddExaminationDailogState(); -} - -class _AddExaminationDailogState extends State { @override - Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: BaseView( - onModelReady: (model) async { - if (model.physicalExaminationList.length == 0) { - await model.getMasterLookup(MasterKeysService.PhysicalExamination); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - ]), - ))), - )), - ); + nextFunction(model) async { + await submitUpdateObjectivePage(model); } } diff --git a/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart b/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart new file mode 100644 index 00000000..14fef483 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart @@ -0,0 +1,3 @@ +abstract class PlanCallBack{ + nextFunction(model); +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 702752db..f2f67f8c 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -8,15 +9,14 @@ import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model. 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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; @@ -25,25 +25,30 @@ class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; final Function changeLoadingState; + final Function changeStateFun; + final SOAPViewModel sOAPViewModel; final int currentIndex; - GetPatientProgressNoteResModel patientProgressNote; UpdatePlanPage( {Key? key, required this.changePageViewIndex, required this.patientInfo, required this.changeLoadingState, - required this.patientProgressNote, - required this.currentIndex}); + required this.currentIndex, + required this.sOAPViewModel, + this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); } -class _UpdatePlanPageState extends State { +class _UpdatePlanPageState extends State + implements PlanCallBack { bool isAddProgress = true; bool isProgressExpanded = true; + GetPatientProgressNoteResModel patientProgressNote = + GetPatientProgressNoteResModel(); TextEditingController progressNoteController = TextEditingController(text: null); @@ -62,284 +67,356 @@ class _UpdatePlanPageState extends State { @override void initState() { super.initState(); - if (widget.patientProgressNote.planNote != null) { + if (patientProgressNote.planNote != null) { setState(() { isAddProgress = false; }); } } + getPatientProgressNote(SOAPViewModel model, + {bool isAddProgress = false}) async { + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); + + ///TODO set progressNote in model; + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Helpers.parseHtmlString( + widget.sOAPViewModel.patientProgressNoteList[0].planNote); + patientProgressNote.planNote = progressNoteController.text; + + patientProgressNote.createdByName = + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + setState(() { + isAddProgress = isAddProgress; + widget.sOAPViewModel.isAddProgress = isAddProgress; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; + }); + } + } + @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( - appointmentNo: widget.patientInfo.appointmentNo, + onModelReady: (model) async { + widget.sOAPViewModel.setPlanCallBack(this);GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await model.getPatientProgressNote(getGetProgressNoteReqModel); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); - if (model.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Helpers.parseHtmlString(model.patientProgressNoteList[0].planNote ?? ""); - widget.patientProgressNote.planNote = progressNoteController.text; - widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; - widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; - widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; - widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; - setState(() { - isAddProgress = false; - }); - } - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.90, - child: Column( - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), - SizedBox( - height: 10, - ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).progressNote, - onTap: () { - setState(() { - isProgressExpanded = !isProgressExpanded; - }); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Helpers.parseHtmlString( + widget.sOAPViewModel.patientProgressNoteList[0].planNote); + patientProgressNote.planNote = progressNoteController.text; + patientProgressNote.createdByName = + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; + + setState(() { + isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; + }); + } + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.90, + child: Column( + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + SizedBox( + height: 10, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).progressNote, + onTap: () { + setState(() { + isProgressExpanded = !isProgressExpanded; + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - if (isAddProgress) - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).progressNote, - controller: progressNoteController, - minLines: 2, - maxLines: 4, - inputType: TextInputType.multiline, - onChanged: (value) { - widget.patientProgressNote.planNote = value; - }, - ), - ), - SizedBox( - height: 9, - ), - if (widget.patientProgressNote.planNote != null && !isAddProgress) - Container( - margin: EdgeInsets.only( - left: 5, - right: 5, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (isAddProgress) + Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value) { + setState(() { + patientProgressNote.planNote = + value; + model.progressNoteText = value; + widget.changeStateFun(); + }); + }, + ), + ), + SizedBox( + height: 9, ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + if (patientProgressNote.planNote != null && + !isAddProgress) + Container( + margin: EdgeInsets.only( + left: 5, + right: 5, + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText( - 'Appointment No: ', - fontSize: 12, + Row( + children: [ + AppText( + 'Appointment No: ', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + AppText( + patientProgressNote + .appointmentNo != + null + ? patientProgressNote + .appointmentNo + .toString() + : '', + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], ), AppText( - widget.patientProgressNote.appointmentNo.toString(), + patientProgressNote.createdOn != + null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + patientProgressNote + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), fontWeight: FontWeight.w600, - ), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ) ], ), - AppText( - widget.patientProgressNote.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted( - DateTime.parse(widget.patientProgressNote.createdOn ?? "")) - : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ Row( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ + // Row( + // children: [ + // AppText( + // 'Condition: ', + // fontSize: 12, + // ), + // AppText( + // patientProgressNote.mName ?? + // '', + // fontWeight: FontWeight.w600), + // ], + // ), AppText( - 'Condition: ', - fontSize: 12, - ), - AppText(widget.patientProgressNote.mName ?? '', - fontWeight: FontWeight.w600), + patientProgressNote.createdOn != + null + ? AppDateUtils.getHour( + DateTime.parse( + patientProgressNote + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ) ], ), - AppText( - widget.patientProgressNote.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse(widget.patientProgressNote.createdOn ?? "")) - : AppDateUtils.getHour(DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - progressNoteController.text, - fontSize: 10, - ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + progressNoteController.text, + fontSize: 10, + ), + ), + InkWell( + onTap: () { + setState(() { + isAddProgress = true; + widget.sOAPViewModel + .isAddProgress = true; + }); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )) + ], ), - InkWell( - onTap: () { - setState(() { - isAddProgress = true; - widget.changePageViewIndex(3, isChangeState: false); - }); - }, - child: Icon( - DoctorApp.edit, - size: 18, - )) ], ), - ], - ), - ) + ) + ], + ), ], ), - ], - ), - isExpanded: isProgressExpanded, - ), - ], - ), - ), - ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(2); - }, - ), - ), - SizedBox( - width: 5, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - disabled: progressNoteController.text.isEmpty, - onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; - widget.patientProgressNote.editedByName = doctorProfile.doctorName; - widget.patientProgressNote.createdOn = DateTime.now().toString(); - widget.patientProgressNote.planNote = progressNoteController.text; - isAddProgress = !isAddProgress; - }); - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); - } - }, - ), - ), - ], - ), + isExpanded: isProgressExpanded, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), + ), + ], ), ), ), - SizedBox( - height: 5, - ), - ], - ), - )), - ); + ), + )); } submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { - PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - planNote: widget.patientProgressNote.planNote, + widget.changeLoadingState(true); + PostProgressNoteRequestModel postProgressNoteRequestModel = + new PostProgressNoteRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + planNote: patientProgressNote.planNote, doctorID: '', editedBy: ''); - if (model.patientProgressNoteList.isEmpty) { - await model.postProgressNote(postProgressNoteRequestModel); + if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { + await widget.sOAPViewModel + .postProgressNote(postProgressNoteRequestModel); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; - await model.patchProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel + .patchProgressNote(postProgressNoteRequestModel); + } + + if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.sOAPViewModel.error); + } else { + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Helpers.parseHtmlString( + widget.sOAPViewModel.patientProgressNoteList[0].planNote); + patientProgressNote.planNote = progressNoteController.text; + patientProgressNote.createdByName = + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + + setState(() { + isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; + }); + } } + widget.changeLoadingState(false); + } else { + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + } + } - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); + @override + nextFunction(model) { + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + submitPlan(model); } else { - widget.changePageViewIndex(4, isChangeState: false); + Navigator.of(context).pop(); } } else { Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 3bf15fb4..3816dfa9 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -31,20 +32,24 @@ class SOAPOpenItems extends StatelessWidget { children: [ AppText( "$label", - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*4.5, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + letterSpacing:-0.44, ), AppText( "${TranslationBase.of(context).searchHere}", - fontSize: 13, - color: Colors.grey.shade700, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, + fontWeight: FontWeight.w500, + color: Color(0xFF575757), + letterSpacing:-0.56, ), ], )), Icon( Icons.add_box_rounded, - size: 25, + size: 28, + color: Color(0xFF2E303A), ) ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index dbe7368d..ef92e0db 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,4 +1,6 @@ -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -7,11 +9,12 @@ class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ Key? key, required this.currentIndex, - required this.changePageViewIndex, + required this.changePageViewIndex, this.patientInfo, }) : super(key: key); final int currentIndex; final Function changePageViewIndex; + final PatiantInformtion patientInfo; @override Widget build(BuildContext context) { @@ -20,27 +23,34 @@ class SOAPStepHeader extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 15, + height: SizeConfig.isHeightVeryShort?30:SizeConfig.isHeightShort?35: 15, ), AppText( TranslationBase.of(context).createNew, - fontSize: 14, - fontWeight: FontWeight.w500, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), + fontWeight: FontWeight.w700, + letterSpacing:-0.72, + color: Color(0xFF2E303A), + ), AppText( TranslationBase.of(context).episode, - fontSize: 26, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8), fontWeight: FontWeight.bold, + letterSpacing:-1.44, + color: Color(0xFF2E303A), ), Container( color: Theme.of(context).scaffoldBackgroundColor, child: StepsWidget( index: currentIndex, changeCurrentTab: changePageViewIndex, + patientInfo: patientInfo, ), ), SizedBox( - height: 30, + height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 1 : 2), ), ], ); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart new file mode 100644 index 00000000..c7d48e1c --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -0,0 +1,52 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class BottomSheetDialogButton extends StatelessWidget { + final Function onTap; + final String label; + + double headerHeight = SizeConfig.heightMultiplier * 12; + + BottomSheetDialogButton({Key? key, this.onTap, this.label}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#EFEFEF'), width: 1), + ), + height: headerHeight, + width: double.infinity, + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2)), + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + title: label, + padding: 10, + color: Color(0xFF359846), + onPressed: onTap, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index 4d05dd74..f9055e1a 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -1,24 +1,27 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:flutter/material.dart'; -class BottomSheetTitle extends StatelessWidget { - const BottomSheetTitle({ +class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { + BottomSheetTitle({ Key? key, required this.title, }) : super(key: key); final String title; + double headerHeight = SizeConfig.heightMultiplier*15; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + //padding: EdgeInsets.only(// left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), - height: 115, + height: headerHeight, + child: Center( child: Container( padding: EdgeInsets.only(left: 10, right: 10), - margin: EdgeInsets.only(top: 60), + margin: EdgeInsets.only(top: headerHeight *0.5), child: Column( children: [ Row( @@ -34,7 +37,7 @@ class BottomSheetTitle extends StatelessWidget { color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 22)), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), ], ), ), @@ -42,12 +45,15 @@ class BottomSheetTitle extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(DoctorApp.close_1, size: 20, color: Color(0xFF2B353E))) + child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth()*5, color: Color(0xFF2B353E))) ], ), - ], + ],), ), ), ); } + + @override + Size get preferredSize => Size(double.maxFinite,headerHeight); } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 360cd518..866900d9 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -24,7 +25,7 @@ class ExpandableSOAPWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), + padding: EdgeInsets.symmetric(vertical: SizeConfig.isHeightVeryShort ?10:20, horizontal: 10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -42,11 +43,13 @@ class ExpandableSOAPWidget extends StatelessWidget { onTap: onTap, child: Row( children: [ - AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black), + AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), + letterSpacing:-0.64, + fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), if (isRequired) Icon( FontAwesomeIcons.asterisk, - size: 12, + size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, ) ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart new file mode 100644 index 00000000..91ef6954 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart @@ -0,0 +1,24 @@ + +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class RemarkText extends StatelessWidget { + final String remark; + const RemarkText({ + Key key, this.remark, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width * 0.55, + child: AppText( + remark ?? '', + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart new file mode 100644 index 00000000..c64fe86a --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -0,0 +1,39 @@ + +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class RemoveButton extends StatelessWidget { + final Function onTap; + final String label; + + const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + child: Row( + children: [ + Container( + child: AppText( + label??TranslationBase.of(context).remove, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontWeight: FontWeight.w700, + color: HexColor("#D02127"), + letterSpacing:-0.48, + ), + ), + Icon( + FontAwesomeIcons.times, + color: HexColor("#D02127"), + size: SizeConfig.getTextMultiplierBasedOnWidth() *4, + ), + ], + ), + onTap: onTap, + ); + } +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart new file mode 100644 index 00000000..fb1bdcc9 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart @@ -0,0 +1,22 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class StepDetailsWidget extends StatelessWidget { + final String stepLabel; + final double marginLeft; + + const StepDetailsWidget({ + Key key, this.stepLabel, this.marginLeft = 0, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return AppText( + stepLabel, + fontWeight: FontWeight.bold, + marginLeft: marginLeft, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart new file mode 100644 index 00000000..10562d53 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -0,0 +1,52 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class StatusLabel extends StatelessWidget { + const StatusLabel({ + Key key, + this.stepId, + this.selectedStepId, + }) : super(key: key); + + final int stepId; + final int selectedStepId; + + @override + Widget build(BuildContext context) { + return Container( + width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5, + padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), + decoration: BoxDecoration( + color: stepId == selectedStepId + ? Color(0xFFF1E9D3) + : stepId < selectedStepId + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), + borderRadius: BorderRadius.all( + Radius.circular(5.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + child: Center( + child: AppText( + stepId == selectedStepId + ? TranslationBase.of(context).inProgress + : stepId < selectedStepId + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, + color: stepId == selectedStepId + ? Color(0xFFCC9B14) + : stepId < selectedStepId + ? Color(0xFF359846) + : Color(0xFF969696), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart new file mode 100644 index 00000000..22f92f00 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -0,0 +1,511 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import 'Step_details_widget.dart'; + +class StepsWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + final double height; + final PatiantInformtion patientInfo; + + StepsWidget( + {Key? key, + this.index, + this.changeCurrentTab, + this.height = 0.0, + this.patientInfo}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + double circleHeight = (SizeConfig.isHeightVeryShort + ? 30 + : SizeConfig.isHeightShort + ? 38 + : 38); + double circleTop = (SizeConfig.isHeightVeryShort + ? 12 + : SizeConfig.isHeightShort + ? 10 + : 10); + double containerHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 16 : 15); + + return !projectViewModel.isArabic + ? Stack( + children: [ + Container( + height: height == 0 ? containerHeight : height, + width: MediaQuery.of(context).size.width * 0.9, + color: Colors.transparent, + ), + Positioned( + top: 30, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * + (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty + ? 0.9 + : 0.85), + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + ), + Positioned( + top: circleTop, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 0 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 0 + ? null + : Border.all( + color: Colors.black, width: 0.75), + shape: BoxShape.circle, + color: index == 0 + ? Color(0xFFCC9B14) + : index > 0 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox(height: 5), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + StepDetailsWidget( + stepLabel: "Subjective", + ), + StatusLabel( + selectedStepId: index, + stepId: 0, + ), + ], + ), + ], + ), + ), + ), + Positioned( + top: circleTop, + left: patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty + ? MediaQuery.of(context).size.width * 0.25 + : MediaQuery.of(context).size.width * 0.71, + child: InkWell( + onTap: () => index >= 1 ? changeCurrentTab(1) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 1 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 1 + ? Color(0xFFCC9B14) + : index > 1 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + StepDetailsWidget( + stepLabel: "Objective", + ), + StatusLabel( + selectedStepId: index, + stepId: 1, + ), + ], + ), + ], + ), + ), + ), + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + left: MediaQuery.of(context).size.width * 0.47, + child: InkWell( + onTap: () { + if (index >= 3) changeCurrentTab(2); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 2 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 2 + ? Color(0xFFCC9B14) + : index > 2 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + StepDetailsWidget( + stepLabel: "Assessment", + ), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), + ], + ), + ], + ), + ), + ), + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + right: 0, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(4) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 3 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 3 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 3 + ? Color(0xFFCC9B14) + : index > 3 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + StepDetailsWidget( + stepLabel: "Plan", + marginLeft: 30, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], + ), + ], + ), + ), + ), + ], + ) + : Stack( + children: [ + Container( + height: height == 0 ? 100 : height, + width: MediaQuery.of(context).size.width * 0.9, + color: Colors.transparent, + ), + Positioned( + top: 30, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty?0.9:0.85), + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + ), + Positioned( + top: circleTop, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 0 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 0 + ? null + : Border.all( + color: Colors.black, width: 0.75), + shape: BoxShape.circle, + color: index == 0 + ? Color(0xFFCC9B14) + : index > 0 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox(height: 3), + Column( + children: [ + StepDetailsWidget( + stepLabel: "شخصي", + ), + StatusLabel( + selectedStepId: index, + stepId: 0, + ), + ], + ), + ], + ), + ), + ), + Positioned( + top: circleTop, + right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty?0.25:0.71), + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 1 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 1 + ? Color(0xFFCC9B14) + : index > 1 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox(height: 5), + Column( + children: [ + StepDetailsWidget( + stepLabel: "هدف", + ), + StatusLabel( + selectedStepId: index, + stepId: 1, + ), + ], + ), + ], + ), + ), + ), + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + right: MediaQuery.of(context).size.width * 0.50, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(2) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 2 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 2 + ? Color(0xFFCC9B14) + : index > 2 + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Padding( + padding: const EdgeInsets.only(right: 2), + child: Column( + children: [ + StepDetailsWidget( + stepLabel: "تقدير", + ), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), + ], + ), + ), + ], + ), + ), + ), + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + left: 0, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(4) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 3 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 3 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 3 + ? Color(0xFFCC9B14) + : index > 3 + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Container( + margin: EdgeInsets.only(right: index == 3 ? 15 : 0), + child: Column( + children: [ + StepDetailsWidget( + stepLabel: "خطة", + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart deleted file mode 100644 index 351af5ca..00000000 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ /dev/null @@ -1,524 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; - -class StepsWidget extends StatelessWidget { - final int index; - final Function changeCurrentTab; - final double height; - - StepsWidget({Key? key, required this.index, required this.changeCurrentTab, this.height = 0.0}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return !projectViewModel.isArabic - ? Stack( - children: [ - Container( - height: height == 0 ? 100 : height, - width: MediaQuery.of(context).size.width * 0.9, - color: Colors.transparent, - ), - Positioned( - top: 30, - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.9, - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), - ), - ), - ), - Positioned( - top: 10, - left: 0, - child: InkWell( - onTap: () => changeCurrentTab(0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 0 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 0 - ? null - : Border.all(color: Colors.black, width: 0.75), - shape: BoxShape.circle, - color: index == 0 - ? Color(0xFFCC9B14) - : index > 0 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox(height: 5), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - "Subjective", - fontWeight: FontWeight.bold, - fontSize: 12, - ), - StatusLabel( - selectedStepId: index, - stepId: 0, - ), - ], - ), - ], - ), - ), - ), - Positioned( - top: 10, - left: MediaQuery.of(context).size.width * 0.25, - child: InkWell( - onTap: () => index >= 1 ? changeCurrentTab(1) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 1 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 - ? null - : Border.all(color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 1 - ? Color(0xFFCC9B14) - : index > 1 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - "Objective", - fontWeight: FontWeight.bold, - fontSize: 12, - ), - StatusLabel( - selectedStepId: index, - stepId: 1, - ), - ], - ), - ], - ), - ), - ), - Positioned( - top: 10, - left: MediaQuery.of(context).size.width * 0.50, - child: InkWell( - onTap: () { - if (index >= 3) changeCurrentTab(2); - }, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 2 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 - ? null - : Border.all(color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 2 - ? Color(0xFFCC9B14) - : index > 2 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - "Assessment", - fontWeight: FontWeight.bold, - fontSize: 12, - ), - StatusLabel( - selectedStepId: index, - stepId: 2, - ), - ], - ), - ], - ), - ), - ), - Positioned( - top: 10, - right: 0, - child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 3 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 3 - ? null - : Border.all(color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 3 - ? Color(0xFFCC9B14) - : index > 3 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - fontSize: 12, - ), - StatusLabel( - selectedStepId: index, - stepId: 3, - ), - ], - ), - ], - ), - ), - ), - ], - ) - : Stack( - children: [ - Container( - height: height == 0 ? 100 : height, - width: MediaQuery.of(context).size.width * 0.9, - color: Colors.transparent, - ), - Positioned( - top: 30, - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.9, - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), - ), - ), - ), - Positioned( - top: 10, - right: 0, - child: InkWell( - onTap: () => changeCurrentTab(0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 0 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 0 - ? null - : Border.all(color: Colors.black, width: 0.75), - shape: BoxShape.circle, - color: index == 0 - ? Color(0xFFCC9B14) - : index > 0 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox(height: 3), - Column( - children: [ - AppText( - "شخصي", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - StatusLabel( - selectedStepId: index, - stepId: 0, - ), - ], - ), - ], - ), - ), - ), - Positioned( - top: 10, - right: MediaQuery.of(context).size.width * 0.28, - child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(1) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 1 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 - ? null - : Border.all(color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 1 - ? Color(0xFFCC9B14) - : index > 1 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox(height: 5), - Column( - children: [ - AppText( - "هدف", - fontWeight: FontWeight.bold, - fontSize: 14, - ), - StatusLabel( - selectedStepId: index, - stepId: 1, - ), - ], - ), - ], - ), - ), - ), - Positioned( - top: 10, - right: MediaQuery.of(context).size.width * 0.52, - child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(2) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 2 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 - ? null - : Border.all(color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 2 - ? Color(0xFFCC9B14) - : index > 2 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Padding( - padding: const EdgeInsets.only(right: 2), - child: Column( - children: [ - AppText( - "تقدير", - fontWeight: FontWeight.bold, - fontSize: 14, - ), - StatusLabel( - selectedStepId: index, - stepId: 2, - ), - ], - ), - ), - ], - ), - ), - ), - Positioned( - top: 10, - left: 0, - child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - width: 38, - height: 38, - decoration: BoxDecoration( - border: index == 3 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 3 - ? null - : Border.all(color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 3 - ? Color(0xFFCC9B14) - : index > 3 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Container( - margin: EdgeInsets.only(right: index == 3 ? 15 : 0), - child: Column( - children: [ - AppText( - "خطة", - fontWeight: FontWeight.bold, - fontSize: 14, - ), - StatusLabel( - selectedStepId: index, - stepId: 3, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ); - } -} - -class StatusLabel extends StatelessWidget { - const StatusLabel({ - Key? key, - required this.stepId, - required this.selectedStepId, - }) : super(key: key); - - final int stepId; - final int selectedStepId; - - @override - Widget build(BuildContext context) { - return Container( - width: 65, - padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), - decoration: BoxDecoration( - color: stepId == selectedStepId - ? Color(0xFFF1E9D3) - : stepId < selectedStepId - ? Color(0xFFD8E8DB) - : Color(0xFFCCCCCC), - borderRadius: BorderRadius.all( - Radius.circular(5.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0.30), - ), - child: AppText( - stepId == selectedStepId - ? "inProgress" - : stepId < selectedStepId - ? "Completed" - : " Locked ", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: 10, - color: stepId == selectedStepId - ? Color(0xFFCC9B14) - : stepId < selectedStepId - ? Color(0xFF359846) - : Color(0xFF969696), - ), - ); - } -} diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart new file mode 100644 index 00000000..6c5d4f02 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -0,0 +1,88 @@ +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; + +class SoapUtils { + static MySelectedHistory generateMySelectedHistory( + {history, isChecked = false, remark, isLocal = true}) { + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: isChecked, + remark: remark, + isLocal: isLocal); + return mySelectedHistory; + } + + static MySelectedAllergy generateMySelectedAllergy( + {allergy, + allergySeverity, + isChecked = false, + remark, + isLocal = true, + int createdBy, + bool isExpanded = false}) { + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( + selectedAllergy: allergy, + selectedAllergySeverity: allergySeverity, + isChecked: isChecked, + remark: remark, + isLocal: isLocal, + createdBy: createdBy, + isExpanded: isExpanded); + return mySelectedAllergy; + } + + static MySelectedExamination generateMySelectedExamination( + {examination, + allergySeverity, + isChecked = false, + remark, + isLocal = true, + isNormal, + createdBy, + createdOn, + editedOn, + notExamined, + isNew, + isAbnormal}) { + MySelectedExamination mySelectedExamination = MySelectedExamination( + selectedExamination: examination, + remark: remark, + isNormal: isNormal, + createdBy: createdBy, + createdOn: createdOn, + editedOn: editedOn, + notExamined: notExamined, + isNew: isNew, + isLocal: isLocal, + isAbnormal: isAbnormal, + ); + return mySelectedExamination; + } + + static MySelectedAssessment generateMySelectedAssessment( + {appointmentNo, + remark, + diagnosisType, + diagnosisCondition, + selectedICD, + doctorID, + doctorName, + createdBy, + createdOn, + icdCode10ID}) { + MySelectedAssessment mySelectedAssessment = MySelectedAssessment( + appointmentId: appointmentNo, + remark: remark, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: doctorID, + doctorName: doctorName, + createdBy: createdBy, + createdOn: createdOn, + icdCode10ID: icdCode10ID); + return mySelectedAssessment; + } +} diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 766f4ad1..ff5c6e6f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -1,19 +1,19 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart'; +import 'master_key_checkbox_search_allergies_widget.dart'; class AddAllergies extends StatefulWidget { final Function addAllergiesFun; @@ -42,27 +42,6 @@ class _AddAllergiesState extends State { GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon}) { - return InputDecoration( - contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle(fontSize: 10, color: Theme.of(context).hintColor, fontWeight: FontWeight.w700), - ); - } - @override Widget build(BuildContext context) { return FractionallySizedBox( @@ -78,88 +57,74 @@ class _AddAllergiesState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addAllergies??"", + ), body: Center( child: Container( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addAllergies ?? "", - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( child: Center( - child: NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchAllergiesWidget( - model: model, - masterList: model.allergiesList, - removeAllergy: (master) { - setState(() { - removeAllergyFromLocalList(master); - }); - }, - addAllergy: (MySelectedAllergy mySelectedAllergy) { - addAllergyLocally(mySelectedAllergy); - }, - addSelectedAllergy: () => widget.addAllergiesFun(myAllergiesListLocal), - isServiceSelected: (master) => isServiceSelected(master), - getServiceSelectedAllergy: (master) => getSelectedAllergy(master)!, + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchAllergiesWidget( + model: model, + masterList: model.allergiesList, + removeAllergy: (master) { + setState(() { + removeAllergyFromLocalList(master); + }); + }, + addAllergy: + (MySelectedAllergy mySelectedAllergy) { + addAllergyLocally(mySelectedAllergy); + }, + addSelectedAllergy: () { + setState(() { + widget + .addAllergiesFun(myAllergiesListLocal); + }); + }, + isServiceSelected: (master) => + isServiceSelected(master), + getServiceSelectedAllergy: (master) => + getSelectedAllergy(master), + ), + ), ), ), ), ), - ), - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.11, - ), - ]), - ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context).addAllergies, - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addAllergiesFun(myAllergiesListLocal); - }, - ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, ), - ), - ), - SizedBox( - height: 5, - ), - ], + ]), ), ), + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: TranslationBase.of(context).addAllergies, + onTap: () { + setState(() { + widget.addAllergiesFun(myAllergiesListLocal); + }); + }, + ), ), ), ); @@ -214,3 +179,4 @@ class _AddAllergiesState extends State { } } } + diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart new file mode 100644 index 00000000..cceab871 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -0,0 +1,200 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../soap_utils.dart'; + +class AddAllergiesItem extends StatefulWidget { + final SOAPViewModel model; + final Function(MasterKeyModel) removeAllergy; + final Function(MySelectedAllergy mySelectedAllergy) addAllergy; + final bool Function(MasterKeyModel) isServiceSelected; + final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; + + final MasterKeyModel item; + + const AddAllergiesItem( + {Key? key, + this.model, + this.removeAllergy, + this.addAllergy, + this.isServiceSelected, + this.getServiceSelectedAllergy, + this.item}) + : super(key: key); + + @override + _AddAllergiesItemState createState() => _AddAllergiesItemState(); +} + +class _AddAllergiesItemState extends State { + MasterKeyModel _selectedAllergySeverity; + bool isSubmitted = false; + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + bool isSelected = widget.isServiceSelected(widget.item); + MySelectedAllergy mySelectedAllergy; + if (isSelected) { + mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item); + } + TextEditingController remarkController = TextEditingController( + text: isSelected ? mySelectedAllergy.remark : null); + TextEditingController severityController = TextEditingController( + text: isSelected + ? mySelectedAllergy.selectedAllergySeverity != null + ? projectViewModel.isArabic + ? mySelectedAllergy.selectedAllergySeverity.nameAr + : mySelectedAllergy.selectedAllergySeverity.nameEn + : null + : null); + return HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Checkbox( + value: widget.isServiceSelected(widget.item), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + onTapItem(); + }), + InkWell( + onTap: onTapItem, + child: Container( + child: AppText( + projectViewModel.isArabic + ? widget.item.nameAr != "" + ? widget.item.nameAr + : widget.item.nameEn + : widget.item.nameEn, + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3:3.8), + letterSpacing: -0.56, + ), + width: MediaQuery.of(context).size.width * 0.55, + ), + ), + ], + ), + InkWell( + onTap: () { + if (mySelectedAllergy != null) { + setState(() { + mySelectedAllergy.isExpanded = + mySelectedAllergy.isExpanded ? false : true; + }); + } + }, + child: Icon( + (mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) + ? EvaIcons.arrowIosUpwardOutline + : EvaIcons.arrowIosDownwardOutline, + color: Color(0xFF575757), + size: 20, + ), + ) + ], + ), + bodyWidget: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: Column( + children: [ + AppTextFieldCustom( + onClick: widget.model.allergySeverityList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: widget.model.allergySeverityList, + selectedValue: + mySelectedAllergy.selectedAllergySeverity, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + mySelectedAllergy.selectedAllergySeverity = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + isTextFieldHasSuffix: true, + hintText: TranslationBase.of(context).selectSeverity + "*", + enabled: false, + maxLines: 1, + minLines: 1, + height: Helpers.getTextFieldHeight(), + validationError: mySelectedAllergy != null && + mySelectedAllergy.selectedAllergySeverity == null && + mySelectedAllergy.hasValidationError + ? TranslationBase.of(context).severityValidationError + : null, + controller: severityController, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + controller: remarkController, + maxLines: 25, + minLines: 3, + hasBorder: true, + onChanged: (value) { + mySelectedAllergy.remark = value; + }, + inputType: TextInputType.multiline, + ), + SizedBox( + height: 10, + ), + ], + ), + ), + ), + ), + isExpand: + mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false, + ); + } + + onTapItem() { + setState(() { + if (widget.isServiceSelected(widget.item)) { + widget.removeAllergy(widget.item); + } else { + MySelectedAllergy mySelectedAllergy = + SoapUtils.generateMySelectedAllergy( + allergy: widget.item, + allergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); + widget.addAllergy(mySelectedAllergy); + } + }); + } +} diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart new file mode 100644 index 00000000..2c13c5b2 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -0,0 +1,147 @@ +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'allergies_item.dart'; + + +class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { + final SOAPViewModel model; + final Function() addSelectedAllergy; + final Function(MasterKeyModel) removeAllergy; + final Function(MySelectedAllergy mySelectedAllergy) addAllergy; + final bool Function(MasterKeyModel) isServiceSelected; + final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; + + final List masterList; + final String buttonName; + final String hintSearchText; + + MasterKeyCheckboxSearchAllergiesWidget( + {Key? key, + this.model, + this.addSelectedAllergy, + this.removeAllergy, + this.masterList, + this.addAllergy, + this.isServiceSelected, + this.buttonName, + this.hintSearchText, + this.getServiceSelectedAllergy}) + : super(key: key); + + @override + _MasterKeyCheckboxSearchAllergiesWidgetState createState() => + _MasterKeyCheckboxSearchAllergiesWidgetState(); +} + +class _MasterKeyCheckboxSearchAllergiesWidgetState + extends State { + List items = []; + TextEditingController filteredSearchController = TextEditingController(); + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Expanded( + child: Container( + height: Helpers.getTextFieldHeight(), + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + AppTextFieldCustom( + hintText: + TranslationBase.of(context).selectAllergy, + isTextFieldHasSuffix: true, + hasBorder: false, + controller: filteredSearchController, + onChanged: (value) { + filterSearchResults(value); + }, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + )), + ), + DividerWithSpacesAround(), + SizedBox( + height: 10, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + height: + MediaQuery.of(context).size.height * 0.60, + child: ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) { + + return AddAllergiesItem( + item:items[index], + model: widget.model, + removeAllergy: widget.removeAllergy, + addAllergy:widget.addAllergy, + isServiceSelected: widget.isServiceSelected, + getServiceSelectedAllergy: widget.getServiceSelectedAllergy, + ); + }, + ), + ), + ), + ), + ], + ))), + ), + ), + SizedBox( + height: 10, + ), + ], + ), + ); + } + + void filterSearchResults(String query) { + List dummySearchList = []; + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = []; + dummySearchList.forEach((items) { + if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || + items.nameEn.toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(items); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +} diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 3254cfdd..b0902519 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,12 +1,13 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../shared_soap_widgets/SOAP_open_items.dart'; @@ -35,8 +36,9 @@ class _UpdateAllergiesWidgetState extends State { SOAPOpenItems( label: "${TranslationBase.of(context).addAllergies}", onTap: () { - openAllergiesList(context, changeAllState); + openAllergiesList(context, changeAllState, removeAllergy); }, + ), SizedBox( height: 20, @@ -61,41 +63,38 @@ class _UpdateAllergiesWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergy!.nameAr - : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy!.nameAr + : selectedAllergy.selectedAllergy!.nameEn!.toUpperCase(), textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, bold: true, - color: Color(0xFF2B353E)), + color: Color(0xFF2B353E), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + // fontHeight:0.18 , + ), AppText( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity!.nameAr - : selectedAllergy.selectedAllergySeverity!.nameEn!.toUpperCase(), - textDecoration: selectedAllergy.isChecked! ? null : TextDecoration.lineThrough, - color: Color(0xFFCC9B14)), + projectViewModel.isArabic + ? selectedAllergy + .selectedAllergySeverity.nameAr + : selectedAllergy + .selectedAllergySeverity.nameEn + .toUpperCase(), + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + color: Color(0xFFCC9B14), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + ), ], ), width: MediaQuery.of(context).size.width * 0.5, ), if (selectedAllergy.isChecked!) - InkWell( - child: Row( - children: [ - Container( - child: AppText( - TranslationBase.of(context).remove, - fontSize: 15, - variant: "bodyText", - color: HexColor("#B8382C"), - ), - ), - Icon( - FontAwesomeIcons.times, - color: HexColor("#B8382C"), - size: 20, - ), - ], - ), + RemoveButton( onTap: () => removeAllergy(selectedAllergy), ) ], @@ -104,14 +103,7 @@ class _UpdateAllergiesWidgetState extends State { padding: const EdgeInsets.symmetric(vertical: 8), child: Row( children: [ - Container( - width: MediaQuery.of(context).size.width * 0.55, - child: AppText( - selectedAllergy.remark ?? '', - fontSize: 10, - color: Colors.grey, - ), - ), + RemarkText(remark: selectedAllergy.remark,), ], ), ), @@ -135,19 +127,24 @@ class _UpdateAllergiesWidgetState extends State { widget.myAllergiesList .where((element) => mySelectedAllergy.selectedAllergySeverity!.id == element.selectedAllergySeverity!.id && - mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id) + mySelectedAllergy.selectedAllergy!.id == + element.selectedAllergy!.id) .toList(); if (allergy.length > 0) { + if (allergy.first.isLocal) { + setState(() { + widget.myAllergiesList.remove(allergy.first); + }); + } setState(() { allergy[0].isChecked = false; }); } - - print(allergy); } - openAllergiesList(BuildContext context, Function changeParentState) { + openAllergiesList( + BuildContext context, Function changeParentState, removeAllergy) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, @@ -160,15 +157,38 @@ class _UpdateAllergiesWidgetState extends State { bool isAllDataFilled = true; mySelectedAllergy.forEach((element) { if (element.selectedAllergySeverity == null) { + element.hasValidationError = true; isAllDataFilled = false; } }); if (isAllDataFilled) { mySelectedAllergy.forEach((element) { - if (!widget.myAllergiesList.contains(element.selectedAllergySeverity!.id)) { + if ((widget.myAllergiesList.singleWhere( + (it) => + it.selectedAllergy.id == + element.selectedAllergy.id, + orElse: () => null)) == + null) { widget.myAllergiesList.add(element); } }); + + /// remove items. + List removedList = []; + widget.myAllergiesList.forEach((element) { + if ((mySelectedAllergy.singleWhere( + (it) => + it.selectedAllergy.id == + element.selectedAllergy.id, + orElse: () => null)) == + null) { + removedList.add(element); + } + }); + + removedList.forEach((element) { + removeAllergy(element); + }); changeParentState(); Navigator.of(context).pop(); } else { @@ -178,3 +198,5 @@ class _UpdateAllergiesWidgetState extends State { }); } } + + diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 82d84ba4..cb0598cd 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -1,15 +1,16 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart'; import 'priority_bar.dart'; @@ -56,12 +57,13 @@ class _AddHistoryDialogState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, + appBar: + BottomSheetTitle(title: TranslationBase.of(context).addHistory), body: Center( child: Container( child: Column( children: [ - BottomSheetTitle(title: TranslationBase.of(context).addHistory!), SizedBox( height: 10, ), @@ -100,14 +102,16 @@ class _AddHistoryDialogState extends State { addSelectedHistories: () { widget.addSelectedHistories(); }, - isServiceSelected: (master) => isServiceSelected(master), + isServiceSelected: (master) => + isServiceSelected(master), ), ), NetworkBaseView( baseViewModel: model, child: MasterKeyCheckboxSearchWidget( model: model, - masterList: model.mergeHistorySurgicalWithHistorySportList, + masterList: model + .mergeHistorySurgicalWithHistorySportList, removeHistory: (history) { setState(() { widget.removeHistory(history); @@ -121,7 +125,8 @@ class _AddHistoryDialogState extends State { addSelectedHistories: () { widget.addSelectedHistories(); }, - isServiceSelected: (master) => isServiceSelected(master), + isServiceSelected: (master) => + isServiceSelected(master), ), ), NetworkBaseView( @@ -142,7 +147,8 @@ class _AddHistoryDialogState extends State { addSelectedHistories: () { widget.addSelectedHistories(); }, - isServiceSelected: (master) => isServiceSelected(master), + isServiceSelected: (master) => + isServiceSelected(master), ), ), ], @@ -155,42 +161,16 @@ class _AddHistoryDialogState extends State { ], )), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context).addSelectedHistories, - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addSelectedHistories(); - }, - ), - ), - ), - ), - SizedBox( - height: 5, + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: TranslationBase.of(context).addSelectedHistories, + onTap: () { + widget.addSelectedHistories(); + }, ), - ], - ), - ), ), )); } @@ -204,7 +184,11 @@ class _AddHistoryDialogState extends State { if (myhistory.isEmpty) { setState(() { MySelectedHistory mySelectedHistory = - MySelectedHistory(remark: history.remarks ?? "", selectedHistory: history, isChecked: true); + SoapUtils.generateMySelectedHistory( + remark: history.remarks ?? "", + history: history, + isChecked: true); + widget.myHistoryList.add(mySelectedHistory); }); } else { @@ -215,8 +199,8 @@ class _AddHistoryDialogState extends State { isServiceSelected(MasterKeyModel masterKey) { Iterable history = widget.myHistoryList.where((element) => masterKey.id == element.selectedHistory!.id && - masterKey.typeId == element.selectedHistory!.typeId && - element.isChecked!); + masterKey.typeId == element.selectedHistory!.typeId && + element.isChecked!); if (history.length > 0) { return true; } diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index 250fac6d..94919109 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -63,7 +64,7 @@ class _PriorityBarState extends State { (projectViewModel.isArabic) ? _prioritiesAr[index] : item, textAlign: TextAlign.center, style: TextStyle( - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, color: Colors.black, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index 29071248..f0512273 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -1,11 +1,11 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../shared_soap_widgets/SOAP_open_items.dart'; @@ -59,35 +59,20 @@ class _UpdateHistoryWidgetState extends State with TickerPr children: [ Container( child: AppText( - projectViewModel.isArabic - ? myHistory.selectedHistory!.nameAr - : myHistory.selectedHistory!.nameEn, - fontSize: 15, + projectViewModel.isArabic + ? myHistory.selectedHistory!.nameAr + : myHistory.selectedHistory!.nameEn, + textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, - color: Colors.black), + color: Color(0xFF2B353E), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.48,), width: MediaQuery.of(context).size.width * 0.5, ), - if (myHistory.isChecked!) - InkWell( - child: Row( - children: [ - Container( - child: AppText( - TranslationBase.of(context).remove, - fontSize: 15, - variant: "bodyText", - textDecoration: myHistory.isChecked! ? null : TextDecoration.lineThrough, - color: HexColor("#B8382C"), - ), - ), - Icon( - FontAwesomeIcons.times, - color: HexColor("#B8382C"), - size: 17, - ), - ], - ), - onTap: () => removeHistory(myHistory.selectedHistory!), + if (myHistory.isChecked) + RemoveButton( + onTap: () => removeHistory(myHistory.selectedHistory), ) ], ), @@ -111,10 +96,17 @@ class _UpdateHistoryWidgetState extends State with TickerPr historyKey.id == element.selectedHistory!.id && historyKey.typeId == element.selectedHistory!.typeId) .toList(); - if (history.length > 0) - setState(() { - history[0].isChecked = false; - }); + if (history.length > 0){ + if (history.first.isLocal) { + setState(() { + widget.myHistoryList.remove(history.first); + }); + } else { + setState(() { + history[0].isChecked = false; + }); + } + } } openHistoryList(BuildContext context) { diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 5397c622..d2048a62 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -1,21 +1,22 @@ // ignore: must_be_immutable import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart'; @@ -49,113 +50,162 @@ class _AddMedicationState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery.of(context).size; return FractionallySizedBox( child: BaseView( onModelReady: (model) async { - if (model.medicationStrengthList.length == 0) { - await model.getMasterLookup( - MasterKeysService.MedicationStrength, - ); - } - if (model.medicationFrequencyList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationFrequency); - } - if (model.medicationDoseTimeList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationDoseTime); - } - if (model.medicationRouteList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationRoute); - } - if (model.allMedicationList.length == 0) await model.getMedicationList(); + model.onAddMedicationStart(); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - BottomSheetTitle( - title: TranslationBase.of(context).addMedication ?? "", - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 16, - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null!; - }); - } - : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && _selectedMedication == null, - child: AutoCompleteTextField( - decoration: TextFieldsUtils.textFieldSelectorDecoration( - TranslationBase.of(context).searchMedicineNameHere!, "", true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() => _selectedMedication = item), - suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => new Padding( - child: AppText(suggestion.description! + '/' + suggestion.genericName!), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()), + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addMedication, + ), + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 2 + : SizeConfig.isHeightShort + ? 2 + : 2), + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + _selectedMedication == null, + child: AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase.of( + context) + .searchMedicineNameHere, + null, + true, + suffixIcon: + Icons.search), + itemSubmitted: (item) => + setState(() => + _selectedMedication = + item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: AppText(suggestion + .description + + '/' + + suggestion + .genericName), + padding: EdgeInsets.all( + 8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, + input) => + suggestion.genericName.toLowerCase().startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith(input + .toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith(input + .toLowerCase()), + ), + ) + : AppTextFieldCustom( + height: + Helpers.getTextFieldHeight(), + hintText: _selectedMedication != + null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context) + .searchMedicineNameHere, + minLines: 1, + maxLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + enabled: false, + ), + ), + ), + if (_selectedMedication != null) + Column( + children: [ + SizedBox( + height: 3, ), - ) - : AppTextFieldCustom( - hintText: _selectedMedication != null - ? _selectedMedication!.description! + - (' (${_selectedMedication!.genericName} )') - : TranslationBase.of(context).searchMedicineNameHere, - minLines: 2, - maxLines: 2, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - onPressed: () {}, - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - onClick: model.medicationDoseTimeList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = selectedValue; + Container( + width: MediaQuery.of(context) + .size + .width * + 0.7, + child: AppText( + _selectedMedication.description + + (' (${_selectedMedication.genericName} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + ], + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: model.medicationDoseTimeList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: + model.medicationDoseTimeList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationDose, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! @@ -173,8 +223,8 @@ class _AddMedicationState extends State { } : null, hintText: TranslationBase.of(context).doseTime, - maxLines: 2, - minLines: 2, + maxLines: 1, + minLines: 1, isTextFieldHasSuffix: true, controller: doseController, validationError: isFormSubmitted && _selectedMedicationDose == null @@ -184,14 +234,15 @@ class _AddMedicationState extends State { SizedBox( height: 5, ), - AppTextFieldCustom( + AppTextFieldCustom(height: Helpers.getTextFieldHeight(), enabled: false, isTextFieldHasSuffix: true, onClick: model.medicationStrengthList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.medicationStrengthList, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context).ok,selectedValue: + _selectedMedicationStrength, okFunction: (selectedValue) { setState(() { _selectedMedicationStrength = selectedValue; @@ -212,8 +263,8 @@ class _AddMedicationState extends State { } : null, hintText: TranslationBase.of(context).strength, - maxLines: 2, - minLines: 2, + maxLines: 1, + minLines: 1, controller: strengthController, validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage @@ -225,14 +276,15 @@ class _AddMedicationState extends State { SizedBox( height: 5, ), - AppTextFieldCustom( + AppTextFieldCustom(height: Helpers.getTextFieldHeight(), enabled: false, isTextFieldHasSuffix: true, onClick: model.medicationRouteList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.medicationRouteList, - okText: TranslationBase.of(context).ok, + selectedValue: + _selectedMedicationRoute,okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { _selectedMedicationRoute = selectedValue; @@ -253,8 +305,8 @@ class _AddMedicationState extends State { } : null, hintText: TranslationBase.of(context).route, - maxLines: 2, - minLines: 2, + maxLines: 1, + minLines: 1, controller: routeController, validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage @@ -266,12 +318,13 @@ class _AddMedicationState extends State { SizedBox( height: 5, ), - AppTextFieldCustom( + AppTextFieldCustom(height: Helpers.getTextFieldHeight(), onClick: model.medicationFrequencyList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.medicationFrequencyList, - okText: TranslationBase.of(context).ok, + okText: TranslationBase.of(context).ok,selectedValue: + _selectedMedicationFrequency, okFunction: (selectedValue) { setState(() { _selectedMedicationFrequency = selectedValue; @@ -293,8 +346,8 @@ class _AddMedicationState extends State { : null, hintText: TranslationBase.of(context).frequency, enabled: false, - maxLines: 2, - minLines: 2, + maxLines: 1, + minLines: 1, isTextFieldHasSuffix: true, controller: frequencyController, validationError: isFormSubmitted && _selectedMedicationFrequency == null @@ -302,65 +355,42 @@ class _AddMedicationState extends State { : null, ), SizedBox( - height: 5, - ), - SizedBox( - height: 30, - ), - ], - )), - ), - ), - ]), - ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightShort + ? 15 + : 10), ), - border: Border.all(color: HexColor('#707070'), width: 0.30), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context).addMedication!.toUpperCase(), - color: Color(0xFF359846), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = widget.medicationController.text + - '${_selectedMedication!.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; - Navigator.of(context).pop(); - } - }, + ], + ), + )), ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], + ]), + ), ), - ), - ), + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: TranslationBase.of(context).addMedication, + onTap: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, + )), ), ); } diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 6aa3e1be..39bc2a21 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart new file mode 100644 index 00000000..e8d0e11f --- /dev/null +++ b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart @@ -0,0 +1,3 @@ +abstract class SubjectiveCallBack{ + Function nextFunction(model); +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 11972a72..79417789 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,25 +1,17 @@ -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/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; @@ -30,61 +22,36 @@ import 'history/update_history_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; final Function changeLoadingState; - final List myAllergiesList; - final List myHistoryList; final PatiantInformtion patientInfo; final int currentIndex; UpdateSubjectivePage( {Key? key, - required this.changePageViewIndex, - required this.myAllergiesList, - required this.myHistoryList, - required this.patientInfo, - required this.changeLoadingState, - required this.currentIndex}); + required this.changePageViewIndex, + required this.patientInfo, + required this.changeLoadingState, + required this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); } -class _UpdateSubjectivePageState extends State { +class _UpdateSubjectivePageState extends State + implements SubjectiveCallBack { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); TextEditingController medicationController = TextEditingController(); - String complaintsControllerError = ''; - String medicationControllerError = ''; - String illnessControllerError = ''; + final formKey = GlobalKey(); + List myAllergiesList = []; + List myHistoryList = []; getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); - GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo, - doctorID: '', - editedBy: ''); - - await model.getPatientHistories(getHistoryReqModel, isFirst: true); - if (model.patientHistoryList.isNotEmpty) { - if (model.historyFamilyList.isEmpty) { - await model.getMasterLookup(MasterKeysService.HistoryFamily); - } - if (model.historyMedicalList.isEmpty) { - await model.getMasterLookup(MasterKeysService.HistoryMedical); - } - if (model.historySurgicalList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistorySurgical); - } - if (model.historySportList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistorySports); - } - model.patientHistoryList.forEach((element) { if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel? history = model.getOneMasterKey( @@ -93,9 +60,12 @@ class _UpdateSubjectivePageState extends State { ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); - - widget.myHistoryList.add(mySelectedHistory); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); + myHistoryList.add(mySelectedHistory); } } if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { @@ -105,9 +75,12 @@ class _UpdateSubjectivePageState extends State { ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); - - widget.myHistoryList.add(mySelectedHistory); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); + myHistoryList.add(mySelectedHistory); } } if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { @@ -117,9 +90,12 @@ class _UpdateSubjectivePageState extends State { ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); - - widget.myHistoryList.add(mySelectedHistory); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); + myHistoryList.add(mySelectedHistory); } } if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { @@ -129,9 +105,12 @@ class _UpdateSubjectivePageState extends State { ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); - - widget.myHistoryList.add(mySelectedHistory); + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); + myHistoryList.add(mySelectedHistory); } } }); @@ -139,24 +118,16 @@ class _UpdateSubjectivePageState extends State { } getAllergies(SOAPViewModel model) async { - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - doctorID: '', - editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity); - model.patientAllergiesList.forEach((element) { MasterKeyModel? selectedAllergy = model.getOneMasterKey( masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), + nameAr: '', + nameEn: ''); } else { selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, @@ -164,13 +135,15 @@ class _UpdateSubjectivePageState extends State { )!; } - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: selectedAllergy, - isChecked: element.isChecked, - createdBy: element.createdBy, - remark: element.remarks, - selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = + SoapUtils.generateMySelectedAllergy( + allergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + remark: element.remarks, + isLocal: false, + allergySeverity: selectedAllergySeverity); + if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); } } @@ -179,16 +152,11 @@ class _UpdateSubjectivePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.myAllergiesList.clear(); - widget.myHistoryList.clear(); + myAllergiesList.clear(); + myHistoryList.clear(); + model.setSubjectiveCallBack(this); + await model.onUpdateSubjectStepStart(widget.patientInfo); - GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); - await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); @@ -197,9 +165,11 @@ class _UpdateSubjectivePageState extends State { ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' : model.patientChiefComplaintList[0].currentMedication!; } + if (widget.patientInfo.admissionNo == null) { + await getHistory(model); - await getHistory(model); - await getAllergies(model); + await getAllergies(model); + } widget.changeLoadingState(false); }, @@ -215,7 +185,11 @@ class _UpdateSubjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { @@ -228,16 +202,19 @@ class _UpdateSubjectivePageState extends State { complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController, - complaintsControllerError: complaintsControllerError, - illnessControllerError: illnessControllerError, - medicationControllerError: medicationControllerError, + complaintsControllerError: + model.complaintsControllerError, + illnessControllerError: model.illnessControllerError, + medicationControllerError: + model.medicationControllerError, ), isExpanded: isChiefExpand, ), SizedBox( - height: 30, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 4 : 2), ), - ExpandableSOAPWidget( +if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).histories, isRequired: false, onTap: () { @@ -246,14 +223,15 @@ class _UpdateSubjectivePageState extends State { }); }, child: Column( - children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)], + children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], ), isExpanded: isHistoryExpand, ), SizedBox( - height: 30, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 4 : 2), ), - ExpandableSOAPWidget( +if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false, onTap: () { @@ -264,7 +242,7 @@ class _UpdateSubjectivePageState extends State { child: Column( children: [ UpdateAllergiesWidget( - myAllergiesList: widget.myAllergiesList, + myAllergiesList: myAllergiesList, ), SizedBox( height: 30, @@ -274,197 +252,73 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height: MediaQuery.of(context).size.height * 0.16, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), ), ), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - addSubjectiveInfo( - model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList); - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - ), ), ); } addSubjectiveInfo( - {required SOAPViewModel model, - required List myAllergiesList, - required List myHistoryList}) async { - formKey.currentState!.save(); - formKey.currentState!.validate(); + {SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { + if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); + widget.changeLoadingState(true); + formKey.currentState.save(); + formKey.currentState.validate(); - complaintsControllerError = ''; - medicationControllerError = ''; - illnessControllerError = ''; + model.complaintsControllerError = ''; + model.medicationControllerError = ''; + model.illnessControllerError = ''; if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length > 25) { - await postChiefComplaint(model: model); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } + await model.postSubjectServices( + patientInfo: widget.patientInfo, + complaintsText: complaintsController.text, + medicationText: medicationController.text, + illnessText: illnessController.text, + myHistoryList: myHistoryList, + myAllergiesList: myAllergiesList, + ); - if (myHistoryList.length != 0) { - await postHistories(model: model, myHistoryList: myHistoryList); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } - } - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } - } widget.changeLoadingState(true); widget.changePageViewIndex(1); } else { setState(() { if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase.of(context).emptyMessage!; + model.complaintsControllerError = TranslationBase.of(context).emptyMessage!; } else if (complaintsController.text.length < 25) { - complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!; + model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength!; } if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase.of(context).emptyMessage!; + model.illnessControllerError = TranslationBase.of(context).emptyMessage!; } if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase.of(context).emptyMessage!; + model.medicationControllerError = TranslationBase.of(context).emptyMessage!; } }); - Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); - } - } - postAllergy({required List myAllergiesList, required SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); - - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - widget.myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy!.id, - allergyDiseaseType: allergy.selectedAllergy!.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity!.id, - remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); - }); - if (model.patientAllergiesList.isEmpty) { - await model.postAllergy(postAllergyRequestModel); - } else { - await model.patchAllergy(postAllergyRequestModel); - } - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - doctorID: '', - editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy: true); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } - } - - postHistories({required List myHistoryList, required SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); - widget.myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: "", - historyId: history.selectedHistory!.id, - historyType: history.selectedHistory!.typeId, - isChecked: history.isChecked, - )); - }); - - if (model.patientHistoryList.isEmpty) { - await model.postHistories(postHistoriesRequestModel); - } else { - await model.patchHistories(postHistoriesRequestModel); - } - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); + widget.changeLoadingState(false); + Helpers.showErrorToast( + TranslationBase.of(context).chiefComplaintErrorMsg); } } - postChiefComplaint({required SOAPViewModel model}) async { - formKey.currentState!.save(); - if (formKey.currentState!.validate()) { - PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: medicationController.text, - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - doctorID: '', - numberOfWeeks: 0); - if (model.patientChiefComplaintList.isEmpty) { - postChiefComplaintRequestModel.editedBy = ''; - await model.postChiefComplaint(postChiefComplaintRequestModel); - } else { - await model.patchChiefComplaint(postChiefComplaintRequestModel); - } - } + @override + Function nextFunction(model) { + addSubjectiveInfo( + model: model, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList); } } diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index f646dbe9..707770eb 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -1,17 +1,19 @@ -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'assessment/update_assessment_page.dart'; import 'objective/update_objective_page.dart'; @@ -31,10 +33,6 @@ class _UpdateSoapIndexState extends State with TickerProviderSt int _currentIndex = 0; List myAllergiesList = []; List myHistoryList = []; - List mySelectedExamination = []; - List mySelectedAssessment = []; - - GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); changePageViewIndex(pageIndex, {isChangeState = true}) { if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); @@ -59,84 +57,256 @@ class _UpdateSoapIndexState extends State with TickerProviderSt }); } + void changeStateFun(){ + setState(() { + + }); + } @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - return BaseView( - builder: (_, model, w) => AppScaffold( - isLoading: _isLoading, - isShowAppBar: false, - body: SingleChildScrollView( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: - BoxDecoration(boxShadow: [], color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientProfileAppBar( - patientProfileAppBarModel: - PatientProfileAppBarModel( - patient: patient), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.73, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - mySelectedExamination: mySelectedExamination, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - mySelectedAssessmentList: mySelectedAssessment, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - patientProgressNote: patientProgressNote, - changeLoadingState: changeLoadingState) - ], - ), - ) - ], - ), + return BaseView( + builder: (_,model,w)=>AppScaffold( + isLoading: _isLoading, + isShowAppBar: true, + appBar: PatientProfileAppBar(patient), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.73, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + sOAPViewModel: model, + changeStateFun: changeStateFun, + changeLoadingState: changeLoadingState) + ], ), - ], - ), + ) + ], + ), + ), + ], + ), + ), + bottomSheet:_isLoading?Container(height: 0,): Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: getBottomSheet(model, patient) ), ), - )); + SizedBox( + height: 5, + ), + ], + ), + ), + + ), + ); + } + + Widget getBottomSheet(SOAPViewModel model, PatiantInformtion patient) { + switch (_currentIndex) { + case 0: + { + return Center( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + color: Colors.red[700], + onPressed: () async { + model.nextOnSubjectPage(model); + }, + ), + ); + } + break; + case 1: + { + return Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + changePageViewIndex(0); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: patient.admissionNo != null && + patient.admissionNo.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await model.nextOnObjectivePage(model); + }, + ), + ), + ], + ), + ); + } + break; + case 2: + { + return Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + changePageViewIndex(1); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + model.nextOnAssessmentPage(model); + }, + ), + ), + ], + ), + ); + } + break; + case 3: + { + return Center( + child: Row( + children: [ + Expanded( + child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + changePageViewIndex(2); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + title: model.isAddProgress + ? TranslationBase.of(context).next + : TranslationBase.of(context).finish, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.progressNoteText.isEmpty, + onPressed: () async { + model.nextOnPlanPage(model); + }, + ), + ), + ], + ), + ); + } + break; + } } } diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index c9e08223..a2a649f0 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -34,12 +34,6 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - /*decoration: BoxDecoration( - color: Colors.transparent, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), - border: Border.all(color: Colors.grey, width: 1), - ),*/ margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, @@ -52,13 +46,6 @@ class _VitalSignDetailsWidgetState extends State { child: Container( child: Container( padding: EdgeInsets.all(8), - /*decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ),*/ child: AppText( TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, @@ -73,13 +60,6 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(8), child: Container( - /*decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ),*/ child: AppText( widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, @@ -94,13 +74,6 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(8), child: Container( - /*decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ),*/ child: AppText( widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 8b874f0f..fc3c6096 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; @@ -288,29 +290,35 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: TranslationBase.of(context).weight, - vitalList: mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), + if (isNotOneAppointment) + InkWell( + onTap: () async { + await locator().logEvent( + eventCategory: "Vital Sign Details Screen", + eventAction: "Vital Sign Details", + ); + + Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: TranslationBase.of(context).weight, + vitalList: mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).weight!, - imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg!, - lastVal: mode.weightKg, + ), + ); + }, + child: VitalSignItem( + des: TranslationBase.of(context).weight!, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg!, + lastVal: mode.weightKg, + ), ), - ), InkWell( onTap: () => isNotOneAppointment ? Navigator.push( @@ -467,7 +475,7 @@ class VitalSignDetailsScreen extends StatelessWidget { : Container( color: Theme.of(context).scaffoldBackgroundColor, child: ErrorMessage( - error: TranslationBase.of(context).vitalSignEmptyMsg ?? "", + error: TranslationBase.of(context).vitalSignEmptyMsg, )), ), ); diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart new file mode 100644 index 00000000..17405829 --- /dev/null +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -0,0 +1,95 @@ +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; + +class CustomEditableText extends StatefulWidget { + CustomEditableText({ + Key key, + @required this.controller, + this.hint, + this.isEditable = false, this.isSubmitted, + }) : super(key: key); + + final TextEditingController controller; + + final String hint; + bool isEditable; + final bool isSubmitted; + + @override + _CustomEditableTextState createState() => _CustomEditableTextState(); +} + +class _CustomEditableTextState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + if(!widget.isEditable) + Container( + height: 60, + decoration: BoxDecoration( + color: Colors.grey[300], + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(20)), + border: Border.fromBorderSide( + BorderSide( + color: Colors.grey[300], + width: 2, + ), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText(widget.hint, fontSize: 12, color: Colors.black), + AppText( + widget.controller.text, + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + InkWell( + child: Icon( + DoctorApp.edit_1, + size: 20, + + ), + onTap: () { + setState(() { + widget.isEditable = true; + }); + }, + ) + ], + ), + ), + ), + if(widget.isEditable) + AppTextFieldCustom( + hintText: widget.hint, + //TranslationBase.of(context).addoperationReports, + controller: widget.controller, + validationError: widget.controller + .text.isEmpty && + widget.isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, + maxLines: 1, + minLines: 1, + hasBorder: true, + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart new file mode 100644 index 00000000..6aaacb26 --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -0,0 +1,706 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; +import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hijri/hijri_calendar.dart'; +import 'package:intl/intl.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +import 'CustomEditableText.dart'; + +class RegisterConfirmationPatientPage extends StatefulWidget { + final OperationReportViewModel operationReportViewModel; + final PatiantInformtion patient; + final PatientRegistrationViewModel model; + + const RegisterConfirmationPatientPage( + {Key? key, this.operationReportViewModel, this.patient, this.model}) + : super(key: key); + + @override + _RegisterConfirmationPatientPageState createState() => + _RegisterConfirmationPatientPageState(); +} + +class _RegisterConfirmationPatientPageState + extends State { + bool isSubmitted = false; + ProjectViewModel projectViewModel; + TextEditingController firstNameN; + TextEditingController middleNameN; + TextEditingController lastNameN; + TextEditingController firstNameAr; + TextEditingController middleNameAr; + TextEditingController lastNameAr; + TextEditingController emailAddressController; + TextEditingController langController = TextEditingController(text: "English"); + int selectedLang = 1; + + @override + void initState() { + firstNameN = TextEditingController( + text: widget.model.getPatientInfoResponseModel.firstNameEn); + middleNameN = TextEditingController(text: ""); + lastNameN = TextEditingController( + text: widget.model.getPatientInfoResponseModel.lastNameEn); + + firstNameAr = TextEditingController( + text: widget.model.getPatientInfoResponseModel.firstNameAr); + middleNameAr = TextEditingController(text: ""); + lastNameAr = TextEditingController( + text: widget.model.getPatientInfoResponseModel.lastNameAr); + emailAddressController = TextEditingController(text: ""); + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + + ///TODO Elham* add translation + return AppScaffold( + isShowAppBar: false, + backgroundColor: Color(0xFFF8F8F8), + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.0, + ), + SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + CustomEditableText( + controller: firstNameN, + isSubmitted: isSubmitted, + hint: TranslationBase.of(context).firstName), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: middleNameN, + isEditable: middleNameN.text.isEmpty, + isSubmitted: isSubmitted, + hint: TranslationBase.of(context).middleName), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: lastNameN, + isSubmitted: isSubmitted, + hint: TranslationBase.of(context).lastName), + SizedBox( + height: 20, + ), + CustomEditableText( + controller: firstNameAr, + isSubmitted: isSubmitted, + hint: "First Name Arabic"), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: middleNameAr, + isEditable: middleNameN.text.isEmpty, + isSubmitted: isSubmitted, + hint: "Middle Name Arabic"), + SizedBox( + height: 4, + ), + CustomEditableText( + controller: lastNameAr, + isSubmitted: isSubmitted, + hint: "Last Name Arabic"), + SizedBox( + height: 20, + ), + FractionallySizedBox( + widthFactor: .9, + child: Center( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .healthID, + fontSize: 12, + color: Colors.black), + AppText( + "${widget.model.getPatientInfoResponseModel.healthId}", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .identityNumber, + fontSize: 12, + color: Colors.black), + AppText( + "${widget.model.getPatientInfoResponseModel.idNumber}", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox( + width: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .nationality, + fontSize: 12, + color: Colors.black), + AppText( + "${widget.model.getPatientInfoResponseModel.nationality}", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .occupation, + fontSize: 12, + color: Colors.black), + AppText( + "${widget.model.getPatientInfoResponseModel.occupation}", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox( + width: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .mobileNo, + fontSize: 12, + color: Colors.black), + AppText( + "${widget.model.checkPatientForRegistrationModel.patientMobileNumber}", + fontSize: 12, + color: Colors.grey[600], + ), + ], + ), + SizedBox( + width: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: () { + openMaritalStatusList(context); + }, + hintText: + TranslationBase.of(context).maritalStatus, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + + // controller: doseController, + // validationError: isFormSubmitted && + // _selectedMedicationDose == null + // ? TranslationBase.of(context) + // .emptyMessage + // : null, + ), + SizedBox( + height: 20, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: () { + openLangList(context); + }, + controller: langController, + hintText: TranslationBase.of(context).lanEnglish, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + // controller: doseController, + // validationError: isFormSubmitted && + // _selectedMedicationDose == null + // ? TranslationBase.of(context) + // .emptyMessage + // : null, + ), + SizedBox( + height: 20, + ), + AppTextFieldCustom( + hintText: "Email Address", + //TranslationBase.of(context).addoperationReports, + controller: emailAddressController, + maxLines: 1, + minLines: 1, + hasBorder: true, + validationError: + emailAddressController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 400, + ), + ], + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (isFormValid()) { + print( + widget.model.getPatientInfoResponseModel.dateOfBirth); + + var dateFormat = DateFormat('MM/dd/yyyy').parse( + widget.model.getPatientInfoResponseModel.dateOfBirth); + String wellFormat = + "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}"; + print( + dateFormat.toUtc().toString(), + ); + HijriCalendar hijriDate = HijriCalendar.fromDate( + new DateTime( + dateFormat.year, dateFormat.month, dateFormat.day), + ); + // return ; + + GifLoaderDialogUtils.showMyDialog(context); + PatientRegistrationModel patientRegistrationModel = + PatientRegistrationModel( + patientobject: Patientobject( + tempValue: true, + patientIdentificationNo: widget + .model + .checkPatientForRegistrationModel + .patientIdentificationID + .toString(), + patientIdentificationType: 1, + firstName: firstNameAr.text, + firstNameN: firstNameN.text, + lastName: lastNameAr.text, + lastNameN: lastNameN.text, + middleName: middleNameAr.text, + middleNameN: middleNameN.text, + strDateofBirth: dateFormat.toUtc().toString(), + dateofBirth: AppDateUtils.convertToServerFormat( + widget.model.getPatientInfoResponseModel + .dateOfBirth, + 'MM/dd/yyyy'), + dateofBirthN: '$hijriDate', + gender: (widget.model.getPatientInfoResponseModel.gender == "M") + ? 1 + : 2, + sourceType: "1", + patientOutSA: 0, + nationalityID: widget + .model + .getPatientInfoResponseModel + .nationalityCode, + //todo Elham* change static value to dynamic + preferredLanguage: selectedLang.toString(), + marital: "0", + eHealthIDField: widget.model + .getPatientInfoResponseModel.healthId, + emailAddress: emailAddressController.text, + mobileNumber: widget + .model + .checkPatientForRegistrationModel + .patientMobileNumber), + isHijri: 0, + logInTokenID: "zjgvKtLC/EK+saznJ/OkiA==", + isDentalAllowedBackend: false, + patientOutSA: 0, + sessionID: null, + patientMobileNumber: widget + .model + .checkPatientForRegistrationModel + .patientMobileNumber + .toString(), + healthId: + widget.model.getPatientInfoResponseModel.healthId, + generalid: GENERAL_ID, + patientIdentificationID: widget.model.checkPatientForRegistrationModel.patientIdentificationID.toString(), + dOB: wellFormat, + zipCode: widget.model.checkPatientForRegistrationModel.zipCode); + await widget.model + .registrationPatient(patientRegistrationModel); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + DrAppToastMsg.showSuccesToast( + "Patient added Successfully"); + Navigator.of(context).pop(); + } + + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + ), + ), + ], + ), + ), + ); + } + + openMaritalStatusList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isDismissible: true, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: .3, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + "${TranslationBase.of(context).maritalStatus} :", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 18, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon(DoctorApp.close_1, + size: SizeConfig.getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2B353E))), + ), + ], + ), + SizedBox( + height: 10, + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + "Single", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + "Married", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + InkWell( + onTap: () {}, + child: Row( + children: [ + Radio( + value: 1, + groupValue: 1, + onChanged: (value) { + setState(() {}); + }, + activeColor: Colors.red, + ), + AppText( + "Divorce", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + ], + ), + ); + }); + } + + openLangList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isDismissible: true, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: .3, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + "language:", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 18, + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + child: Icon(DoctorApp.close_1, + size: SizeConfig.getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2B353E))), + ), + ], + ), + SizedBox( + height: 10, + ), + InkWell( + onTap: () { + setSelectedLang(1); + }, + child: Row( + children: [ + Radio( + value: 1, + groupValue: selectedLang, + onChanged: (value) { + setSelectedLang(value); + }, + activeColor: Colors.red, + ), + AppText( + TranslationBase.of(context).lanEnglish, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + InkWell( + onTap: () { + setSelectedLang(2); + }, + child: Row( + children: [ + Radio( + value: 2, + groupValue: selectedLang, + onChanged: (value) { + setSelectedLang(value); + }, + activeColor: Colors.red, + ), + AppText( + TranslationBase.of(context).lanArabic, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + ), + ), + ], + ), + ); + }); + } + + setSelectedLang(lang) { + setState(() { + selectedLang = lang; + langController.text = lang == 1 ? "English" : "العربيه"; + }); + Navigator.of(context).pop(); + } + + bool isFormValid() { + if (middleNameAr.text != null && + middleNameAr.text.isNotEmpty && + middleNameN.text != null && + middleNameN.text.isNotEmpty && + emailAddressController.text != null && + emailAddressController.text.isNotEmpty) { + return true; + } + return false; + } +} diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart new file mode 100644 index 00000000..9bc2d6fe --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -0,0 +1,219 @@ +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/register_patient/VerifyMethodPage.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; + +import 'RegisterSearchPatientPage.dart'; + +class RegisterPatientPage extends StatefulWidget { + const RegisterPatientPage({Key? key}) : super(key: key); + + @override + _RegisterPatientPageState createState() => _RegisterPatientPageState(); +} + +class _RegisterPatientPageState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + bool _isLoading = false; + + changePageViewIndex(pageIndex, {isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); + _controller.jumpToPage(pageIndex); + setState(() { + _currentIndex = pageIndex; + }); + } + + void changeLoadingState(bool isLoading) { + setState(() { + _isLoading = isLoading; + }); + } + + @override + void initState() { + _controller = new PageController(); + super.initState(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + ///TODO Elham* Add Translation + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + isLoading: _isLoading, + appBar: PatientSearchHeader( + title: TranslationBase.of(context).registeraPatient, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + //TODO Elham* Fix overflow + PageStepperWidget( + stepsCount: 3, + currentStepIndex: _currentIndex + 1, + screenSize: screenSize, + stepsTitles: [ + "Search", + "Activation", + "Confirmation", + ], + ), + SizedBox( + height: 10, + ), + Expanded( + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + RegisterSearchPatientPage( + changePageViewIndex: changePageViewIndex, + model: model), + ActivationPage( + model: model, + changePageViewIndex: changePageViewIndex, + ), + RegisterConfirmationPatientPage( + model: model, + ), + ]), + ), + ), + ], + ), + )), + // pagerButtons(model), + ], + ), + ), + ); + } + + Widget pagerButtons(PatientRegistrationViewModel model) { + switch (_currentIndex) { + case 2: + return Container( + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).noteConfirm, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFF359846), + color: Color(0xFF359846), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () {}, + ), + ), + ), + ], + ), + ); + default: + return Container( + padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () { + changePageViewIndex(_currentIndex + 1); + }, + ), + ), + ), + ], + ), + ); + } + } +} diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart new file mode 100644 index 00000000..fd425c01 --- /dev/null +++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart @@ -0,0 +1,447 @@ +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/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; + +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; + +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; + +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/country_textfield_custom.dart'; +import 'package:flutter/material.dart'; +import 'package:hijri/hijri_calendar.dart'; +import 'package:hijri_picker/hijri_picker.dart'; +import 'package:doctor_app_flutter/core/enum/CalenderType.dart'; +import 'package:intl/intl.dart'; + +class RegisterSearchPatientPage extends StatefulWidget { + final Function changePageViewIndex; + final PatientRegistrationViewModel model; + + const RegisterSearchPatientPage( + {Key? key, this.changePageViewIndex, this.model}) + : super(key: key); + + @override + _RegisterSearchPatientPageState createState() => + _RegisterSearchPatientPageState(); +} + +class _RegisterSearchPatientPageState extends State { + String countryError; + dynamic _selectedCountry; + + List countryList; + + dynamic country; + + bool isSubmitted = false; + + TextEditingController _phoneController = + TextEditingController(text: "508079569"); + TextEditingController _phoneCode = TextEditingController(text: "966"); + + String phoneError; + + TextEditingController _idController = + TextEditingController(text: "1062938285"); + String idError; + + DateTime _birthDateInGregorian; + String birthdateError; + var birthDateInHijri = new HijriCalendar.now(); + CalenderType calenderType = CalenderType.Gregorian; + + @override + void initState() { + _phoneCode.text = ""; + countryList = []; + + dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"}; + dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"}; + + countryList.add(ksaCountry); + countryList.add(uaeCountry); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + /// TODO Elham* add transaltion + + return AppScaffold( + baseViewModel: widget.model, + isShowAppBar: false, + body: Column( + children: [ + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter mobile number or Identification number", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + SizedBox( + height: 10, + ), + CountryTextField( + elementList: countryList, + element: country, + elementError: countryError, + keyName: 'name', + keyId: 'id', + okFunction: (selectedValue) { + setState(() { + country = selectedValue; + _phoneCode.text = selectedValue['id'].toString(); + }); + }, + hintText: "Country", + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Code", + inputType: TextInputType.phone, + controller: _phoneCode, + validationError: phoneError, + enabled: false, + ), + ), + if (_phoneController.text.isEmpty && isSubmitted) + SizedBox( + height: 35, + ) + ], + ), + SizedBox( + width: 10, + ), + Expanded( + child: Container( + // width: MediaQuery.of(context).size.width*0.7, + child: AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Phone Number", + inputType: TextInputType.phone, + controller: _phoneController, + validationError: + _phoneController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + ), + ), + ], + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "ID Number", + inputType: TextInputType.phone, + controller: _idController, + validationError: _idController.text.isEmpty && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 12, + ), + AppText( + "Calender", + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w800, + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: RadioListTile( + title: AppText("Gregorian"), + value: CalenderType.Gregorian, + groupValue: calenderType, + onChanged: (CalenderType value) { + setState(() { + calenderType = value; + }); + }, + ), + ), + Expanded( + child: RadioListTile( + title: AppText("Hijri"), + value: CalenderType.Hijri, + groupValue: calenderType, + onChanged: (CalenderType value) { + setState(() { + calenderType = value; + }); + }, + ), + ), + ], + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: "Birthdate", + dropDownText: getBirthdate(), + enabled: false, + isTextFieldHasSuffix: true, + validationError: _birthDateInGregorian == null && isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + suffixIcon: IconButton( + icon: Icon( + Icons.calendar_today, + color: Colors.black, + ), + onPressed: null, + ), + onClick: () { + if (_birthDateInGregorian == null) { + _birthDateInGregorian = DateTime.now(); + } + _selectDate(context, _birthDateInGregorian, + (dynamic selectedDate) { + setState(() { + if (calenderType == CalenderType.Hijri) { + birthDateInHijri = selectedDate; + _birthDateInGregorian = HijriCalendar().hijriToGregorian( + birthDateInHijri.hYear, + birthDateInHijri.hMonth, + birthDateInHijri.hDay); + print(_birthDateInGregorian); + print(birthDateInHijri); + } else { + _birthDateInGregorian = selectedDate; + birthDateInHijri = HijriCalendar() + .gregorianToHijri( + selectedDate.year, selectedDate.month, selectedDate.day); + + print(_birthDateInGregorian); + print(birthDateInHijri); + } + }); + }); + }, + ), + ], + ), + ), + ), + ), + ], + ), + bottomSheet: Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (country == null) { + countryError = TranslationBase.of(context).fieldRequired; + } else { + countryError = null; + } + if (isFormValid()) { + GifLoaderDialogUtils.showMyDialog(context); + CheckPatientForRegistrationModel + checkPatientForRegistrationModel = + CheckPatientForRegistrationModel( + patientIdentificationID: + int.parse(_idController.text), + patientMobileNumber: + int.parse(_phoneController.text), + zipCode: _phoneCode.text, + isHijri: 0, + patientID: 0, + isRegister: false, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + dOB: + "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}"); + await widget.model.checkPatientForRegistration( + checkPatientForRegistrationModel); + GetPatientInfoRequestModel getPatientInfoRequestModel = + GetPatientInfoRequestModel( + //TODO Elham* this return the static to dynamic + patientIdentificationID: "1062938285", + // _idController.text, + isHijri: 0, + isDentalAllowedBackend: false, + patientOutSA: 0, + generalid: GENERAL_ID, + sessionID: null, + dOB: + "31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}" + ); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + await widget.model + .getPatientInfo(getPatientInfoRequestModel); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + } else { + widget.changePageViewIndex(1); + } + } + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + ), + ), + ], + ), + ), + ); + } + + isFormValid() { + if (_phoneController.text != null && + _phoneController.text.isNotEmpty && + _idController.text != null && + _idController.text.isNotEmpty && + _birthDateInGregorian != null) { + return true; + } + return false; + } + + Future _selectDate(BuildContext context, DateTime dateTime, + Function(dynamic) updateDate) async { + if (calenderType == CalenderType.Hijri) { + HijriCalendar hijriDate = HijriCalendar.fromDate(DateTime.now()); + final HijriCalendar pickedH = await showHijriDatePicker( + context: context, + initialDate: birthDateInHijri ?? hijriDate, + lastDate: new HijriCalendar() + ..hYear = hijriDate.hYear + ..hMonth = hijriDate.hMonth + ..hDay = hijriDate.hDay, + firstDate: new HijriCalendar() + ..hYear = 1438 + ..hMonth = 12 + ..hDay = 25, + initialDatePickerMode: DatePickerMode.day, + ); + if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH); + } else { + final DateTime picked = await showDatePicker( + context: context, + initialDate: dateTime ?? DateTime.now(), + firstDate: DateTime(DateTime.now().year - 150), + lastDate: DateTime.now(), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != dateTime) { + updateDate(picked); + } + } + } + + void openListDialogField(String attributeName, String attributeValueId, + List 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; + }, + ); + } + + getBirthdate() { + + if (calenderType == CalenderType.Hijri) { + return birthDateInHijri != null + ? "$birthDateInHijri" + : null; + }else{ + return _birthDateInGregorian != null + ? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}" + : null; + } + + } +} diff --git a/lib/screens/patients/register_patient/VerifyActivationCodePage.dart b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart new file mode 100644 index 00000000..6f0e1a31 --- /dev/null +++ b/lib/screens/patients/register_patient/VerifyActivationCodePage.dart @@ -0,0 +1,48 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class VerifyActivationCodePage extends StatefulWidget { + const VerifyActivationCodePage({Key? key}) : super(key: key); + + @override + _VerifyActivationCodePageState createState() => + _VerifyActivationCodePageState(); +} + +class _VerifyActivationCodePageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter the verification code sent to 02221552", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + ], + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart new file mode 100644 index 00000000..8634e76e --- /dev/null +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -0,0 +1,520 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ActivationPage extends StatefulWidget { + final PatientRegistrationViewModel model; + final Function changePageViewIndex; + + ActivationPage({this.model, this.changePageViewIndex}); + + @override + _ActivationPageState createState() => _ActivationPageState(); +} + +class _ActivationPageState extends State { + bool isSendOtp = false; + final verifyAccountForm = GlobalKey(); + + TextStyle buildTextStyle() { + return TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ); + } + + Map verifyAccountFormValue = { + 'digit1': '', + 'digit2': '', + 'digit3': '', + 'digit4': '', + }; + final focusD1 = FocusNode(); + final focusD2 = FocusNode(); + final focusD3 = FocusNode(); + final focusD4 = FocusNode(); + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + @override + Widget build(BuildContext context) { + return AppScaffold( + baseViewModel: widget.model, + isShowAppBar: false, + body: Column( + children: [ + Visibility( + //visible: isSendOtp, + child: !isSendOtp + ? Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please select how you want to be verified", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () async { + // setState(() { + // isSendOtp = true; + // }); + // + // await widget.model + // .sendActivationCodeByOTPNotificationType( + // otpType: 1); + await sendActivationCode(1); + }, + child: Container( + height: + MediaQuery.of(context).size.height * + 0.233, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 10), + child: Image.asset( + "assets/images/verify-sms.png", + height: MediaQuery.of(context) + .size + .height * + 0.15, + width: MediaQuery.of(context) + .size + .width * + 0.15, + ), + ), + ], + ), + SizedBox( + height: 20, + ), + Center( + child: AppText( + "Verify through SMS", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () async { + await sendActivationCode(2); + }, + child: Container( + height: + MediaQuery.of(context).size.height * + 0.233, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 10.0), + child: Image.asset( + "assets/images/verify-whtsapp.png", + height: MediaQuery.of(context) + .size + .height * + 0.15, + width: MediaQuery.of(context) + .size + .width * + 0.15, + ), + ), + ], + ), + SizedBox( + height: 20, + ), + Center( + child: AppText( + "Verify through WhatsApp", + fontSize: 14, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + ), + ) + ], + ), + ), + ), + ), + ], + ), + ], + ), + ), + ) + : Container( + width: double.infinity, + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Please enter the verification code sent to 02221552", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.w800, + ), + Row( + children: [ + Center( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: 20), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Container( + width: SizeConfig + .realScreenWidth * + 0.16, + margin: EdgeInsets.all(5), + child: TextFormField( + textInputAction: + TextInputAction.next, + style: buildTextStyle(), + autofocus: true, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onSaved: (val) {}, + //validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus( + focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus( + focusD2); + verifyAccountFormValue[ + 'digit1'] = + val.trim(); + //checkValue(); + } + }, + ), + ), + Container( + width: SizeConfig + .realScreenWidth * + 0.16, + margin: EdgeInsets.all(5), + child: TextFormField( + focusNode: focusD2, + textInputAction: + TextInputAction.next, + maxLength: 1, + controller: digit2, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus( + focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus( + focusD3); + verifyAccountFormValue[ + 'digit2'] = + val.trim(); + //checkValue(); + } + }, + //validator: validateCodeDigit, + ), + ), + Container( + margin: EdgeInsets.all(5), + width: SizeConfig + .realScreenWidth * + 0.16, + child: TextFormField( + focusNode: focusD3, + textInputAction: + TextInputAction.next, + maxLength: 1, + controller: digit3, + textAlign: + TextAlign.center, + style: buildTextStyle(), + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus( + focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus( + focusD4); + verifyAccountFormValue[ + 'digit3'] = + val.trim(); + //checkValue(); + } + }, + // validator: + // validateCodeDigit, + )), + Container( + margin: EdgeInsets.all(5), + width: SizeConfig + .realScreenWidth * + 0.16, + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: + TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: + TextInputType.number, + decoration: + buildInputDecoration( + context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus( + focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue[ + 'digit4'] = + val.trim(); + //checkValue(); + } + }, + // validator: + // validateCodeDigit, + )), + ], + )), + ), + ), + Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .validationMessage + + ' ', + fontWeight: FontWeight.w600, + fontSize: 14, + ), + // AppText( + // displayTime, + // color: Colors.red, + // textAlign: TextAlign.start, + // fontWeight: FontWeight.bold, + // fontSize: 14, + // ) + ]), + ) + ], + ))), + ], + ), + ], + ), + ), + ), + ) + ], + ), + bottomSheet: isSendOtp + ? Container( + height: 60, + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Row( + children: [ + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFeaeaea), + color: Color(0xFFeaeaea), + fontColor: Colors.black, + fontSize: 2.2, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: Container( + child: AppButton( + title: TranslationBase.of(context).next, + hasBorder: true, + vPadding: 12, + hPadding: 8, + borderColor: Color(0xFFB8382B), + color: Color(0xFFB8382B), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.checkActivationCode( + "${digit1.text}${digit2.text}${digit3.text}${digit4.text}"); + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + //TODO Elham* remove this + //widget.changePageViewIndex(2); + GifLoaderDialogUtils.hideDialog(context); + } else { + GifLoaderDialogUtils.hideDialog(context); + widget.changePageViewIndex(2); + } + }, + ), + ), + ), + ], + ), + ) + : null); + } + + sendActivationCode(type) async { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.sendActivationCodeByOTPNotificationType(otpType: type); + + if (widget.model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.model.error); + GifLoaderDialogUtils.hideDialog(context); + // TODO Elham* retuen the else + setState(() { + isSendOtp = false; + }); + } else { + setState(() { + isSendOtp = true; + }); + } + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + counterText: " ", + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10)), + borderSide: BorderSide(color: Colors.grey[300]), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Colors.grey[300]), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Colors.grey[300]), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } +} diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index d0909a0d..128acac6 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -6,9 +6,11 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -422,9 +424,9 @@ class _PrescriptionFormWidgetState extends State { isSubmitted: isSubmitted, width: MediaQuery.of(context).size.width * 0.517, element: model.itemMedicineListUnit.length == 1 - ? units = model.itemMedicineListUnit[0] + ? model.itemMedicineListUnit[0] : units, - elementError: unitError ?? "", + elementError: unitError, keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -444,9 +446,9 @@ class _PrescriptionFormWidgetState extends State { isSubmitted: isSubmitted, elementList: model.itemMedicineListRoute, element: model.itemMedicineListRoute.length == 1 - ? route = model.itemMedicineListRoute[0] + ? model.itemMedicineListRoute[0] : route, - elementError: routeError ?? "", + elementError: routeError, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -647,11 +649,13 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context).addMedication, fontWeight: FontWeight.w600, onPressed: () async { - if (route != null && - duration != null && + await locator().logEvent( + eventCategory: "Add Prescription Form", + eventAction: "Add Prescription", + ); + if (duration != null && doseTime != null && frequency != null && - units != null && selectedDate != null && strengthController.text != "") { if (_selectedMedication!.isNarcotic == true) { diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 67122fd7..4da17968 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -186,7 +186,7 @@ class _PrescriptionCheckOutScreenState extends State setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - indicationController.text += reconizedWord + '\n'; + instructionController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index e516f997..bd28146d 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -13,7 +14,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PrescriptionItemsInPatientPage extends StatelessWidget { - final PrescriotionInPatient prescriptions; + final GetMedicationForInPatientModel prescriptions; final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -36,8 +37,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (model.inPatientPrescription.length == 0) { - await model.getPrescriptionsInPatient(patient); + if (model.medicationForInPatient.length == 0) { + await model.getMedicationForInPatient(patient); } }, builder: (_, model, widget) => AppScaffold( @@ -63,7 +64,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Container( margin: EdgeInsets.only(left: 18, right: 18), child: AppText( - model.inPatientPrescription[prescriptionIndex].itemDescription, + prescriptions.pHRItemDescription, bold: true, ), ), @@ -91,8 +92,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), Expanded( - child: - AppText(" " + model.inPatientPrescription[prescriptionIndex].direction!)), + child: AppText(" " + prescriptions.directionDescription.toString() ?? '')), ], ), Row( @@ -101,7 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + model.inPatientPrescription[prescriptionIndex].route.toString()), + AppText(" " + prescriptions.routeDescription.toString()), ], ), Row( @@ -110,9 +110,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).refill, color: Colors.grey, ), - Expanded( - child: AppText( - " " + model.inPatientPrescription[prescriptionIndex].refillType!)), + Expanded(child: AppText(" " + prescriptions.refillDescription.toString() ?? '')), ], ), Row( @@ -153,8 +151,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { 'UOM', color: Colors.grey, ), - AppText(" " + - model.inPatientPrescription[prescriptionIndex].unitofMeasurementDescription!), + AppText(" " + prescriptions.uomDescription.toString() ?? ''), ], ), Row( @@ -163,7 +160,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).dailyDoses, color: Colors.grey, ), - AppText(" " + model.inPatientPrescription[prescriptionIndex].dose.toString()), + AppText(" " + prescriptions.dose.toString()), ], ), Row( @@ -173,8 +170,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { color: Colors.grey, ), AppText( - " " + - model.inPatientPrescription[prescriptionIndex].statusDescription.toString(), + " " + prescriptions.statusDescription.toString(), ), ], ), @@ -184,22 +180,22 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).processed, color: Colors.grey, ), - AppText(" " + model.inPatientPrescription[prescriptionIndex].processedBy!), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + model.inPatientPrescription[prescriptionIndex].dose.toString()), + AppText(" " + prescriptions.doctorName.toString() ?? ''), ], ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).num, + // color: Colors.grey, + // ), + // AppText(" " + prescriptions.dose.toString() ?? ''), + // ], + // ), SizedBox( height: 12, ), - AppText(model.inPatientPrescription[prescriptionIndex].comments ?? ''), + AppText(prescriptions.comments ?? ''), ], ), ) diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index bcf67ec2..faf6229e 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -45,7 +45,8 @@ class _PrescriptionTextFiledState extends State { ListSelectDialog dialog = ListSelectDialog( list: widget.elementList, attributeName: '${widget.keyName}', - attributeValueId: '${widget.keyId}', + attributeValueId: + widget.elementList.length == 1 ? widget.elementList[0]['${widget.keyId}'] : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => widget.okFunction(selectedValue), ); diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d30e7748..c3764b22 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -12,8 +12,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import '../../widgets/shared/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -28,9 +30,9 @@ class PrescriptionsPage extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isSelectInpatient = routeArgs['isSelectInpatient']; return BaseView( - onModelReady: (model) => isSelectInpatient - ? model.getPrescriptionsInPatient(patient) - : model.getPrescriptions(patient, patientType: patientType), + onModelReady: (model) => patient.admissionNo == null + ? model.getPrescriptions(patient, patientType: patientType) + : model.getMedicationForInPatient(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -95,14 +97,13 @@ class PrescriptionsPage extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - BaseAddProcedureTabPage( - patient: patient, - prescriptionModel: model, - procedureType: - ProcedureType.PRESCRIPTION, - )), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + prescriptionModel: model, + procedureType: ProcedureType.PRESCRIPTION, + ), + settingRoute: 'AddProcedureTabPage'), ); }, label: TranslationBase.of(context) @@ -159,74 +160,92 @@ class PrescriptionsPage extends StatelessWidget { ], ), ) - : FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), - children: [ - // SizedBox( - // height: 12, - // ), + : NetworkBaseView( + baseViewModel: model, + child: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + // SizedBox( + // height: 12, + // ), - ...List.generate( - model.inPatientPrescription.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsInPatientPage( - prescriptionIndex: index, - prescriptions: model - .inPatientPrescription[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - startOn: AppDateUtils - .getDateTimeFromServerFormat( - model.inPatientPrescription[index] - .startDatetime ?? "", - ), - stopOn: AppDateUtils - .getDateTimeFromServerFormat( - model.inPatientPrescription[index] - .stopDatetime ?? "", + ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.medicationForInPatient.length, + itemBuilder: (context, index) { + //model.medicationForInPatient.length, + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: + PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: + model.medicationForInPatient[ + index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: AppDateUtils + .getDateTimeFromServerFormat( + model + .medicationForInPatient[ + index] + .startDatetime ?? "", + ), + stopOn: AppDateUtils + .getDateTimeFromServerFormat( + model + .medicationForInPatient[ + index] + .stopDatetime ?? "", + ), + ), ), ), + child: InPatientDoctorCard( + doctorName: model + .medicationForInPatient[index] + .pHRItemDescription, + profileUrl: 'sss', + branch: 'hamza', + clinic: 'basheer', + isPrescriptions: true, + appointmentDate: AppDateUtils + .getDateTimeFromServerFormat( + model.medicationForInPatient[index] + .prescriptionDatetime ?? "", ), - ), - child: InPatientDoctorCard( - doctorName: model.inPatientPrescription[index] - .itemDescription, - profileUrl: 'sss', - branch: 'hamza', - clinic: 'basheer', - isPrescriptions: true, - appointmentDate: - AppDateUtils.getDateTimeFromServerFormat( - model.inPatientPrescription[index] - .prescriptionDatetime ?? "", + createdBy: model + .medicationForInPatient[index] + .doctorName + .toString(), + )); + }), + if (model.medicationForInPatient.length == 0) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, ), - createdBy: model.inPatientPrescription[index] - .createdByName, - ))), - if (model.inPatientPrescription.length == 0) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noPrescriptionsFound), - ) - ], - ), - ) - ], + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), + ) + ], + ), + ) + ], + ), ), ))); } diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 266bd82f..83896e2c 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -48,7 +48,7 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - height: MediaQuery.of(context).size.height * .20, + height: MediaQuery.of(context).size.height * .212, width: 5, decoration: BoxDecoration( borderRadius: BorderRadius.only( diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 1c2141e8..8ff817e5 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/procedures/procedure_checkout_screen. import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -54,8 +55,8 @@ class _AddFavouriteProcedureState extends State { Container( height: MediaQuery.of(context!).size.height * 0.070, ), - if (model!.templateList.length != 0) - Expanded( + (model!.templateList.length != 0) + ?Expanded( child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), model: model, @@ -77,15 +78,23 @@ class _AddFavouriteProcedureState extends State { }); }, ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + ) + : Container( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 50.0), + child: AppText('You Don\'t have favorite prescription'), + ), + ), + ], + ), + bottomSheet: Container(margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( title: widget.procedureType.getAddButtonTitle(context), - color: Color(0xff359846), + color: Color(0xff359846), + disabled: model.templateList.length == 0 ? true : false, fontWeight: FontWeight.w700, onPressed: () { if (widget.procedureType == ProcedureType.PRESCRIPTION) { @@ -96,42 +105,40 @@ class _AddFavouriteProcedureState extends State { return; } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.prescriptionModel, - groupProcedures: groupProcedures, - ), - ), - ); - } else { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).fillTheMandatoryProcedureDetails, - ); - return; - } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ProcedureCheckOutScreen( - items: entityList, - model: model, - patient: widget.patient, - addButtonTitle: widget.procedureType.getAddButtonTitle(context), - toolbarTitle: widget.procedureType.getToolbarLabel(context), - ), - ), - ); - } - }, - ), - ], + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PrescriptionCheckOutScreen( + patient: widget.patient, + model: widget.prescriptionModel, + groupProcedures: groupProcedures, + ), + settings: RouteSettings(name: 'PrescriptionCheckOutScreen')), + ); + } else { + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).fillTheMandatoryProcedureDetails, + ); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProcedureCheckOutScreen( + items: entityList, + model: model, + patient: widget.patient, + addButtonTitle: widget.procedureType.getAddButtonTitle(context), + toolbarTitle: widget.procedureType.getToolbarLabel(context), + ), + settings: RouteSettings(name: 'ProcedureCheckOutScreen')), + ); + } + }, ), - ), - ], + ], + ), ), ), ); diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index 0a150c55..97f3c0cd 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-page.dart'; @@ -211,6 +213,10 @@ class _ProcedureCheckOutScreenState extends State { ), ); }); + await locator().logEvent( + eventCategory: "Procedure Checkout Screen", + eventAction: "Add New Procedure", + ); Navigator.pop(context); await model.preparePostProcedure( entityList: entityList, patient: widget.patient, remarks: remarksController.text); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index b115c0eb..f4e3d676 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/material.dart'; import 'ProcedureCard.dart'; @@ -35,10 +36,8 @@ class ProcedureScreen extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => model.getProcedure( - mrn: patient.patientId, - patientType: patientType, - ), + onModelReady: (model) => + model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo), builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -101,13 +100,13 @@ class ProcedureScreen extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient, - model: model, - procedureType: ProcedureType.PROCEDURE, - ), - ), + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + model: model, + procedureType: ProcedureType.PROCEDURE, + ), + settingRoute: 'AddProcedureTabPage'), ); }, child: Container( diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 2ace524a..c0b905fe 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -2,8 +2,10 @@ import 'package:barcode_scan_fix/barcode_scan.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -61,7 +63,11 @@ class _QrReaderScreenState extends State { ), AppButton( title: TranslationBase.of(context).scanQr, - onPressed: () { + onPressed: () async { + await locator().logEvent( + eventCategory: "QrReaderScreen", + eventAction: "Scan QR", + ); _scanQrAndGetPatient(context, model); }, icon: Image.asset('assets/images/qr_code_white.png'), @@ -76,25 +82,22 @@ class _QrReaderScreenState extends State { } _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { - /// When give qr we will change this method to get data - /// var result = await BarcodeScanner.scan(); - /// int patientID = get from qr result var result = await BarcodeScanner.scan(); if (result != "") { List listOfParams = result.split(','); int patientID = 0; if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( - patientID: patientID, - ); + patientID: patientID, clinicID: 0, doctorID: 0, projectID: int.parse(listOfParams[0])); - await model.getInPatientList(patientSearchRequestModel, isMyInpatient: true).then((d) { + await model.getInPatientList(patientSearchRequestModel, isMyInpatient: false).then((d) { if (model.state != ViewState.ErrorLocal) { if (model.inPatientList.isEmpty) DrAppToastMsg.showErrorToast('No patient'); else Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.inPatientList[0], + "isInpatient": true, }); } else { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 411dbe59..3337364f 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -27,8 +29,15 @@ class AddRescheduleLeavScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", body: SingleChildScrollView( child: Column(children: [ - AddNewOrder( - onTap: () { + Padding( + padding: const EdgeInsets.all(8.0), + child:AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Add Reschedule" + "Leave Screen", + eventAction: "apply For Reschedule", + ); openLeave( context, false, @@ -36,17 +45,20 @@ class AddRescheduleLeavScreen extends StatelessWidget { }, label: TranslationBase.of(context).applyForReschedule ?? "", ), + ), Column( children: model.getReschduleLeave.map((GetRescheduleLeavesResponse item) { - return RoundedContainer( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 10 - ? Colors.red[800]! + return Padding( + padding: const EdgeInsets.all(8.0), + child: RoundedContainer( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 10 + ? Colors.red[800]! : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 @@ -115,12 +127,12 @@ class AddRescheduleLeavScreen extends StatelessWidget { fontWeight: FontWeight.bold, ) + // overflow: + // TextOverflow.ellipsis, + ]), + // overflow: // TextOverflow.ellipsis, - ]), - - // overflow: - // TextOverflow.ellipsis, SizedBox( height: 5, @@ -164,7 +176,8 @@ class AddRescheduleLeavScreen extends StatelessWidget { icon: Image.asset('assets/images/edit.png'), // color: Colors.green, //Colors.black, onPressed: () => {openLeave(context, true, extendedData: item)}, - ) + ) + : SizedBox(), ]), ], @@ -177,7 +190,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), ], )), - ], + ],), ), ); }).toList(), diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index c754e468..7d90c9a8 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -37,19 +37,19 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - late ProjectViewModel projectsProvider; - late SickLeaveViewModel sickLeaveViewModel; - + ProjectViewModel projectsProvider; + SickLeaveViewModel sickLeaveViewModel; + String _selectedClinic; Map profile = {}; - String offTime = '1'; + var offTime = '1'; var date; var doctorID; var reason; - var fromDate; - var toDate; + dynamic fromDate; + dynamic toDate; var clinicID; - late String fromTime; - late String toTime; + String fromTime; + String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { @@ -80,12 +80,12 @@ class _RescheduleLeaveScreen extends State { } }); - setState(() { - final df = new DateFormat('yyyy-MM-dd'); - fromDate = pickedDate; //df.format(); - _toDateController.text = df.format(pickedDate); - toDate = pickedDate; - }); + // setState(() { + // final df = new DateFormat('yyyy-MM-dd'); + // fromDate = pickedDate; //df.format(); + // //_toDateController2.text = df.format(pickedDate); + // //toDate = pickedDate; + // }); }); } @@ -104,616 +104,615 @@ class _RescheduleLeaveScreen extends State { onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( onModelReady: (model2) => { - model2.getOffTime(), - model2.getReasons(offTime == '1' - ? 18 - : offTime == '2' - ? 19 - : 102), - model2.getCoveringDoctors() - }, + model2.getOffTime(), + model2.getReasons(offTime == '1' + ? 18 + : offTime == '2' + ? 19 + : 102), + model2.getCoveringDoctors() + }, builder: (_, model2, w) => GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - baseViewModel: model2, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves ?? "", - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // width: double.infinity, - // child: Padding( - // padding: EdgeInsets.only( - // top: SizeConfig.widthMultiplier * 0.9, - // bottom: - // SizeConfig.widthMultiplier * 0.9, - // right: SizeConfig.widthMultiplier * 3, - // left: SizeConfig.widthMultiplier * 3), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // // add Expanded to have your dropdown button fill remaining space - // child: - // DropdownButtonHideUnderline( - // child: new IgnorePointer( - // ignoring: true, - // child: DropdownButton( - // focusColor: - // Colors.grey, - // isExpanded: true, - // dropdownColor: - // Colors.grey, - // value: getClinicName( - // model) ?? - // "", - // iconSize: 0, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext - // context) { - // return model - // .getClinicNameList() - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize - // .max, - // children: < - // Widget>[ - // AppText( - // item, - // fontSize: - // SizeConfig.textMultiplier * - // 2.1, - // color: Colors - // .grey[ - // 500], - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: - // (newValue) => - // {}, - // items: model - // .getClinicNameList() - // .map((item) { - // return DropdownMenuItem( - // value: item - // .toString(), - // child: Text( - // item, - // textAlign: - // TextAlign - // .end, - // ), - // ); - // }).toList(), - // ))), - // ), - // ], - // ) - // ], - // ), - // )), + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model2, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // width: double.infinity, + // child: Padding( + // padding: EdgeInsets.only( + // top: SizeConfig.widthMultiplier * 0.9, + // bottom: + // SizeConfig.widthMultiplier * 0.9, + // right: SizeConfig.widthMultiplier * 3, + // left: SizeConfig.widthMultiplier * 3), + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // // add Expanded to have your dropdown button fill remaining space + // child: + // DropdownButtonHideUnderline( + // child: new IgnorePointer( + // ignoring: true, + // child: DropdownButton( + // focusColor: + // Colors.grey, + // isExpanded: true, + // dropdownColor: + // Colors.grey, + // value: getClinicName( + // model) ?? + // "", + // iconSize: 0, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext + // context) { + // return model + // .getClinicNameList() + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize + // .max, + // children: < + // Widget>[ + // AppText( + // item, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors + // .grey[ + // 500], + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: + // (newValue) => + // {}, + // items: model + // .getClinicNameList() + // .map((item) { + // return DropdownMenuItem( + // value: item + // .toString(), + // child: Text( + // item, + // textAlign: + // TextAlign + // .end, + // ), + // ); + // }).toList(), + // ))), + // ), + // ], + // ) + // ], + // ), + // )), - // Container( - // margin: EdgeInsets.all(8), - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // padding: EdgeInsets.all(5), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // new IgnorePointer( - // ignoring: true, - // child: AppTextFormField( - // readOnly: true, - // hintText: profile != null - // ? profile['DoctorName'] - // : "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS)) - // ], - // ), - // ), + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // padding: EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // new IgnorePointer( + // ignoring: true, + // child: AppTextFormField( + // readOnly: true, + // hintText: profile != null + // ? profile['DoctorName'] + // : "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS)) + // ], + // ), + // ), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allOffTime.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + // focusColor: Colors.grey, + isExpanded: true, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item['description'], + + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + setState(() { + offTime = newValue; + }); + if (offTime == '1') { + model2.getReasons(18); + } else if (offTime == '2') { + model2.getReasons(19); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); + setState(() { + offTime = newValue; + }); + } + }, + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), + child: Text( + item['description'], + textAlign: TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), + )), + offTime == '1' + ? Column( + children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allOffTime.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - // focusColor: Colors.grey, - isExpanded: true, - value: offTime == null - ? model2.allOffTime[0]['code'].toString() - : offTime, - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allOffTime.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item['description'], - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (String? newValue) => { - setState(() { - offTime = newValue!; - }), - if (offTime == '1') - {model2.getReasons(18)} - else if (offTime == '2') - {model2.getReasons(19)} - else if (offTime == '3' || offTime == '5') - {model2.getReasons(102)} - }, - items: model2.allOffTime.map((item) { - return DropdownMenuItem( - value: item['code'].toString(), - child: Text( - item['description'], - textAlign: TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, + ) + ], )), - offTime == '1' - ? Column( - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: - IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (val) => fromDate = val, - onSaved: (val) => fromDate = val, - ) - ], - )), - Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).fromTime, - type: DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => fromTime = val!, - ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: TranslationBase.of(context).toTime, - type: DateTimePickerType.time, - controller: _controller5, - onChanged: (val) => toTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => toTime = val!, - ) - ], - ), - ), - ) - ], - ) - ], - ) - : Column( - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - prefix: - IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context).toDate, - borderColor: Colors.white, - prefix: - IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController2, - onTap: () { - _presentDatePicker('toDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )) - ], + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, + controller: _controller4, + onChanged: (val) => fromTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => fromTime = val, + ) + ], + ), ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, + controller: _controller5, + onChanged: (val) => toTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => toTime = val, + ) + ], + ), + ), + ) + ], + ) + ], + ) + : Column( + children: [ Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allReasons.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: reason == null - ? model2.allReasons[0]['id'].toString() - : reason, - iconSize: 40, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model2.allReasons.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - projectsProvider.isArabic - ? item['nameAr'] - : item['nameEn'], - fontSize: SizeConfig.textMultiplier * 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - reason = newValue; - }) - }, - items: model2.allReasons.map((item) { - return DropdownMenuItem( - value: item['id'].toString(), - child: Text( - projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], - textAlign: TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + readOnly: true, + controller: _toDateController, + onTap: () { + _presentDatePicker('fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + fromDate = value; + }); + }), + ], )), - Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.coveringDoctors.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, - - dropdownSearchDecoration: InputDecoration( - contentPadding: EdgeInsets.all(0), border: InputBorder.none), - //maxHeight: 300, - items: model2.coveringDoctors.map((item) { - return projectsProvider.isArabic - ? item['doctorNameN'].toString() - : item['doctorName'].toString(); - }).toList(), - // label: "Doctor List", - onChanged: (item) { - model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorName'] == item || - newVal['doctorName'] == item) - {doctorID = newVal['DoctorID']} - }); - }, - selectedItem: getSelectedDoctor(model2), - showSearchBox: true, - searchBoxDecoration: InputDecoration( - border: OutlineInputBorder(), - contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), - labelText: "Search Doctor", - ), - popupTitle: Container( - height: 50, - decoration: BoxDecoration( - color: Theme.of(context).primaryColorDark, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(20), - topRight: Radius.circular(20), - ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - ), - ), - popupShape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context).toDate, + readOnly: true, + borderColor: Colors.white, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, + onTap: () { + _presentDatePicker('toDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )) + ], + ), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allReasons.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2.allReasons[0]['id'].toString() ?? "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + projectsProvider.isArabic + ? item['nameAr'] + : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, + // color: + // Colors.grey, ), - ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + reason = newValue; + }) + }, + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), + child: Text( + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), - // DropdownButtonHideUnderline( - // child: DropdownButton( - // focusColor: Colors.grey, - // isExpanded: true, - // value: doctorID == null - // ? model2 - // .coveringDoctors[0] - // ['doctorID'] - // .toString() - // : doctorID, - // iconSize: 40, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return model2 - // .coveringDoctors - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // AppText( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // fontSize: SizeConfig - // .textMultiplier * - // 2.1, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) => { - // setState(() { - // doctorID = newValue; - // }) - // }, - // items: model2 - // .coveringDoctors - // .map((item) { - // return DropdownMenuItem< - // String>( - // value: item['doctorID'] - // .toString(), - // child: Text( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // textAlign: - // TextAlign.start, - // ), - // ); - // }).toList(), - // )), - ) - : SizedBox(), - ], + ); + }).toList(), + )), ) + : SizedBox(), ], - ), - )), - SizedBox(height: SizeConfig.screenHeight * .3), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context).updateReschedule - : TranslationBase.of(context).addReschedule, - color: HexColor('#359846'), - onPressed: () { - if (offTime == '1' || offTime == '2') { - if (widget.isUpdate == true) { - updateRecheduleLeave(model2); - } else { - addRecheduleLeave(model2); - } - } else { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); - } - }, - ), + ) ], ), - ), - // Column( - // children: [ - // AppText(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], + )), + + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.coveringDoctors.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownSearch( + mode: Mode.BOTTOM_SHEET, + + dropdownSearchDecoration: InputDecoration( + contentPadding: EdgeInsets.all(0), border: InputBorder.none), + //maxHeight: 300, + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic + ? item['doctorNameN'] + : item['doctorName']; + }).toList(), + // label: "Doctor List", + onChanged: (item) { + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorName'] == item) + doctorID = newVal['DoctorID'] + }); + }, + selectedItem: getSelectedDoctor(model2), + showSearchBox: true, + searchBoxDecoration: InputDecoration( + border: OutlineInputBorder(), + contentPadding: EdgeInsets.fromLTRB(12, 12, 8, 0), + labelText: "Search Doctor", + ), + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), + ), + // DropdownButtonHideUnderline( + // child: DropdownButton( + // focusColor: Colors.grey, + // isExpanded: true, + // value: doctorID == null + // ? model2 + // .coveringDoctors[0] + // ['doctorID'] + // .toString() + // : doctorID, + // iconSize: 40, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return model2 + // .coveringDoctors + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // AppText( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // fontSize: SizeConfig + // .textMultiplier * + // 2.1, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) => { + // setState(() { + // doctorID = newValue; + // }) + // }, + // items: model2 + // .coveringDoctors + // .map((item) { + // return DropdownMenuItem< + // String>( + // value: item['doctorID'] + // .toString(), + // child: Text( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // textAlign: + // TextAlign.start, + // ), + // ); + // }).toList(), + // )), + ) + : SizedBox(), + ], + ) + ], + ), + )), + SizedBox(height: SizeConfig.screenHeight * .3), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isUpdate == true + ? TranslationBase.of(context).updateReschedule + : TranslationBase.of(context).addReschedule, + color: HexColor('#359846'), + onPressed: () { + if (offTime == '1' || offTime == '2') { + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } + } else { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); + } + }, + ), + ], + ), ), - ), + // Column( + // children: [ + // AppText(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], ), ), ), - ))); + ), + ), + ))); } getProfile() async { @@ -796,7 +795,7 @@ class _RescheduleLeaveScreen extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), + builder: (context) => AddRescheduleLeavScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') // MyReferredPatient(), ), ); @@ -807,16 +806,17 @@ class _RescheduleLeaveScreen extends State { updateRecheduleLeave(model) { // final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); final df = new DateFormat('yyyy-MM-dd'); - var fromDates = fromDate; - var toDates = toDate; + String dataS = DateTime.now().toIso8601String(); + dynamic fromDates = fromDate; + dynamic toDates = toDate; if (offTime == '1') { fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); toDate = - df.format(DateTime.parse(_toDateController.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); + df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); } else { - fromDate = df.format(fromDates); - toDate = df.format(toDates); + fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); + toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); } Map request = { @@ -852,9 +852,8 @@ class _RescheduleLeaveScreen extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - // MyReferredPatient(), - ), + builder: (context) => AddRescheduleLeavScreen(), + settings: RouteSettings(name: 'AddRescheduleLeaveScreen')), ); } }); @@ -868,8 +867,8 @@ class _RescheduleLeaveScreen extends State { : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} - }); + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} + }); return doctorName; } } diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart deleted file mode 100644 index f39f50ea..00000000 --- a/lib/screens/sick-leave/add-sickleave.dart +++ /dev/null @@ -1,256 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; - -class AddSickLeavScreen extends StatelessWidget { - late PatiantInformtion patient; - @override - Widget build(BuildContext context) { - ProjectViewModel projectsProvider = Provider.of(context); - - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; - patient = routeArgs['patient']; - bool isInpatient = routeArgs['isInpatient']??false; - return BaseView( - onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - patientProfileAppBarModel: PatientProfileAppBarModel( - patient: patient, isInpatient:isInpatient,), - body: SingleChildScrollView( - child: Column(children: [ - patient.patientStatusType == 43 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (!projectsProvider.isArabic) - AppText( - TranslationBase.of(context).patient, - fontWeight: FontWeight.bold, - ), - AppText( - TranslationBase.of(context).sickLeave, - fontSize: 24, - fontWeight: FontWeight.bold, - ), - ], - )), - Container( - width: SizeConfig.screenWidth, - margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10), - padding: EdgeInsets.all(20), - decoration: - BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: Container( - decoration: - BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)), - padding: EdgeInsets.all(3), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - color: Colors.white, - ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - )), - Padding( - child: AppText(TranslationBase.of(context).noSickLeaveApplied, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 16, - textAlign: TextAlign.center, - color: HexColor('#7E7E7E')), - padding: EdgeInsets.all(10), - ), - ], - )), - ], - ) - : SizedBox(), - model.getAllSIckLeavePatient.length > 0 - ? Column( - children: model.getAllSIckLeavePatient.map((SickLeavePatientModel item) { - return RoundedContainer( - margin: EdgeInsets.all(10), - child: Column( - children: [ - Container( - // decoration: BoxDecoration( - // border: Border( - // left: BorderSide( - // // color: item.status == 1 - // // ? Colors.yellow[800] - // // : item.status == 2 - // // ? Colors.green - // // : Colors.black, - // color: Colors.red, - // width: 5.0, - // ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.doctorName, - // item.status == 1 - // ? TranslationBase.of( - // context) - // .hold - // : item.status == 2 - // ? TranslationBase - // .of( - // context) - // .active - // : TranslationBase - // .of(context) - // .all, - fontWeight: FontWeight.bold, - // color: item.status == 1 - // ? Colors.yellow[800] - // : item.status == 2 - // ? Colors.green - // : Colors.black, - color: Colors.red, - ), - ), - Row( - children: [ - AppText(TranslationBase.of(context).daysSickleave ?? "" + ": "), - AppText( - item.sickLeaveDays.toString(), - fontWeight: FontWeight.bold, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).startDate! + ' ', - ), - Flexible( - child: AppText( - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(item.startDate!)), - fontWeight: FontWeight.bold, - ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).endDate! + ' ', - ), - Flexible( - child: AppText( - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - item.endDate ?? "", - )), - fontWeight: FontWeight.bold, - ), - ) - ], - ), - Row(children: [ - AppText(TranslationBase.of(context).branch! + ": "), - AppText( - item.projectName ?? "", - ), - ]), - Row(children: [ - AppText(TranslationBase.of(context).clinic! + ": "), - AppText( - item.clinicName ?? "", - ), - ]), - ], - ), - SizedBox( - width: 20, - ), - ], - ), - ), - ], - )), - ], - )); - }).toList(), - ) - : patient.patientStatusType != 43 - ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noSickLeave), - ) - ], - ), - ) - : SizedBox() - ])))); - } - - openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse? extendedData}) { - Navigator.push( - context, - FadePage( - page: SickLeaveScreen( - appointmentNo: isExtend == true - ? extendedData!.appointmentNo - : patient.appointmentNo, //extendedData.appointmentNo, - patientMRN: isExtend == true ? extendedData!.patientMRN : patient.patientMRN, - isExtended: isExtend, - extendedData: extendedData??GetAllSickLeaveResponse(), - patient: patient))); - } -} diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart deleted file mode 100644 index 3f0eb82f..00000000 --- a/lib/screens/sick-leave/show-sickleave.dart +++ /dev/null @@ -1,165 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:flutter/material.dart'; - -class ShowSickLeaveScreen extends StatelessWidget { - late PatiantInformtion patient; - - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; - patient = routeArgs['patient']; - return BaseView( - onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - patientProfileAppBarModel: PatientProfileAppBarModel( - patient:patient), - body: SingleChildScrollView( - child: Column( - children: [ - // PatientProfileHeaderNewDesign( - // patient, routeArgs['patientType'], routeArgs['arrivalType']), - model.getAllSIckLeave.length > 0 - ? Column( - children: model.getAllSIckLeave.map((GetAllSickLeaveResponse item) { - return RoundedContainer( - margin: EdgeInsets.all(10), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800]! - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of(context).hold - : item.status == 2 - ? TranslationBase.of(context).active - : TranslationBase.of(context).all, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - ), - ), - Row( - children: [ - AppText(TranslationBase.of(context).daysSickleave), - AppText( - item.noOfDays.toString(), - fontWeight: FontWeight.bold, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).startDate! + ' ', - ), - Flexible( - child: AppText( - AppDateUtils.convertStringToDateFormat( - item.startDate ?? "", 'dd-MMM-yyyy'), - fontWeight: FontWeight.bold, - )) - ], - ), - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - item.remarks ?? "", - ), - (item.status == 1) - ? IconButton( - icon: Image.asset('assets/images/edit.png'), - - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).sickleaveonhold) - } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - }, - ) - : SizedBox() - ]), - ], - ), - SizedBox( - width: 20, - ), - ], - ), - ), - ], - )), - ], - )); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noSickLeave), - ) - ], - ), - ) - ], - ), - ), - ), - ); - } -} diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart deleted file mode 100644 index a5ced00b..00000000 --- a/lib/screens/sick-leave/sick_leave.dart +++ /dev/null @@ -1,408 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -Helpers helpers = Helpers(); - -class SickLeaveScreen extends StatefulWidget { - final bool isExtended; - final GetAllSickLeaveResponse extendedData; - final appointmentNo; - final patientMRN; - final patient; - SickLeaveScreen( - {this.appointmentNo, this.patientMRN, this.isExtended = false, required this.extendedData, this.patient}); - @override - _SickLeaveScreenState createState() => _SickLeaveScreenState(); -} - -class _SickLeaveScreenState extends State { - DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - TextEditingController _toDateController = new TextEditingController(); - - Map profile = {}; - AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime(2050), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - // var selectedDate = DateFormat.yMd().format(pickedDate); - final df = new DateFormat('yyyy-MM-dd'); - addSickLeave.startDate = df.format(pickedDate); - - _toDateController.text = addSickLeave.startDate!; - //addSickLeave.startDate = selectedDate; - }); - }); - } - - @override - void initState() { - getProfile(); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getClinicsList(), - builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN), - builder: (_, model2, w) => GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - baseViewModel: model2, - appBarTitle: widget.isExtended == true - ? TranslationBase.of(context).extendSickLeave ?? "" - : TranslationBase.of(context).addSickLeave ?? "", - isShowAppBar: true, - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - // Padding( - // child: AppText( - // widget.isExtended == true - // ? TranslationBase.of(context) - // .extendSickLeave - // : TranslationBase.of(context) - // .addSickLeave, - // fontWeight: FontWeight.bold, - // ), - // padding: EdgeInsets.all(10)), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - padding: EdgeInsets.all(5), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(top: 5, left: 10, right: 10), - child: AppText(TranslationBase.of(context).sickLeave! + - ' ' + - TranslationBase.of(context).days!)), - AppTextFormField( - borderColor: Colors.white, - onChanged: (value) { - addSickLeave.noOfDays = value; - if (widget.extendedData.noOfDays != null) { - widget.extendedData.noOfDays = int.parse(value); - } - }, - hintText: - widget.extendedData.noOfDays != null ? widget.extendedData.noOfDays.toString() : '', - // validator: (value) { - // return TextValidator().validateName(value); - // }, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS) - ]), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - color: Colors.white, - ), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(top: 5, left: 10, right: 10), - child: AppText( - TranslationBase.of(context).sickLeaveDate, - )), - AppTextFormField( - hintText: widget.extendedData != null ? widget.extendedData.startDate : '', - borderColor: Colors.white, - prefix: IconButton(onPressed: () {}, icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - addSickLeave.startDate = value; - if (widget.extendedData != null) { - widget.extendedData.startDate = value; - } - }), - ], - )), - Container( - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - color: Colors.white, - ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(top: 5), - child: AppText( - TranslationBase.of(context).clinicName, - )), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName(model) ?? "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model.getClinicNameList().map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: SizeConfig.textMultiplier * 2.1, - color: Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => {}, - items: model.getClinicNameList().map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), - ))), - ), - ], - ) - ], - ), - )), - model2.sickLeaveStatistics['recommendedSickLeaveDays'] != null - ? Padding( - child: AppText( - model2.sickLeaveStatistics['recommendedSickLeaveDays'], - fontWeight: FontWeight.bold, - textAlign: TextAlign.start, - ), - padding: EdgeInsets.all(10), - ) - : SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - color: Colors.white, - ), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(top: 5, left: 10, right: 10), - child: AppText( - TranslationBase.of(context).doctorName, - )), - new IgnorePointer( - ignoring: true, - child: AppTextFormField( - readOnly: true, - hintText: profile['DoctorName'], - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS)) - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - color: Colors.white, - ), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(top: 5, left: 10, right: 10), - child: AppText( - TranslationBase.of(context).remarks, - )), - TextField( - maxLines: 3, - decoration: InputDecoration( - contentPadding: EdgeInsets.all(20.0), - border: InputBorder.none, - hintText: widget.extendedData != null ? widget.extendedData.remarks : ''), - onChanged: (value) { - addSickLeave.remarks = value; - if (widget.extendedData != null) { - widget.extendedData.remarks = value; - } - }, - ) - ], - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isExtended == true - ? TranslationBase.of(context).extend - : TranslationBase.of(context).addSickLeaverequest, - color: Colors.green, - onPressed: () async { - if (widget.isExtended) { - await model2.extendSickLeave(widget.extendedData); - - DrAppToastMsg.showSuccesToast( - model2.sickleaveResponse['ListSickLeavesToExtent']['success']); - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - Navigator.of(context) - .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); - //print(value); - //}); - } else { - _validateInputs(model2); - } - }, - ), - ], - ), - ), - // Column( - // children: [ - // AppText(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], - ), - ), - ), - ), - ), - ))); - } - - void _validateInputs(model2) async { - try { - if (addSickLeave.noOfDays == null) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterNoOfDays); - } else if (addSickLeave.remarks == null) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterRemarks); - } else if (addSickLeave.startDate == null) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate); - } else { - addSickLeave.patientMRN = widget.patient.patientMRN.toString(); - addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); - GifLoaderDialogUtils.showMyDialog(context); - await model2.addSickLeave(addSickLeave); - if(model2.state == ViewState.ErrorLocal){ - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showErrorToast(model2.error); - } else { - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Sick leave created successfully"); - Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; - }); - Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); - } - - - } - } catch (err) { - print(err); - } - } - - getProfile() async { - Map p = await sharedPref.getObj(DOCTOR_PROFILE); - setState(() { - this.profile = p; - }); - } - - getClinicName(model) { - var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == this.profile['ClinicID']).toList(); - return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; - } -} diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index d06e39c0..a5e0f581 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -19,7 +19,7 @@ class VideoChannel { String? tokenID, String? generalId, int? doctorId, - required String patientName, Function()? onCallEnd, + required String patientName, bool isRecording = false, Function()? onCallEnd, Function(SessionStatusModel sessionStatusModel)? onCallNotRespond, Function(String error)? onFailure, VoidCallback? onCallConnected, VoidCallback? onCallDisconnected}) async { @@ -44,12 +44,13 @@ class VideoChannel { "kSessionId": kSessionId, "kToken": kToken, "appLang": "en", - "baseUrl": BASE_URL_LIVE_CARE, //TODO change it to live + "baseUrl": BASE_URL_LIVE_CARE, "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, "DoctorId": doctorId, "patientName": patientName, + "isRecording": isRecording, }, ); if (result['callResponse'] == 'CallEnd') { diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 55700a75..26df2120 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -16,14 +16,18 @@ class AppDateUtils { } static String convertStringToDateFormat(String date, String dateFormat) { - DateTime dateTime ; - if(date.contains("/Date")) - dateTime= getDateTimeFromServerFormat(date); + DateTime dateTime; + if (date.contains("/Date")) + dateTime = getDateTimeFromServerFormat(date); else dateTime = DateTime.parse(date); return convertDateToFormat(dateTime, dateFormat); } + static String convertToServerFormat(String date, String dateFormat){ + return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/'; + } + static convertDateFromServerFormat(String str, dateFormat) { var date = getDateTimeFromServerFormat(str); @@ -41,7 +45,8 @@ class AppDateUtils { final endIndex = str.indexOf(end, startIndex + start.length); - date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); + date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); } else { date = DateTime.now(); } @@ -52,7 +57,8 @@ class AppDateUtils { return date; } - static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate, BuildContext context) { + static String differenceBetweenDateAndCurrentInYearMonthDay( + DateTime firstDate, BuildContext context) { DateTime now = DateTime.now(); // now = now.add(Duration(days: 400, minutes: 0)); var difference = firstDate.difference(now); @@ -72,13 +78,16 @@ class AppDateUtils { return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}"; } - static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context, {bool isShowSecond = false, bool isShowDays = true }) { + static String differenceBetweenDateAndCurrent( + DateTime firstDate, BuildContext context, + {bool isShowSecond = false, bool isShowDays = true}) { DateTime now = DateTime.now(); var difference = now.difference(firstDate); int minutesInDays = difference.inMinutes; int secondInDays = difference.inSeconds; - int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int + int hoursInDays = + minutesInDays ~/ 60; // ~/ : truncating division to make the result int int second = secondInDays % 60; int minutes = minutesInDays % 60; int days = hoursInDays ~/ 24; @@ -94,7 +103,8 @@ class AppDateUtils { (isShowSecond ? ", $second Sec" : ""); } - static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) { + static String differenceBetweenServerDateAndCurrent( + String str, BuildContext context) { const start = "/Date("; const end = "+0300)"; @@ -103,7 +113,8 @@ class AppDateUtils { final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); return differenceBetweenDateAndCurrent(date, context); } @@ -262,29 +273,39 @@ class AppDateUtils { /// [dateTime] convert DateTime to data formatted Arabic static String getMonthDayYearDateFormattedAr(DateTime dateTime) { if (dateTime != null) - return getMonthArabic(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString(); + return getMonthArabic(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); else return ""; } /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime, {bool isArabic = false}) { + static String getMonthDayYearDateFormatted(DateTime dateTime, + {bool isArabic = false}) { if (dateTime != null) return isArabic ? getMonthArabic(dateTime.month) - : getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString(); + : getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); else return ""; } /// get data formatted like 26 Apr 2020 /// [dateTime] convert DateTime to data formatted - static String getDayMonthYearDateFormatted(DateTime dateTime, {bool isArabic = false}) { + static String getDayMonthYearDateFormatted(DateTime dateTime, + {bool isArabic = false, bool isMonthShort = false}) { if (dateTime != null) return dateTime.day.toString() + " " + - "${isArabic ? getMonthArabic(dateTime.month) : getMonth(dateTime.month)}" + + "${isArabic ? getMonthArabic(dateTime.month) : isMonthShort ? getMonth(dateTime.month).toString().substring(0, 3) : getMonth(dateTime.month)}" + " " + dateTime.year.toString(); else @@ -293,9 +314,14 @@ class AppDateUtils { /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted - static String getDayMonthYearDate(DateTime dateTime, {bool isArabic = false}) { + static String getDayMonthYearDate(DateTime dateTime, + {bool isArabic = false}) { if (dateTime != null) - return dateTime.day.toString() + "/" + "${dateTime.month}" + "/" + dateTime.year.toString(); + return dateTime.day.toString() + + "/" + + "${dateTime.month}" + + "/" + + dateTime.year.toString(); else return ""; } @@ -306,7 +332,8 @@ class AppDateUtils { return DateFormat('hh:mm a').format(dateTime); } - static String getAgeByBirthday(String birthOfDate, BuildContext context, {bool isServerFormat = true}) { + static String getAgeByBirthday(String birthOfDate, BuildContext context, + {bool isServerFormat = true}) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate; if (birthOfDate.contains("/Date")) { @@ -331,7 +358,9 @@ class AppDateUtils { static bool isToday(DateTime dateTime) { DateTime todayDate = DateTime.now().toUtc(); - if (dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) { + if (dateTime.day == todayDate.day && + dateTime.month == todayDate.month && + dateTime.year == todayDate.year) { return true; } return false; @@ -340,7 +369,11 @@ class AppDateUtils { static String getDate(DateTime dateTime) { print(dateTime); if (dateTime != null) - return getMonth(dateTime.month) + " " + dateTime.day.toString() + "," + dateTime.year.toString(); + return getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + "," + + dateTime.year.toString(); else return ""; } @@ -348,7 +381,11 @@ class AppDateUtils { static String getDateFormatted(DateTime dateTime) { print(dateTime); if (dateTime != null) - return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString(); + return dateTime.day.toString() + + "/" + + dateTime.month.toString() + + "/" + + dateTime.year.toString(); else return ""; } @@ -376,25 +413,23 @@ class AppDateUtils { return ""; } - // handel date like "09/05/2021 17:00" static DateTime getDateTimeFromString(String str) { - List array = str.split('/'); + List array = str.split('/'); int day = int.parse(array[0]); int month = int.parse(array[1]); - List array2 = array[2].split(' '); + List array2 = array[2].split(' '); int year = int.parse(array2[0]); String hour = array2[1]; List hourList = hour.split(":"); - DateTime date = DateTime(year, month, day, int.parse(hourList[0]), int.parse(hourList[1])); - + DateTime date = DateTime( + year, month, day, int.parse(hourList[0]), int.parse(hourList[1])); return date; } - static convertDateFormatImproved(String str) { String newDate =''; const start = "/Date("; @@ -413,6 +448,6 @@ class AppDateUtils { date.day.toString().padLeft(2, '0'); } - return newDate; + return newDate ; } } diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index ae638fe4..a0fd8082 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,3 +1,17 @@ extension Extension on Object { bool isNullOrEmpty() => this == ''; } + +/// truncate the [String] without cutting words. The length is calculated with the suffix. +extension Truncate on String { + String truncate(int max, {String suffix = ''}) { + try { + return length <= max + ? this + : '${substring(0, max - suffix.length)}$suffix'; + } catch (e){ + return this; + } + } +} + diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index ad0191b9..d1a6d0a5 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,6 +1,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; +import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -14,6 +15,7 @@ import 'package:html/parser.dart'; import '../UpdatePage.dart'; import '../config/size_config.dart'; +import '../locator.dart'; import '../util/dr_app_toast_msg.dart'; import 'dr_app_shared_pref.dart'; @@ -176,16 +178,26 @@ class Helpers { } navigateToUpdatePage(String message, String androidLink, iosLink) { - Navigator.pushAndRemoveUntil( - AppGlobal.CONTEX, - FadePage( - page: UpdatePage( - message: message, - androidLink: androidLink, - iosLink: iosLink, - ), + locator().pushAndRemoveUntil( + FadePage( + page: UpdatePage( + message: message, + androidLink: androidLink, + iosLink: iosLink, ), - (r) => false); + ), + ); + + // Navigator.pushAndRemoveUntil( + // AppGlobal.CONTEX, + // FadePage( + // page: UpdatePage( + // message: message, + // androidLink: androidLink, + // iosLink: iosLink, + // ), + // ), + // (r) => false); } static String parseHtmlString(String htmlString) { @@ -276,4 +288,13 @@ class Helpers { String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } + + static double getTextFieldHeight() { + return SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 10 + : SizeConfig.isHeightShort + ? 8 + : 6); + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 69f5eafe..2de4d13d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -91,7 +91,8 @@ class TranslationBase { String? get inPatient => localizedValues['inPatient']![locale.languageCode]; String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; - String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; + String? get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; + String get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; @@ -210,7 +211,8 @@ class TranslationBase { String? get replay => localizedValues['replay']![locale.languageCode]; - String? get progressNote => localizedValues['progressNote']![locale.languageCode]; + String? get progressNote =>localizedValues['progressNote'][locale.languageCode]; + String get operationReports => localizedValues['operationReports']![locale.languageCode]; String? get progress => localizedValues['progress']![locale.languageCode]; @@ -285,13 +287,17 @@ class TranslationBase { String? get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode']![locale.languageCode]; - String? get youDontHaveAnyPatient => localizedValues['youDon\'tHaveAnyPatient']![locale.languageCode]; + String? get youDontHaveAnyPatient => localizedValues['youDontHaveAnyPatient']![locale.languageCode]; String? get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem']![locale.languageCode]; String? get age => localizedValues['age']![locale.languageCode]; String? get nationality => localizedValues['nationality']![locale.languageCode]; + String get occupation => localizedValues['occupation'][locale.languageCode]; + String get healthID => localizedValues['healthID'][locale.languageCode]; + String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; + String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; String? get today => localizedValues['today']![locale.languageCode]; @@ -476,6 +482,7 @@ class TranslationBase { String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; String? get next => localizedValues['next']![locale.languageCode]; + String get finish => localizedValues['finish'][locale.languageCode]; String? get previous => localizedValues['previous']![locale.languageCode]; @@ -582,8 +589,7 @@ class TranslationBase { String? get patternOfRespiration => localizedValues['patternOfRespiration']![locale.languageCode]; - String? get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; + String? get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]; String? get cuffLocation => localizedValues['cuffLocation']![locale.languageCode]; @@ -847,8 +853,7 @@ class TranslationBase { String? get selectProcedures => localizedValues['selectProcedures']![locale.languageCode]; String? get addSelectedProcedures => localizedValues['addSelectedProcedures']![locale.languageCode]; - String? get addProcedures => - localizedValues['addProcedures']![locale.languageCode]; + String? get addProcedures => localizedValues['addProcedures']![locale.languageCode]; String? get updateProcedure => localizedValues['updateProcedure']![locale.languageCode]; @@ -986,6 +991,9 @@ class TranslationBase { String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; String? get searchHere => localizedValues['searchHere']![locale.languageCode]; String? get remove => localizedValues['remove']![locale.languageCode]; + String get inProgress => localizedValues['inProgress'][locale.languageCode]; + String get completed => localizedValues['Completed'][locale.languageCode]; + String get locked => localizedValues['Locked'][locale.languageCode]; String? get step => localizedValues['step']![locale.languageCode]; String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; @@ -1089,6 +1097,21 @@ class TranslationBase { String? get addPrescription => localizedValues['addPrescription']![locale.languageCode]; String? get edit => localizedValues['edit']![locale.languageCode]; String? get summeryReply => localizedValues['summeryReply']![locale.languageCode]; + String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; + String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; + String get roomNo => localizedValues['roomNo'][locale.languageCode]; + String get seeMore => localizedValues['seeMore'][locale.languageCode]; + String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; + String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; + String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; + String get underProcess => localizedValues['underProcess'][locale.languageCode]; + String get textResponse => localizedValues['textResponse'][locale.languageCode]; + String get special => localizedValues['special'][locale.languageCode]; + String get requestType => localizedValues['requestType'][locale.languageCode]; + String get allClinic => localizedValues['allClinic'][locale.languageCode]; + String get notReplied => localizedValues['notReplied'][locale.languageCode]; + String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; + String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index e7553b9c..1ef79976 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -56,9 +56,13 @@ class PatientReferralItemWidget extends StatelessWidget { child: CardWithBgWidget( bgColor: referralStatusCode == 1 ? Color(0xffc4aa54) - : referralStatusCode == 46 || referralStatusCode == 2 - ? Colors.green[700]! - : Colors.red[700]!, + : referralStatusCode == 2 + ? Colors.green[700] + : referralStatusCode == 46 + ? Colors.green[900] + : referralStatusCode == 4 + ? Colors.red[700] + : Colors.red[900], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -76,9 +80,13 @@ class PatientReferralItemWidget extends StatelessWidget { fontWeight: FontWeight.w700, color: referralStatusCode == 1 ? Color(0xffc4aa54) - : referralStatusCode == 46 || referralStatusCode == 2 + : referralStatusCode == 2 ? Colors.green[700] - : Colors.red[700], + : referralStatusCode == 46 + ? Colors.green[900] + : referralStatusCode == 4 + ? Colors.red[700] + : Colors.red[900], ), AppText( referredDate ?? '', @@ -146,7 +154,7 @@ class PatientReferralItemWidget extends StatelessWidget { patientID!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -157,7 +165,8 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ AppText( isSameBranch - ? TranslationBase.of(context).referredFrom + ? TranslationBase.of(context) + .referredFrom : TranslationBase.of(context).refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -166,14 +175,15 @@ class PatientReferralItemWidget extends StatelessWidget { ), Expanded( child: AppText( - !isReferralClinic! + !isReferralClinic + ! ? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch : " " + referralClinic!, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -198,7 +208,7 @@ class PatientReferralItemWidget extends StatelessWidget { height: 25, width: 30, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { - return Text('No Image'); + return Text(''); }, )) : SizedBox() @@ -222,7 +232,7 @@ class PatientReferralItemWidget extends StatelessWidget { remark ?? "", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), maxLines: 1, ), diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 4a27347a..88e72b7e 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -6,8 +6,11 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import '../../../util/extenstions.dart'; import 'ShowTimer.dart'; @@ -35,6 +38,15 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { + String nationalityName = patientInfo.nationalityName != null + ? patientInfo.nationalityName.trim() + : patientInfo.nationality != null + ? patientInfo.nationality.trim() + : patientInfo.nationalityId != + null + ? patientInfo.nationalityId + : ""; + return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), @@ -222,10 +234,15 @@ class PatientCard extends StatelessWidget { Padding( padding: EdgeInsets.only(left: 12.0), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( - child: Row(children: [ + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start,children: [ Expanded( // width: MediaQuery.of(context).size.width*0.51, child: AppText( @@ -250,44 +267,52 @@ class PatientCard extends StatelessWidget { Icon( DoctorApp.female_1, color: Colors.pink, - ), - if (isFromLiveCare) + +), if (isFromLiveCare) ShowTimer( patientInfo: patientInfo, ), ]), ), - Row( - children: [ - AppText( - patientInfo.nationalityName != null - ? patientInfo.nationalityName!.trim() - : patientInfo.nationality != null - ? patientInfo.nationality!.trim() - : patientInfo.nationalityId != null - ? patientInfo.nationalityId - : "", - fontWeight: FontWeight.bold, - fontSize: 14, - textOverflow: TextOverflow.ellipsis, - ), - patientInfo.nationality != null || patientInfo.nationalityId != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - patientInfo.nationalityFlagURL != null ? patientInfo.nationalityFlagURL! : '', - height: 25, - width: 30, - errorBuilder: - (BuildContext context, Object exception, StackTrace? stackTrace) { - return AppText( + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + alignment: Alignment.centerRight, + child: AppText( + nationalityName.truncate(14), + fontWeight: FontWeight.bold, + fontSize: 14, + textOverflow: TextOverflow.ellipsis, + ), + ), + ), + patientInfo.nationality != null || + patientInfo.nationalityId != null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: CachedNetworkImage( + imageUrl: patientInfo + .nationalityFlagURL != + null + ? patientInfo.nationalityFlagURL + : '', + height: 25, + width: 30, + errorWidget: + (context, url, error) => + AppText( 'No Image', fontSize: 10, - ); - }, - )) - : SizedBox() - ], + ), + )) + : SizedBox() + ], + ), ) ], )), @@ -314,107 +339,75 @@ class PatientCard extends StatelessWidget { width: 10, ), Expanded( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.patientId.toString(), - style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 13)), - ], - ), - ), - ), - //if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).age ?? "" + " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), - ], - ), - ), - ), - if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: patientInfo.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate ?? "" + " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: patientInfo.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), - ]))), - if (patientInfo.admissionDate != null) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).numOfDays ?? "" + " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate ?? "")).inDays + 1}", - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), - ]))), - if (isFromLiveCare) - Column( - children: [ - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).clinic ?? "" + " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: patientInfo.clinicName, - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 13)), - ], + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomRow( + label: + TranslationBase.of(context).fileNumber, + value: patientInfo.patientId.toString(), ), - ), - ), - ], + CustomRow( + label: + TranslationBase.of(context).age + " : ", + value: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + ), + if (isInpatient) + CustomRow( + label: patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + value: patientInfo.admissionDate == null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .numOfDays + + " : ", + value: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: TranslationBase.of(context) + .clinicName + + " : ", + value: "${patientInfo.clinicDescription}", + ), + if (patientInfo.admissionDate != null) + CustomRow( + label: + TranslationBase.of(context).roomNo + + " : ", + value: "${patientInfo.roomId}", + ), + if (isFromLiveCare) + Column( + children: [ + CustomRow( + label: TranslationBase.of(context) + .clinic + + " : ", + value: patientInfo.clinicName, + ), + ], + ), + ]), ), - ])) + Icon( + Icons.arrow_forward, + size: 24, + ), + ], + )) ]), isFromLiveCare ? Row( diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 6191fd4d..700e7a2b 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -49,7 +49,8 @@ class PatientProfileButton extends StatelessWidget { this.isSelectInpatient = false, this.isDartIcon = false, this.dartIcon, - this.isFromLiveCare = false, this.color, + this.isFromLiveCare = false, + this.color, }) : super(key: key); @override @@ -78,7 +79,7 @@ class PatientProfileButton extends StatelessWidget { ? Icon( dartIcon, size: 30, - color: color?? Color(0xFF333C45), + color: color ?? Color(0xFF333C45), ) : new Image.asset( url + icon, @@ -91,23 +92,23 @@ class PatientProfileButton extends StatelessWidget { )), Container( alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, - padding: EdgeInsets.symmetric(horizontal: 8), + padding: EdgeInsets.symmetric(horizontal: 7), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( !projectsProvider.isArabic ? this.nameLine1 : nameLine2, - color: color??Color(0xFF2B353E), + color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 1.5, + fontSize: SizeConfig.textMultiplier * 1.35, ), AppText( !projectsProvider.isArabic ? this.nameLine2 : nameLine1, - color: color??Color(0xFF2B353E), + color: color ?? Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 1.5, + fontSize: SizeConfig.textMultiplier * 1.35, ), if (isLoading) DrAppCircularProgressIndeicator() ], @@ -120,7 +121,7 @@ class PatientProfileButton extends StatelessWidget { color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), border: Border.fromBorderSide(BorderSide( - color: color??Color(0xffBBBBBB), + color: color ?? Color(0xffBBBBBB), width: 1, )), ), diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 1ff7f1a3..5158d466 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -37,15 +37,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { bottom: 5, ), decoration: BoxDecoration( - color: Colors.white, - ), + color: Colors.white, + border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), child: Column( children: [ Container( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only( + left: SizeConfig.isHeightVeryShort ? 0 : 12.0), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -67,6 +68,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { fontWeight: FontWeight.bold, fontFamily: 'Poppins', color: Color(0xFF2B353E), + isCopyable: true, ), ), gender == 1 @@ -112,10 +114,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), Row(children: [ Padding( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only( + left: SizeConfig.isHeightVeryShort ? 0 : 12.0), child: Container( - width: 60, - height: 60, + width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, + height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -140,22 +143,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, ) : AppText( TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, ), patientProfileAppBarModel.patient!.startTime != null - ? AppText( - patientProfileAppBarModel.patient!.startTime != null - ? patientProfileAppBarModel.patient!.startTime - : '', + ? AppText(patientProfileAppBarModel.patient!.startTime != null ? patientProfileAppBarModel.patient!.startTime : '', fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, color: Color(0xFF2E303A)) : SizedBox() ], @@ -165,29 +171,29 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RichText( - text: TextSpan( - style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 10, - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - ), - new TextSpan( - text: patientProfileAppBarModel.patient!.patientId.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 12, - color: Color(0xFF2E303A), - )), - ], - ), + Row( + children: [ + AppText( + TranslationBase.of(context).fileNumber, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + patient.patientId.toString(), + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], ), Row( children: [ @@ -197,7 +203,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { patientProfileAppBarModel.patient!.nationalityId ?? '', fontWeight: FontWeight.bold, - fontSize: 12, + fontSize: + SizeConfig.getTextMultiplierBasedOnWidth() * + 3.5, ), patientProfileAppBarModel.patient!.nationalityFlagURL != null ? ClipRRect( @@ -215,142 +223,52 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ) ], ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of(context).age! + " : ", - style: TextStyle( - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - )), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel.isFromLiveCare!)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - )), - ], - ), - ), - ), - if (patientProfileAppBarModel.patient!.appointmentDate != null && + HeaderRow( + label: TranslationBase.of(context).age + " : ", + value: + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + ),if (patientProfileAppBarModel.patient!.appointmentDate != null && patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && !isFromLabResult) - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( + HeaderRow( + label: TranslationBase.of(context).appointmentDate! + " : ", - fontSize: 10, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - SizedBox( - width: 3.5, - ), - AppText( + value: AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)), - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ), - SizedBox( - height: 0.5, - ) - ], ), if (patientProfileAppBarModel.isFromLabResult!) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: "Result Date: ", - style: TextStyle( - fontSize: 10, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - )), - new TextSpan( - text: + + HeaderRow( + label: "Result Date: ", + value: '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', - style: TextStyle(fontWeight: FontWeight.w700, fontSize: 12)), - ], - ), - ), + ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient!.admissionDate != null && - patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: patientProfileAppBarModel.patient!.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate! + " : ", - style: TextStyle(fontSize: 10)), - new TextSpan( - text: patientProfileAppBarModel.patient!.admissionDate == null - ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - )), - ]))), - if (patientProfileAppBarModel.patient!.admissionDate != null) - Row( - children: [ - AppText("${TranslationBase.of(context).numOfDays}: ", - fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), - if (patientProfileAppBarModel.isDischargedPatient! && - patientProfileAppBarModel.patient!.dischargeDate != null) - AppText( - "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ) - else - AppText( - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", - fontWeight: FontWeight.w700, - fontSize: 12, - color: Color(0xFF2E303A), - ), - ], + if (patient.admissionDate != null && + patient.admissionDate.isNotEmpty) + HeaderRow( + label: patient.admissionDate == null + ? "" + : TranslationBase.of(context).admissionDate + + " : ", + value: patient.admissionDate == null + ? "" + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", ), + if (patient.admissionDate != null) + HeaderRow( + label: "${TranslationBase.of(context).numOfDays}: ", + value: isDischargedPatient && + patient.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ) ], ), ], @@ -392,106 +310,56 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { flex: 5, child: Container( margin: EdgeInsets.all(10), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - '${TranslationBase.of(context).dr}${patientProfileAppBarModel.doctorName}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - fontSize: 12, - ), - if (patientProfileAppBarModel.orderNo != null && - !patientProfileAppBarModel.isPrescriptions!) - Row( - children: [ - AppText( - 'Order No: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + '${TranslationBase.of(context).dr}$doctorName', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + isCopyable: true, + ), + if (orderNo != null && !isPrescriptions) + HeaderRow( + label: 'Order No: ', + value: orderNo ?? '', ), - AppText(patientProfileAppBarModel.orderNo ?? '', fontSize: 12) - ], - ), - if (patientProfileAppBarModel.invoiceNO != null && - !patientProfileAppBarModel.isPrescriptions!) - Row( - children: [ - AppText( - 'Invoice: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), + if (invoiceNO != null && !isPrescriptions) + HeaderRow( + label: 'Invoice: ', + value: invoiceNO ?? "", ), - AppText(patientProfileAppBarModel.invoiceNO ?? "", fontSize: 12) - ], - ), - if (patientProfileAppBarModel.branch != null) - Row( - children: [ - AppText( - 'Branch: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), + if (branch != null) + HeaderRow( + label: 'Branch: ', + value: branch ?? '', ), - AppText(patientProfileAppBarModel.branch ?? '', fontSize: 12) - ], - ), - if (patientProfileAppBarModel.clinic != null) - Row( - children: [ - AppText( - 'Clinic: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), + if (clinic != null) + HeaderRow( + label: 'Clinic: ', + value: clinic ?? '', ), - AppText(patientProfileAppBarModel.clinic ?? '', fontSize: 12) - ], - ), - if (patientProfileAppBarModel.isMedicalFile! && - patientProfileAppBarModel.episode != null) - Row( - children: [ - AppText( - 'Episode: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), + if (isMedicalFile && episode != null) + HeaderRow( + label: 'Episode: ', + value: episode ?? '', ), - AppText(patientProfileAppBarModel.episode ?? '', fontSize: 12) - ], - ), - if (patientProfileAppBarModel.isMedicalFile! && - patientProfileAppBarModel.visitDate != null) - Row( - children: [ - AppText( - 'Visit Date: ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), + if (isMedicalFile && visitDate != null) + HeaderRow( + label: 'Visit Date: ', + value: visitDate ?? '', ), - AppText(patientProfileAppBarModel.visitDate ?? '', fontSize: 12) - ], - ), - if (!patientProfileAppBarModel.isMedicalFile!) - Row( - children: [ - AppText( - !patientProfileAppBarModel.isPrescriptions! + if (!isMedicalFile) + HeaderRow( + label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - fontSize: 10, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ), - AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', - fontSize: 12, - ) - ], - ) + value: + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), ]), ), ), @@ -526,3 +394,35 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { : 130) : patientProfileAppBarModel.height!); } + +class HeaderRow extends StatelessWidget { + final String label; + final String value; + + const HeaderRow({Key? key, this.label, this.value}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + AppText( + label, + isCopyable: true, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart new file mode 100644 index 00000000..f0678e22 --- /dev/null +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -0,0 +1,368 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget + with PreferredSizeWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + final bool isDischargedPatient; + final bool isFromLiveCare; + + final Stream videoCallDurationStream; + + PatientProfileHeaderNewDesignAppBar( + this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, + this.isInpatient = false, + this.isDischargedPatient = false, + this.isFromLiveCare = false, + this.videoCallDurationStream}); + + @override + Widget build(BuildContext context) { + int gender = 1; + if (patient.patientDetails != null) { + gender = patient.patientDetails.gender; + } else { + gender = patient.gender; + } + return Container( + padding: EdgeInsets.only( + left: 0, + right: 5, + bottom: 5, + ), + decoration: BoxDecoration( + color: Colors.white, + ), + height: height == 0 + ? isInpatient + ? 220 + : 200 + : height, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + patient.firstName != null + ? (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.fullName ?? + patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () async { + await locator().logEvent( + eventCategory: "Patient Profile Header", + eventAction: "Call Patient", + ); + launch("tel://" + patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), + StreamBuilder( + stream: videoCallDurationStream, + builder: + (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.hasData && snapshot.data != null) + return InkWell( + onTap: () {}, + child: Container( + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20)), + padding: + EdgeInsets.symmetric(vertical: 2, horizontal: 10), + child: Text( + snapshot.data, + style: TextStyle(color: Colors.white), + ), + ), + ); + else + return Container(); + }, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patient.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + arrivalType == '1' || patient.arrivedOn == null + ? AppText( + patient.startTime != null + ? patient.startTime + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : AppText( + patient.arrivedOn != null + ? AppDateUtils + .convertStringToDateFormat( + patient.arrivedOn, + 'MM-dd-yyyy HH:mm') + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[int.parse(patientType)] == + "List_MyOutPatient" && + !isFromLiveCare) + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + patient.startTime ?? "", + color: Colors.white, + fontSize: 1.5 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2( + patient.appointmentDate ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + HeaderRow( + label: TranslationBase.of(context).fileNumber, + value: patient.patientId.toString(), + ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + alignment: Alignment.centerRight, + child: AppText( + patient.nationalityName ?? + patient.nationality ?? + patient.nationalityId ?? + '', + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + ), + patient.nationalityFlagURL != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + patient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text(''); + }, + )) + : SizedBox() + ], + ), + ) + ], + ), + HeaderRow( + label: TranslationBase.of(context).age + " : ", + value: + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + ), + if (isInpatient) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + HeaderRow( + label: patient.admissionDate == null + ? "" + : TranslationBase.of(context).admissionDate + + " : ", + value: patient.admissionDate == null + ? "" + : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"), + if (patient.admissionDate != null) + HeaderRow( + label: "${TranslationBase.of(context).numOfDays}: ", + value: isDischargedPatient && + patient.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ) + ], + ) + ], + ), + ), + ]), + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String newDate; + const start = "/Date("; + if (str.isNotEmpty) { + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + } + + return newDate ?? ''; + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } + + @override + Size get preferredSize => Size(double.maxFinite, 200); +} diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index 3f117410..f160d78e 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -67,6 +67,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { builder: (context) => OutPatientPrescriptionDetailsScreen( prescriptionResModel: patientPrescriptionsList[index], ), + settings: RouteSettings(name: 'OutPatientPrescriptionDetailsScreen') ), ); }, diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 207c6986..5c6eb5f6 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -2,11 +2,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:cached_network_image/cached_network_image.dart'; class ProfileWelcomeWidget extends StatelessWidget { final Widget clinicWidget; final double height; final bool isClinic; + ProfileWelcomeWidget(this.clinicWidget, {this.height = 150, this.isClinic = false}); @override @@ -29,8 +31,8 @@ class ProfileWelcomeWidget extends StatelessWidget { // radius: (52) child: ClipRRect( borderRadius: BorderRadius.circular(20), - child: Image.network( - authenticationViewModel.doctorProfile!.doctorImageURL ?? "", + child: CachedNetworkImage( + imageUrl: authenticationViewModel.doctorProfile!.doctorImageURL ?? "", fit: BoxFit.fill, width: SizeConfig.widthMultiplier* 11, height: SizeConfig.widthMultiplier* 11, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart new file mode 100644 index 00000000..55a3d105 --- /dev/null +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -0,0 +1,188 @@ +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ProfileMedicalInfoWidget extends StatelessWidget { + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final bool isInpatient; + + ProfileMedicalInfoWidget( + {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: HEALTH_SUMMARY, + nameLine1: "Health", //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ALL_SPECIAL_LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).special, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 2cf57c01..e457b6dd 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -13,7 +13,7 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget { final PatiantInformtion patient; final String patientType; final String? arrivalType; - final bool? isInpatient; + final bool isInpatient; final bool? isDischargedPatient; ProfileMedicalInfoWidgetSearch( @@ -23,7 +23,7 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget { this.arrivalType, required this.from, required this.to, - this.isInpatient, + this.isInpatient = false, this.isDischargedPatient}); @override @@ -53,464 +53,167 @@ class _ProfileMedicalInfoWidgetSearchState extends State[ - Container( - width: MediaQuery.of(context).size.width * 0.35, - height: MediaQuery.of(context).size.height * 0.06, - child: Center( - child: Text('Inpatient Info'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - height: MediaQuery.of(context).size.height * 0.06, - child: Center( - child: Text('OutPatient Info'), - ), - ), - ]), - ), - body: Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0), - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - from: widget.from, - to: widget.to, - nameLine1: TranslationBase.of(context).vital ?? "", - nameLine2: TranslationBase.of(context).signs ?? "", - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab ?? "", - nameLine2: TranslationBase.of(context).result ?? "", - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - isInPatient: widget.isInpatient!, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology ?? "", - nameLine2: TranslationBase.of(context).result ?? "", - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient!, - nameLine2: TranslationBase.of(context).prescription!, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PROGRESS_NOTE, - isDischargedPatient: widget.isDischargedPatient!, - nameLine1: TranslationBase.of(context).progress ?? "", - nameLine2: TranslationBase.of(context).note ?? "", - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ORDER_NOTE, - isDischargedPatient: widget.isDischargedPatient!, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders ?? "", - nameLine2: TranslationBase.of(context).procedures ?? "", - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: HEALTH_SUMMARY, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral ?? "", - nameLine2: TranslationBase.of(context).patient ?? "", - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance ?? "", - nameLine2: TranslationBase.of(context).approvals ?? "", - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick ?? "", - nameLine2: TranslationBase.of(context).leave ?? "", - icon: 'patient/patient_sick_leave.png'), - ], - ), - GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - from: widget.from, - to: widget.to, - nameLine1: TranslationBase.of(context).vital ?? "", - nameLine2: TranslationBase.of(context).signs ?? "", - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: HEALTH_SUMMARY, - nameLine1: "Health", //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab ?? "", - nameLine2: TranslationBase.of(context).result ?? "", - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - isInPatient: widget.isInpatient!, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology ?? "", - nameLine2: TranslationBase.of(context).service ?? "", - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient ?? "", - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders ?? "", - nameLine2: TranslationBase.of(context).prescription ?? "", - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders ?? "", - nameLine2: TranslationBase.of(context).procedures ?? "", - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance ?? "", - nameLine2: TranslationBase.of(context).service ?? "", - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick ?? "", - nameLine2: TranslationBase.of(context).leave ?? "", - icon: 'patient/patient_sick_leave.png'), - if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PATIENT_UCAF_REQUEST, - isDisable: widget.patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient ?? "", - nameLine2: TranslationBase.of(context).ucaf ?? "", - icon: 'patient/ucaf.png'), - if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: REFER_PATIENT_TO_DOCTOR, - isDisable: widget.patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral ?? "", - nameLine2: TranslationBase.of(context).patient ?? "", - icon: 'patient/refer_patient.png'), - if (widget.patient.appointmentNo != null && widget.patient.appointmentNo != 0) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PATIENT_ADMISSION_REQUEST, - isDisable: widget.patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission ?? "", - nameLine2: TranslationBase.of(context).request ?? "", - icon: 'patient/admission_req.png'), - if (widget.isInpatient!) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress ?? "", - nameLine2: TranslationBase.of(context).note ?? "", - icon: 'patient/Progress_notes.png'), - if (widget.isInpatient!) - PatientProfileButton( - patient: widget.patient, - patientType: widget.patientType, - arrivalType: widget.arrivalType ?? "", - route: ORDER_NOTE, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), - ], - ), - ], - ), + body: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 8, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + from: widget.from, + to: widget.to, + nameLine1: TranslationBase.of(context).vital??'', + nameLine2: TranslationBase.of(context).signs??'', + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: HEALTH_SUMMARY, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab??'', + nameLine2: TranslationBase.of(context).result??'', + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + isInPatient: widget.isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology??'', + nameLine2: TranslationBase.of(context).service??'', + icon: 'patient/health_summary.png'), + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient??'', + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders??'', + nameLine2: TranslationBase.of(context).prescription??'', + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders??'', + nameLine2: TranslationBase.of(context).procedures??'', + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance??'', + nameLine2: TranslationBase.of(context).service??'', + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick??'', + nameLine2: TranslationBase.of(context).leave??'', + icon: 'patient/patient_sick_leave.png'), + if (widget.patient.appointmentNo != null && + widget.patient.appointmentNo != 0) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: PATIENT_UCAF_REQUEST, + isDisable: + widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient??'', + nameLine2: TranslationBase.of(context).ucaf??'', + icon: 'patient/ucaf.png'), + if (widget.patient.appointmentNo != null && + widget.patient.appointmentNo != 0) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral??'', + nameLine2: TranslationBase.of(context).patient??'', + icon: 'patient/refer_patient.png'), + if (widget.patient.appointmentNo != null && + widget.patient.appointmentNo != 0) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: PATIENT_ADMISSION_REQUEST, + isDisable: + widget.patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission??'', + nameLine2: TranslationBase.of(context).request??'', + icon: 'patient/admission_req.png'), + if (widget.isInpatient) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress??'', + nameLine2: TranslationBase.of(context).note??'', + icon: 'patient/Progress_notes.png'), + if (widget.isInpatient) + PatientProfileButton( + + patient: widget.patient, + patientType: widget.patientType, + arrivalType: widget.arrivalType??"", + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], ), ), ), - - // GridView.count( - // shrinkWrap: true, - // physics: NeverScrollableScrollPhysics(), - // crossAxisSpacing: 10, - // mainAxisSpacing: 10, - // childAspectRatio: 1 / 1.0, - // crossAxisCount: 3, - // children: [ - // PatientProfileButton( - // - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // from: from, - // to: to, - // nameLine1: TranslationBase.of(context).vital, - // nameLine2: TranslationBase.of(context).signs, - // route: VITAL_SIGN_DETAILS, - // icon: 'patient/vital_signs.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: MEDICAL_FILE, - // nameLine1: - // "Health", //TranslationBase.of(context).medicalReport, - // nameLine2: - // "Summary", //TranslationBase.of(context).summaryReport, - // icon: 'patient/health_summary.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: LAB_RESULT, - // nameLine1: TranslationBase.of(context).lab, - // nameLine2: TranslationBase.of(context).result, - // icon: 'patient/lab_results.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // isInPatient: isInpatient, - // route: RADIOLOGY_PATIENT, - // nameLine1: TranslationBase.of(context).radiology, - // nameLine2: TranslationBase.of(context).service, - // icon: 'patient/health_summary.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: PATIENT_ECG, - // nameLine1: TranslationBase.of(context).patient, - // nameLine2: "ECG", - // icon: 'patient/patient_sick_leave.png'), - // (int.parse(patientType) == 7 || - // int.parse(patientType) == 6) - // ? PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: ORDER_PRESCRIPTION_NEW, - // nameLine1: TranslationBase.of(context).orders, - // nameLine2: - // TranslationBase.of(context).prescription, - // icon: 'patient/order_prescription.png') - // : PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: ORDER_PRESCRIPTION_NEW, - // nameLine1: TranslationBase.of(context).orders, - // nameLine2: - // TranslationBase.of(context).prescription, - // icon: 'patient/order_prescription.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: ORDER_PROCEDURE, - // nameLine1: TranslationBase.of(context).orders, - // nameLine2: TranslationBase.of(context).procedures, - // icon: 'patient/Order_Procedures.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: PATIENT_INSURANCE_APPROVALS_NEW, - // nameLine1: TranslationBase.of(context).insurance, - // nameLine2: TranslationBase.of(context).service, - // icon: 'patient/vital_signs.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: SHOW_SICKLEAVE, - // nameLine1: TranslationBase.of(context).patientSick, - // nameLine2: TranslationBase.of(context).leave, - // icon: 'patient/patient_sick_leave.png'), - // if (patient.admissionNo != null && - // patient.admissionNo != "0") - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: PROGRESS_NOTE, - // nameLine1: TranslationBase.of(context).progress, - // nameLine2: TranslationBase.of(context).note, - // icon: 'patient/Progress_notes.png'), - // if (patient.admissionNo != null && - // patient.admissionNo != "0") - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: ORDER_NOTE, - // nameLine1: "Order", //"Text", - // nameLine2: "Sheet", - // icon: 'patient/Progress_notes.png'), - // if (patient.appointmentNo != null && - // patient.appointmentNo != 0) - // PatientProfileButton( - // key: key, - // patient: patient, - // patientType: patientType, - // arrivalType: arrivalType, - // route: REFER_PATIENT_TO_DOCTOR, - // // isDisable: patient.patientStatusType != 43 ? true : false, - // nameLine1: TranslationBase.of(context).referral, - // nameLine2: TranslationBase.of(context).patient, - // icon: 'patient/refer_patient.png'), - // ], - // ), ), ); } diff --git a/lib/widgets/patients/profile/profile_status_info_widget.dart b/lib/widgets/patients/profile/profile_status_info_widget.dart deleted file mode 100644 index 56ffdca3..00000000 --- a/lib/widgets/patients/profile/profile_status_info_widget.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; -import '../../shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:13/4/2020 - *@param: - *@return: ProfileStatusInfoWidget - *@desc: Profile Status Info Widget - */ -class ProfileStatusInfoWidget extends StatelessWidget { - const ProfileStatusInfoWidget({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return RoundedContainer( - child: ListView( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Insurance approval', - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.w700, - color: HexColor('#58434F'), - ), - AppText( - 'Approved', - color: HexColor('#707070'), - fontSize: SizeConfig.textMultiplier * 2.5, - ) - ], - ), - ), - ], - ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.12, - ); - } -} diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index ae51555a..e5146645 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -129,6 +129,7 @@ class _AppDrawerState extends State { context, MaterialPageRoute( builder: (context) => AddRescheduleLeavScreen(), + settings: RouteSettings(name: 'AddRescheduleLeaveScreen') // MyReferredPatient(), )); }, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 108b987c..df02cdfd 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -1,6 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { @@ -30,6 +33,7 @@ class AppText extends StatefulWidget { final bool? visibility; final TextOverflow? textOverflow; final TextDecoration? textDecoration; + final bool? isCopyable; AppText( this.text, { @@ -58,6 +62,7 @@ class AppText extends StatefulWidget { this.textOverflow, this.textDecoration, this.letterSpacing, + this.isCopyable = false, }); @override @@ -93,79 +98,121 @@ class _AppTextState extends State { @override Widget build(BuildContext context) { - return Container( - margin: widget.margin != null - ? EdgeInsets.all(widget.margin!) - : EdgeInsets.only( - top: widget.marginTop!, - right: widget.marginRight!, - bottom: widget.marginBottom!, - left: widget.marginLeft!), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Text( - !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), - textAlign: widget.textAlign, - overflow: widget.maxLines != null - ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) - : null, - maxLines: widget.maxLines ?? null, - style: widget.style != null - ? _getFontStyle().copyWith( - fontStyle: widget.italic! ? FontStyle.italic : null, - color: widget.color, - fontWeight: widget.fontWeight ?? _getFontWeight(), - height: widget.fontHeight) - : TextStyle( - fontStyle: widget.italic! ? FontStyle.italic : null, - color: widget.color != null ? widget.color : Colors.black, - fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing, + return GestureDetector( + child: Container( + margin: widget.margin != null + ? EdgeInsets.all(widget.margin) + : EdgeInsets.only( + top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + _textWidget(), + if (widget.readMore && text.length > widget.maxLength && hidden) + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), + height: 30, + ), + ) + ], + ), + if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) + Padding( + padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), + child: InkWell( + onTap: () { + setState(() { + hidden = !hidden; + }); + }, + child: Text(hidden ? "Read More" : "Read less", + style: _getFontStyle().copyWith( + color: HexColor('#FF0000'), + fontWeight: FontWeight.w800, + fontFamily: "Poppins", + )), + ), + ), + ], + ), + ), + // onLongPress: (){ + // if(widget.isCopyable){ + // DrAppToastMsg.showShortToast(TranslationBase.of(context).textCopiedSuccessfully); + // Clipboard.setData(new ClipboardData(text: widget.text)); + // } + // }, + ); + } + + Widget _textWidget() { + if (widget.isCopyable) { + return Theme( + data: ThemeData( + textSelectionColor: Colors.lightBlueAccent, + ), + child: Container( + child: SelectableText( + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + textAlign: widget.textAlign, + // overflow: widget.maxLines != null + // ? ((widget.maxLines > 1) + // ? TextOverflow.fade + // : TextOverflow.ellipsis) + // : null, + maxLines: widget.maxLines ?? null, + style: widget.style != null + ? _getFontStyle().copyWith( + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color, + fontWeight: widget.fontWeight ?? _getFontWeight(), + height: widget.fontHeight) + : TextStyle( + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color != null ? widget.color : Colors.black, + fontSize: widget.fontSize ?? _getFontSize(), + letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, height: widget.fontHeight), - ), - if (widget.readMore! && text.length > widget.maxLength! && hidden) - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), - height: 30, - ), - ) - ], ), - if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) - Padding( - padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), - child: InkWell( - onTap: () { - setState(() { - hidden = !hidden; - }); - }, - child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( - color: HexColor('#FF0000'), - fontWeight: FontWeight.w800, - fontFamily: "Poppins", - )), - ), - ), - ], - ), - ); + ), + ); + } else { + return Text( + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + textAlign: widget.textAlign, + overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + maxLines: widget.maxLines ?? null, + style: widget.style != null + ? _getFontStyle().copyWith( + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color, + fontWeight: widget.fontWeight ?? _getFontWeight(), + height: widget.fontHeight) + : TextStyle( + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color != null ? widget.color : Colors.black, + fontSize: widget.fontSize ?? _getFontSize(), + letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), + fontWeight: widget.fontWeight ?? _getFontWeight(), + fontFamily: widget.fontFamily ?? 'Poppins', + decoration: widget.textDecoration, + height: widget.fontHeight), + ); + } } TextStyle _getFontStyle() { diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 04a83c3f..edca36e4 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; @@ -8,6 +10,9 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; final int index; + + DashboardViewModel dashboardViewModel = DashboardViewModel(); + BottomNavBar({Key? key, required this.changeIndex, required this.index}) : super(key: key); @override @@ -24,6 +29,12 @@ class _BottomNavBarState extends State { }); } + @override + void initState() { + widget.dashboardViewModel.getNotRepliedCount(); + super.initState(); + } + @override Widget build(BuildContext context) { return BottomAppBar( @@ -43,6 +54,7 @@ class _BottomNavBarState extends State { index: widget.index, currentIndex: 0, name: TranslationBase.of(context).home, + dashboardViewModel: widget.dashboardViewModel, ), BottomNavigationItem( icon: DoctorApp.schedule_1, @@ -51,6 +63,8 @@ class _BottomNavBarState extends State { index: widget.index, currentIndex: 1, name: TranslationBase.of(context).mySchedule, + dashboardViewModel: widget.dashboardViewModel, + ), BottomNavigationItem( icon: DoctorApp.qr_reader, @@ -59,6 +73,8 @@ class _BottomNavBarState extends State { index: widget.index, currentIndex: 2, name: TranslationBase.of(context).qr, + dashboardViewModel: widget.dashboardViewModel, + ), BottomNavigationItem( icon: DoctorApp.dr_reply_1, @@ -67,6 +83,8 @@ class _BottomNavBarState extends State { index: widget.index, currentIndex: 3, name: TranslationBase.of(context).replay2, + dashboardViewModel: widget.dashboardViewModel, + ), ], ), diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 7e2b4de8..0d5b09f6 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -1,6 +1,12 @@ +import 'package:badges/badges.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../locator.dart'; class BottomNavigationItem extends StatelessWidget { final IconData? icon; @@ -9,9 +15,11 @@ class BottomNavigationItem extends StatelessWidget { final int? index; final int currentIndex; final String? name; + final DashboardViewModel? dashboardViewModel; + BottomNavigationItem( - {this.icon, this.activeIcon, required this.changeIndex, this.index, required this.currentIndex, this.name}); + {this.icon, this.activeIcon, required this.changeIndex, this.index, required this.currentIndex, this.name, this.dashboardViewModel}); @override Widget build(BuildContext context) { @@ -25,28 +33,53 @@ class BottomNavigationItem extends StatelessWidget { highlightColor: Colors.transparent, splashColor: Colors.transparent, onTap: () => changeIndex(currentIndex), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * + child: Stack( + alignment: AlignmentDirectional.center, + children: [ + + + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 12:SizeConfig.isHeightShort ?10 : 9) ) * 10,), Container( margin: EdgeInsets.only(bottom: 3), child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? Color(0xFF333C45) : Color(0xFF989898), size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40,), + (SizeConfig.isHeightVeryShort ? 10:SizeConfig.isHeightShort ?8.5 : 7) ) * 40,), ), SizedBox( height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : 6) ) * 0.5, - ), + ), Expanded( child: Text( name ?? "", - textAlign: TextAlign.center, + textAlign: TextAlign.center, style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2,color: currentIndex == index ? Color(0xFF333C45) : Color(0xFF989898)//#989898, + ), + ), + ), + ], + ), + if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) + Positioned( + right: 18.0, + bottom: 40.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: Colors.red[800], + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + // padding: EdgeInsets.all(2.0), + child: Text(dashboardViewModel.notRepliedCount.toString(), + style: TextStyle( + color: Colors.white, fontSize: 12.0)), ), ), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index a4dafc9e..96536f46 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -50,6 +50,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( + height: widget.height, height: widget.height, child: IgnorePointer( ignoring: widget.loading! || widget.disabled!, diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 02072bdb..cef5e947 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { @@ -29,7 +28,7 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: hasBorder ? HexColor('#707070') : Colors.transparent, width: hasBorder ? 0.30 : 0), + border: Border.all(color: hasBorder ? Color(0xFF707070) : Colors.transparent, width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -39,10 +38,10 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor, + color: bgColor ?? Color(0xFF58434F), borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10), + topRight: Radius.circular(10), + bottomRight: Radius.circular(10), ), ), width: 10, @@ -55,12 +54,10 @@ class CardWithBgWidget extends StatelessWidget { Positioned( child: Container( decoration: BoxDecoration( - color: bgColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10), - ), - ), + color: bgColor ?? Color(0xFF58434F), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10),),), width: 7, ), bottom: 1, diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 0a1ecb76..45b9f217 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -71,10 +71,9 @@ class _ListSelectDialogState extends State { Widget createDialogList() { return Container( height: MediaQuery.of(context).size.height * 0.5, - child: SingleChildScrollView( - child: Column( - children: [ - if (widget.searchWidget != null) widget.searchWidget!, + child: Column( + children: [ + if (widget.searchWidget != null) widget.searchWidget!, if (widget.usingSearch) Container( height: MediaQuery.of(context).size.height * 0.070, @@ -89,7 +88,10 @@ class _ListSelectDialogState extends State { onChanged: (value) { filterSearchResults(value); }, - )), + )),Expanded( + child: SingleChildScrollView( + child: Column( + children: [ ...items .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), @@ -106,7 +108,9 @@ class _ListSelectDialogState extends State { )) .toList() ], - ), + ),), + ), + ], ), ); } diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 0ef95900..a2a7e02d 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,9 +1,12 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../app_texts_widget.dart'; + // ignore: must_be_immutable class MasterKeyDailog extends StatefulWidget { final List list; @@ -35,12 +38,12 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel!), + child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( - child: Text(this.widget.okText), + child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { this.widget.okFunction(widget.selectedValue!); Navigator.of(context).pop(); @@ -65,8 +68,8 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + - (widget.isICD ? '/${item.code}' : '')), + title: AppText('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : ''),), groupValue: widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(), value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 97635790..1c2872c7 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -153,19 +153,21 @@ class DoctorCard extends StatelessWidget { ), if (branch != null) Row( - children: [ + crossAxisAlignment: CrossAxisAlignment.start,children: [ AppText( TranslationBase.of(context).branch ?? "" + ": ", fontSize: 14, color: Colors.grey[500], ), - AppText( + Expanded( + child:AppText( branch, fontSize: 14, - ) - ], - ) - ]), + ), + ) + ], + ) + ]), ), ), if (isShowEye) diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index c843875d..6588e580 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -53,7 +53,7 @@ class DoctorCardInsurance extends StatelessWidget { children: [ Container( height: 160, - width: 5, + width: 4.5, decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(10), @@ -89,7 +89,7 @@ class DoctorCardInsurance extends StatelessWidget { ), color: Color(0xff2E303A)), child: Padding( - padding: const EdgeInsets.all(5.0), + padding: const EdgeInsets.all(12.0), child: AppText( '$patientOut'.replaceAll(" ", ""), color: Colors.white, diff --git a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart index bf383fff..264e1a66 100644 --- a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart +++ b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart @@ -9,6 +9,7 @@ class GifLoaderDialogUtils { } static hideDialog(BuildContext context) { + if(Navigator.canPop(context)) Navigator.of(context).pop(); } } diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart deleted file mode 100644 index e5aa1f8c..00000000 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ /dev/null @@ -1,318 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/new_text_Field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import 'app_texts_widget.dart'; -import 'dialogs/master_key_dailog.dart'; -import 'divider_with_spaces_around.dart'; -import 'expandable-widget-header-body.dart'; -import 'text_fields/app-textfield-custom.dart'; - -class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { - final SOAPViewModel model; - final Function() addSelectedAllergy; - final Function(MasterKeyModel) removeAllergy; - final Function(MySelectedAllergy mySelectedAllergy) addAllergy; - final bool Function(MasterKeyModel) isServiceSelected; - final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; - - final List masterList; - final String? buttonName; - final String? hintSearchText; - - MasterKeyCheckboxSearchAllergiesWidget( - {Key? key, - required this.model, - required this.addSelectedAllergy, - required this.removeAllergy, - required this.masterList, - required this.addAllergy, - required this.isServiceSelected, - this.buttonName, - this.hintSearchText, - required this.getServiceSelectedAllergy}) - : super(key: key); - - @override - _MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState(); -} - -class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = []; - MasterKeyModel? _selectedAllergySeverity; - bool isSubmitted = false; - - @override - void initState() { - items.addAll(widget.masterList); - super.initState(); - } - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return Container( - child: Column( - children: [ - Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 0.70, - child: Center( - child: Container( - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), - child: Column( - children: [ - AppTextFieldCustom( - // height: - // MediaQuery.of(context).size.height * 0.070, - hintText: TranslationBase.of(context).selectAllergy, - isTextFieldHasSuffix: true, - hasBorder: false, - // controller: filteredSearchController, - onChanged: (value) { - filterSearchResults(value); - }, - suffixIcon: IconButton( - onPressed: () {}, - icon: Icon( - Icons.search, - color: Colors.black, - )), - ), - DividerWithSpacesAround(), - SizedBox( - height: 10, - ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Container( - height: MediaQuery.of(context).size.height * 0.60, - child: ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) { - bool isSelected = widget.isServiceSelected(items[index]); - MySelectedAllergy? mySelectedAllergy; - if (isSelected) { - mySelectedAllergy = widget.getServiceSelectedAllergy(items[index]); - } - TextEditingController remarkController = - TextEditingController(text: isSelected ? mySelectedAllergy!.remark : null); - TextEditingController severityController = TextEditingController( - text: isSelected - ? mySelectedAllergy!.selectedAllergySeverity != null - ? projectViewModel.isArabic - ? mySelectedAllergy.selectedAllergySeverity!.nameAr - : mySelectedAllergy.selectedAllergySeverity!.nameEn - : null - : null); - return HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Checkbox( - value: widget.isServiceSelected(items[index]), - activeColor: Colors.red[800], - onChanged: (bool? newValue) { - setState(() { - if (widget.isServiceSelected(items[index])) { - widget.removeAllergy(items[index]); - } else { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - selectedAllergy: items[index], - selectedAllergySeverity: _selectedAllergySeverity, - remark: null, - isChecked: true, - isExpanded: true); - widget.addAllergy(mySelectedAllergy); - } - }); - }), - InkWell( - onTap: () { - setState(() { - if (widget.isServiceSelected(items[index])) { - widget.removeAllergy(items[index]); - } else { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - selectedAllergy: items[index], - selectedAllergySeverity: _selectedAllergySeverity, - remark: null, - isChecked: true, - isExpanded: true); - widget.addAllergy(mySelectedAllergy); - } - }); - }, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), - child: Container( - child: AppText( - projectViewModel.isArabic - ? items[index].nameAr != "" - ? items[index].nameAr - : items[index].nameEn - : items[index].nameEn, - color: Color(0xFF575757), - fontSize: 16, - fontWeight: FontWeight.w600, - ), - width: MediaQuery.of(context).size.width * 0.55, - ), - ), - ), - ], - ), - InkWell( - onTap: () { - if (mySelectedAllergy != null) { - setState(() { - if (mySelectedAllergy!.isExpanded!) { - mySelectedAllergy.isExpanded = false; - } else { - mySelectedAllergy.isExpanded = true; - } - }); - } - }, - child: Icon( - (mySelectedAllergy != null ? mySelectedAllergy.isExpanded! : false) - ? EvaIcons.arrowIosUpwardOutline - : EvaIcons.arrowIosDownwardOutline)) - ], - ), - bodyWidget: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: Column( - children: [ - AppTextFieldCustom( - onClick: widget.model.allergySeverityList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: widget.model.allergySeverityList, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - mySelectedAllergy!.selectedAllergySeverity = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - isTextFieldHasSuffix: true, - hintText: TranslationBase.of(context).selectSeverity, - enabled: false, - maxLines: 2, - minLines: 2, - controller: severityController, - ), - SizedBox( - height: 5, - ), - if (isSubmitted && - mySelectedAllergy != null && - mySelectedAllergy.selectedAllergySeverity == null) - Row( - children: [ - CustomValidationError(), - ], - mainAxisAlignment: MainAxisAlignment.start, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: NewTextFields( - hintText: TranslationBase.of(context).remarks ?? "", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 3, - initialValue: isSelected ? mySelectedAllergy!.remark ?? "" : '', - // controller: remarkControlle - - onChanged: (value) { - if (isSelected) { - mySelectedAllergy!.remark = value; - } - }, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - ], - ), - ), - ), - ), - isExpand: mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false, - ); - }, - ), - ), - ), - ), - ], - ))), - ), - ), - SizedBox( - height: 10, - ), - ], - ), - ); - } - - void filterSearchResults(String query) { - List dummySearchList = []; - dummySearchList.addAll(widget.masterList); - if (query.isNotEmpty) { - List dummyListData = []; - dummySearchList.forEach((items) { - if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || - items.nameEn!.toLowerCase().contains(query.toLowerCase())) { - dummyListData.add(items); - } - }); - setState(() { - items.clear(); - items.addAll(dummyListData); - }); - return; - } else { - setState(() { - items.clear(); - items.addAll(widget.masterList); - }); - } - } -} diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 6be27f94..2baa1c18 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/cupertino.dart'; @@ -38,6 +40,7 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { class _MasterKeyCheckboxSearchWidgetState extends State { List items = []; + TextEditingController filteredSearchController = TextEditingController(); @override void initState() { @@ -69,11 +72,11 @@ class _MasterKeyCheckboxSearchWidgetState extends State { margin: widget.margin, decoration: widget.showBorder == true ? BoxDecoration( - color: Theme.of(context).primaryColor, + color: Colors.white/*Theme.of(context).primaryColor*/, border: Border.all(color: widget.borderColor!, width: widget.borderWidth!), borderRadius: widget.customCornerRaduis! ? BorderRadius.only( @@ -63,13 +63,15 @@ class _RoundedContainerState extends State { bottomLeft: Radius.circular(widget.bottomLeft!)) : BorderRadius.circular(widget.raduis!), boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(widget.shadowWidth!), - spreadRadius: widget.shadowSpreadRadius!, - blurRadius: 5, - offset: Offset(0, widget.shadowDy!), // changes position of shadow - ), - ]) + BoxShadow( + color: Colors.grey.withOpacity(widget.shadowWidth!), + spreadRadius: widget.shadowSpreadRadius!, + blurRadius: 5, + offset: Offset( + 0, widget.shadowDy!), // changes position of shadow + ), + ], + ) : null, child: Card( margin: EdgeInsets.all(0), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 8e8e24ca..5483946c 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -24,9 +24,13 @@ class AppTextFieldCustom extends StatefulWidget { final int? maxLines; final List? inputFormatters; final Function(String)? onChanged; + final Function onFieldSubmitted; + final String? validationError; final bool? isPrscription; final bool? isSecure; + final bool focus; + final bool isSearchTextField; AppTextFieldCustom({ this.height = 0, @@ -47,6 +51,9 @@ class AppTextFieldCustom extends StatefulWidget { this.validationError, this.isPrscription = false, this.isSecure = false, + this.focus = false, + this.isSearchTextField = false, + this.onFieldSubmitted, }); @override @@ -54,6 +61,32 @@ class AppTextFieldCustom extends StatefulWidget { } class _AppTextFieldCustomState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(AppTextFieldCustom oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -75,7 +108,9 @@ class _AppTextFieldCustomState extends State { Expanded( child: Container( padding: widget.dropDownText == null - ? EdgeInsets.symmetric(vertical: 0) + ? widget.isSearchTextField + ? EdgeInsets.only(top: 10) + : EdgeInsets.symmetric(vertical: 0) : EdgeInsets.symmetric(vertical: 0), // 8.0 child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -84,15 +119,20 @@ class _AppTextFieldCustomState extends State { if ((widget.controller != null && widget.controller!.text != "") || widget.dropDownText != null) AppText( widget.hintText, + // marginTop: widget.hasHintmargin ? 0 : 30, color: Color(0xFF2E303A), - fontSize: widget.isPrscription == false ? SizeConfig.textMultiplier * 1.3 : 0, + fontSize: widget.isPrscription == false ? SizeConfig.getHeightMultiplier() * + (SizeConfig.isWidthLarge ? 1.1 : 1.3) + : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null ? Container( height: widget.height != 0 && widget.maxLines == 1 ? widget.height! - 22 : null, - child: TextField( + child: TextFormField( textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, + focusNode: _focusNode, + textAlignVertical: TextAlignVertical.center, decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, @@ -112,6 +152,7 @@ class _AppTextFieldCustomState extends State { widget.onChanged!(value); } }, + onFieldSubmitted: widget.onFieldSubmitted, obscureText: widget.isSecure!), ) : AppText( @@ -126,7 +167,15 @@ class _AppTextFieldCustomState extends State { ), widget.isTextFieldHasSuffix! ? widget.suffixIcon != null - ? widget.suffixIcon! + ? Container( + margin: EdgeInsets.only( + bottom: widget.isSearchTextField + ? (widget.controller.text.isEmpty || + widget.controller == null) + ? 10 + : 25 + : 0), + child: widget.suffixIcon) : InkWell( child: Icon( Icons.keyboard_arrow_down, @@ -138,7 +187,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null) TextFieldsError(error: widget.validationError!), + if (widget.validationError != null && widget.validationError.isNotEmpty) TextFieldsError(error: widget.validationError!), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart new file mode 100644 index 00000000..2a5304e2 --- /dev/null +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -0,0 +1,66 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'app-textfield-custom.dart'; + +class AppTextFieldCustomSearch extends StatelessWidget { + const AppTextFieldCustomSearch({ + Key key, + this.onChangeFun, + this.positionedChild, + this.marginTop, + this.suffixIcon, + this.validationError, + this.inputType, + this.inputFormatters, + this.searchController, + this.onFieldSubmitted, + this.hintText, + }); + + final TextEditingController searchController; + + final Function onChangeFun; + final Function onFieldSubmitted; + + final Widget positionedChild; + final IconButton suffixIcon; + final double marginTop; + final String validationError; + final String hintText; + + final TextInputType inputType; + final List inputFormatters; + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), + child: Stack( + children: [ + AppTextFieldCustom( + hintText: + hintText ?? TranslationBase.of(context).searchPatientName, + isTextFieldHasSuffix: true, + isSearchTextField: true, + inputFormatters: inputFormatters, + suffixIcon: suffixIcon ?? + IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: searchController, + onChanged: onChangeFun, + onFieldSubmitted: onFieldSubmitted, + validationError: validationError), + if (positionedChild != null) + Positioned(right: 35, top: 5, child: positionedChild) + ], + ), + ); + } +} diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart new file mode 100644 index 00000000..51f586e1 --- /dev/null +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -0,0 +1,77 @@ +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class CountryTextField extends StatefulWidget { + final dynamic element; + final String? elementError; + final List? elementList; + final String? keyName; + final String? keyId; + final String? hintText; + final double? width; + final Function(dynamic) okFunction; + + CountryTextField( + {Key? key, + @required this.element, + @required this.elementError, + this.width, + this.elementList, + this.keyName, + this.keyId, + this.hintText, + this.okFunction}) + : super(key: key); + + @override + _CountryTextfieldState createState() => _CountryTextfieldState(); +} + +class _CountryTextfieldState extends State { + @override + Widget build(BuildContext context) { + return Container( + width: widget.width ?? null, + child: InkWell( + onTap: widget.elementList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: widget.elementList, + attributeName: '${widget.keyName}', + attributeValueId: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyId}'] + : '${widget.keyId}', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) => + widget.okFunction(selectedValue), + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: AppTextFieldCustom( + hintText: widget.hintText, + dropDownText: widget.elementList.length == 1 + ? widget.elementList[0]['${widget.keyName}'] + : widget.element != null + ? widget.element['${widget.keyName}'] + : null, + isTextFieldHasSuffix: true, + validationError: + widget.elementList.length != 1 ? widget.elementError : null, + enabled: false, + ), + ), + ); + } +} diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart index ca5b417c..70729446 100644 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ b/lib/widgets/shared/text_fields/new_text_Field.dart @@ -200,7 +200,7 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2!.copyWith( + style: Theme.of(context).textTheme.bodyText1!.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 7a191e0a..316e45ac 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -43,7 +43,7 @@ class TextFieldsUtils { borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderRadius: BorderRadius.circular(8), ),*/ - hintText: selectedText != "" ? selectedText : hintText, + hintText: selectedText != "" ? selectedText : hintText??"", suffixIcon: Icon( suffixIcon ?? null, color: Colors.grey.shade600, diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart new file mode 100644 index 00000000..b66d4926 --- /dev/null +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/material.dart'; + +import '../app_texts_widget.dart'; + +class CustomRow extends StatelessWidget { + const CustomRow({ + Key key, + this.label, + this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, + }) : super(key: key); + + final String label; + final String value; + final double labelSize; + final double valueSize; + final double width; + final bool isCopyable; + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + label, + fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.8, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + AppText( + value, + fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: isCopyable, + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart index 01c40cff..242fd84b 100644 --- a/lib/widgets/transitions/fade_page.dart +++ b/lib/widgets/transitions/fade_page.dart @@ -7,7 +7,7 @@ class FadePage extends PageRouteBuilder { FadePage({required this.page}) : super( opaque: false, - fullscreenDialog: true, + settings: RouteSettings(name: page.runtimeType.toString()),fullscreenDialog: true, barrierDismissible: true, barrierColor: Colors.black.withOpacity(0.8), pageBuilder: ( diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index 49e2e0de..ea9b520f 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,8 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; + final String settingRoute; - SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true}) + SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, @@ -23,6 +24,7 @@ class SlideUpPageRoute extends PageRouteBuilder { opaque: opaque, barrierColor: Color.fromRGBO(0, 0, 0, 0.5), barrierDismissible: true, + settings: RouteSettings(name: settingRoute ?? widget.runtimeType.toString()), transitionDuration: Duration(milliseconds: 800), transitionsBuilder: ((BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { diff --git a/pubspec.lock b/pubspec.lock index f6841219..27ad91b3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "12.0.0" + version: "14.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "0.41.2" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "3.1.6" args: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.1" autocomplete_textfield: dependency: "direct main" description: @@ -43,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.3" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" barcode_scan_fix: dependency: "direct main" description: @@ -134,6 +141,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "8.1.0" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.1" characters: dependency: transitive description: @@ -147,7 +161,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" charts_common: dependency: transitive description: @@ -252,7 +266,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" csslib: dependency: transitive description: @@ -412,6 +426,20 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" flutter_colorpicker: dependency: "direct main" description: @@ -574,6 +602,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.4" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" html: dependency: "direct main" description: @@ -616,6 +658,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.8" imei_plugin: dependency: "direct main" description: @@ -692,7 +741,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" mime: dependency: transitive description: @@ -735,6 +784,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" package_config: dependency: transitive description: @@ -763,6 +819,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.1" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" path_provider_linux: dependency: transitive description: @@ -770,6 +847,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" path_provider_platform_interface: dependency: transitive description: @@ -889,6 +973,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.1" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.25.0" scratch_space: dependency: transitive description: @@ -978,6 +1069,20 @@ packages: relative: true source: path version: "0.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0+4" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1+1" stack_trace: dependency: transitive description: @@ -1013,6 +1118,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" term_glyph: dependency: transitive description: @@ -1026,7 +1138,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" timing: dependency: transitive description: @@ -1097,6 +1209,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" vector_math: dependency: transitive description: @@ -1217,5 +1336,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.13.0 <3.0.0" - flutter: ">=2.2.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index e582ef08..15c1a718 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -97,6 +97,19 @@ dependencies: # Html Editor Enhanced html_editor_enhanced: ^2.1.1 + #Network Image + cached_network_image: ^2.5.0 + + + # Badges + badges: ^1.1.4 + + # Hijri +# hijri: ^2.0.3 + hijri_picker: ^2.0.0 + + + dev_dependencies: flutter_test: sdk: flutter