diff --git a/lib/config/config.dart b/lib/config/config.dart index 71ccc58a..5c599425 100755 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,16 +4,16 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; + const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; +// const BASE_URL_LIVE_CARE = 'https://uat.hmgwebservices.com/'; const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'http://10.20.200.111:1010/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; @@ -413,7 +413,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 9.7; +const VERSION_ID = 9.8; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4e27e62c..f30ad03a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1253,4 +1253,5 @@ const Map> localizedValues = { "progressNoteCanNotBeEmpty": {"en": "Progress Note Can Not Be Empty", "ar":"تعذر تنفيذ الإجراء"}, "youHavePendingInterventions": {"en": "You Have Pending Interventions. That need your attention", "ar":"لديك تدخلات معلقة. التي تحتاج إلى اهتمامك"}, "open": {"en": "Open", "ar":"يفتح"}, + "chiefComplaintLengthErrorMsg":{"en": "The text is too short; minimum 26 characters required.", "ar":"النص قصير جدًا؛ الحد الأدنى المطلوب هو 26 حرفًا."} }; diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index c3bac631..76f46847 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; @@ -28,7 +29,7 @@ class HospitalsService extends BaseService { hasError = true; super.error = error; }, - body: getHospitalsRequestModel.toJson(), + body: {"LanguageID":await sharedPref.getString(APP_Language),"MemberID":getHospitalsRequestModel.memberID,"DoctorID":getHospitalsRequestModel.doctorID} //getHospitalsRequestModel.toJson(), ); } } diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index d379d47d..bd5c4040 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -69,7 +69,6 @@ class PatientReferralService extends LookupService { Future getProjectInfo(int projectId) async { Map body = Map(); body['ProjectID'] = projectId; - await baseAppClient.post( PROJECT_GET_INFO, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 50636222..e21cd85c 100755 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -232,6 +232,7 @@ class AuthenticationViewModel extends BaseViewModel { GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; getHospitalsRequestModel.doctorID = memberID; + await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { error = _hospitalsService.error; @@ -441,6 +442,7 @@ class AuthenticationViewModel extends BaseViewModel { logout({bool isFromLogin = false}) async { localToken = ""; String? lang = await sharedPref.getString(APP_Language); + //COMMENTED THE NOT TO CLEAR THE SHARED PREF // await Utils.clearSharedPref(); doctorProfile = null; 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 a7f415c1..231c5cce 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 @@ -235,7 +235,7 @@ class _UpdateSubjectivePageState extends State implements model.complaintsControllerError = ''; model.medicationControllerError = ''; model.illnessControllerError = ''; - if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty) { + if (complaintsController.text.isNotEmpty && complaintsController.text.length > 25 && illnessController.text.isNotEmpty && illnessController.text.length >25) { await model.postSubjectServices( patientInfo: widget.patientInfo, complaintsText: complaintsController.text, @@ -252,10 +252,14 @@ class _UpdateSubjectivePageState extends State implements setState(() { if (complaintsController.text.isEmpty) { model.complaintsControllerError = TranslationBase.of(context).emptyMessage; + } else if(complaintsController.text.length < 25) { + model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLengthErrorMsg; } if (illnessController.text.isEmpty) { model.illnessControllerError = TranslationBase.of(context).emptyMessage; + } else if(illnessController.text.length < 25) { + model.illnessControllerError = TranslationBase.of(context).chiefComplaintLengthErrorMsg; } if (medicationController.text.isEmpty) { diff --git a/lib/screens/splash/splash_screen.dart b/lib/screens/splash/splash_screen.dart index 32c364d0..6681d954 100644 --- a/lib/screens/splash/splash_screen.dart +++ b/lib/screens/splash/splash_screen.dart @@ -48,7 +48,7 @@ class _SplashScreenState extends State { Future _getFirebaseToken() async { try { await Firebase.initializeApp(); - Future.delayed(Duration(seconds: 1), () { + await Future.delayed(Duration(seconds: 1), () { }); if (Platform.isIOS) { // Request permissions first @@ -68,19 +68,18 @@ class _SplashScreenState extends State { final fcmToken = await _firebaseMessaging.getToken(); debugPrint("FCM Token: $fcmToken"); - // APNS token might not be immediately available - String? apnsToken; - int retries = 0; - while (apnsToken == null && retries < 3) { - apnsToken = await _firebaseMessaging.getAPNSToken(); - if (apnsToken == null) { - await Future.delayed(Duration(milliseconds: 500)); - retries++; - } - } - - debugPrint("APNS Token: $apnsToken"); - return apnsToken ?? fcmToken; // Fallback to FCM token if APNS is null + // // APNS token might not be immediately available + // String? apnsToken; + // int retries = 0; + // while (apnsToken == null && retries < 3) { + // apnsToken = await _firebaseMessaging.getAPNSToken(); + // if (apnsToken == null) { + // await Future.delayed(Duration(milliseconds: 500)); + // retries++; + // } + // } + // print(apnsToken); + return fcmToken; // Fallback to FCM token if APNS is null } else { return await _firebaseMessaging.getToken(); } diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index c5370de5..d9df90fd 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1995,6 +1995,7 @@ class TranslationBase { String get dateToCanNotBeEmpty => localizedValues['dateToCanNotBeEmpty']![locale.languageCode]!; String get dateFromCanNotBeEmpty => localizedValues['dateFromCanNotBeEmpty']![locale.languageCode]!; String get open => localizedValues['open']![locale.languageCode]!; + String get chiefComplaintLengthErrorMsg => localizedValues['chiefComplaintLengthErrorMsg']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate {