diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index fa15c2cb..fdc37058 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -629,4 +629,8 @@ const Map> localizedValues = { 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, 'currentMedications': {'en': "Current Medications", 'ar':"الأدوية الحالية" }, 'noItem': {'en': "No items exists in this list", 'ar':"لا توجد عناصر في هذه القائمة" }, + 'assessmentErrorMsg': {'en': "You have to add at least one assessment.", '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':"يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 9e1e1516..2becf826 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1021,6 +1021,17 @@ class TranslationBase { localizedValues['currentMedications'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode]; + + String get assessmentErrorMsg => + localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => + localizedValues['examinationErrorMsg'][locale.languageCode]; + + String get progressNoteErrorMsg => + localizedValues['progressNoteErrorMsg'][locale.languageCode]; + + String get chiefComplaintErrorMsg => + localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 3e2f2d76..184b4391 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -504,7 +504,7 @@ class _UpdateSubjectivePageState extends State { } else { helpers.showErrorToast(TranslationBase .of(context) - .requiredMsg); + .chiefComplaintErrorMsg); } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index e6cb4654..007ef737 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -383,7 +383,7 @@ class _UpdateAssessmentPageState extends State { onPressed: () async { if (widget.mySelectedAssessmentList.isEmpty) { helpers.showErrorToast( - TranslationBase.of(context).requiredMsg); + TranslationBase.of(context).assessmentErrorMsg); } else { widget.changePageViewIndex(3); widget.changeLoadingState(true); diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index a5aad1bf..13ed4c51 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -416,7 +416,7 @@ class _UpdateObjectivePageState extends State { // // widget.changePageViewIndex(2); - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } } diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 9d4a4c39..06cbfc06 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -1,10 +1,12 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/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/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -130,7 +132,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(model.patientProgressNoteList.isEmpty) + if(widget.patientProgressNote==null) Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -322,7 +324,7 @@ class _UpdatePlanPageState extends State { Navigator.of(context).pop(); } } else { - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } @@ -374,7 +376,13 @@ class _UpdatePlanPageState extends State { ), AppButton( title: TranslationBase.of(context).add.toUpperCase(), - onPressed: () { + onPressed: () async{ + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName; + widget.patientProgressNote.editedByName=doctorProfile.doctorName; + widget.patientProgressNote.createdOn= DateTime.now().toString() ; setState(() { print(progressNoteController.text); });