diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 6a4d03e2..63b06a2b 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -162,55 +162,54 @@ class _PatientMakeReferralScreenState extends State { BottomSheetDialogButton( label: "${TranslationBase.of(context).refer}", onTap: () async { - await locator().logEvent( + await locator().logEvent( eventCategory: "Refer Patient", eventAction: "Submit Refer", - ); - if (_referTo == null) { + ); + if (_referTo == null) { branchError = - TranslationBase.of(context).fieldRequired; - } else { + TranslationBase.of(context).fieldRequired; + } else { branchError = null; - } - if (_selectedBranch == null) { + } + if (_selectedBranch == null) { hospitalError = - TranslationBase.of(context).fieldRequired; - } else { + TranslationBase.of(context).fieldRequired; + } else { hospitalError = null; - } - if (_selectedClinic == null) { + } + if (_selectedClinic == null) { clinicError = - TranslationBase.of(context).fieldRequired; - } else { + TranslationBase.of(context).fieldRequired; + } else { clinicError = null; - } - if (_selectedDoctor == null) { + } + if (_selectedDoctor == null) { doctorError = - TranslationBase.of(context).fieldRequired; - } else { + TranslationBase.of(context).fieldRequired; + } else { doctorError = null; - } - if (appointmentDate == null || - _selectedBranch == null || - _selectedClinic == null || - _selectedDoctor == null || - _remarksController.text == null) return; - model - .makeReferral( - patient, - appointmentDate.toIso8601String(), - _selectedBranch['facilityId'], - _selectedClinic['ClinicID'], - _selectedDoctor['DoctorID'], - _remarksController.text) - .then((_) { + } + + if (appointmentDate == null || + _selectedBranch == null || + _selectedClinic == null || + _selectedDoctor == null || + _remarksController.text == null) return; + model + .makeReferral( + patient, + appointmentDate.toIso8601String(), + _selectedBranch['facilityId'], + _selectedClinic['ClinicID'], + _selectedDoctor['DoctorID'], + _remarksController.text) + .then((_) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).referralSuccessMsg); + TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); - - }); - } - ), + }); + }), ], ), ),