diff --git a/lib/config/config.dart b/lib/config/config.dart index 765874b4..c09f57e5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -72,7 +72,7 @@ const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; + 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea4df903..4d47d71c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -697,5 +697,7 @@ const Map> localizedValues = { 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, + 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, + 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, // 'icd': {'en': "ICD", 'ar': " "}, }; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 69f8e5e5..77af017c 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -209,6 +209,7 @@ class PatientReferralService extends LookupService { await baseAppClient.post( RESPONSE_PENDING_REFERRAL_PATIENT, onSuccess: (dynamic response, int statusCode) { + print(response); }, onFailure: (String error, int statusCode) { hasError = true; 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 433fe232..f1f3c918 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -154,6 +154,9 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); + Navigator.pop(context); } }, ), @@ -174,6 +177,9 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); + Navigator.pop(context); } }, ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c0c7d73d..11b5fa7f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1086,6 +1086,8 @@ class TranslationBase { String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; String get patientName => localizedValues['patient-name'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 5924c89c..ee54917b 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -175,6 +175,7 @@ class PatientReferralItemWidget extends StatelessWidget { height: 8, ), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context).referralRemark, @@ -182,11 +183,13 @@ class PatientReferralItemWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - AppText( - remark, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + Expanded( + child: AppText( + remark, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), ), ], ),