Fixing some design issues in refer-patient-screen-in-patient and refer-patient-screen

merge-requests/976/head
RoaaGhali98 3 years ago
parent 177a2e8bc4
commit 81d3aa5ad1

@ -162,55 +162,54 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
BottomSheetDialogButton( BottomSheetDialogButton(
label: "${TranslationBase.of(context).refer}", label: "${TranslationBase.of(context).refer}",
onTap: () async { onTap: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Refer Patient", eventCategory: "Refer Patient",
eventAction: "Submit Refer", eventAction: "Submit Refer",
); );
if (_referTo == null) { if (_referTo == null) {
branchError = branchError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
branchError = null; branchError = null;
} }
if (_selectedBranch == null) { if (_selectedBranch == null) {
hospitalError = hospitalError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
hospitalError = null; hospitalError = null;
} }
if (_selectedClinic == null) { if (_selectedClinic == null) {
clinicError = clinicError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
clinicError = null; clinicError = null;
} }
if (_selectedDoctor == null) { if (_selectedDoctor == null) {
doctorError = doctorError =
TranslationBase.of(context).fieldRequired; TranslationBase.of(context).fieldRequired;
} else { } else {
doctorError = null; doctorError = null;
} }
if (appointmentDate == null ||
_selectedBranch == null || if (appointmentDate == null ||
_selectedClinic == null || _selectedBranch == null ||
_selectedDoctor == null || _selectedClinic == null ||
_remarksController.text == null) return; _selectedDoctor == null ||
model _remarksController.text == null) return;
.makeReferral( model
patient, .makeReferral(
appointmentDate.toIso8601String(), patient,
_selectedBranch['facilityId'], appointmentDate.toIso8601String(),
_selectedClinic['ClinicID'], _selectedBranch['facilityId'],
_selectedDoctor['DoctorID'], _selectedClinic['ClinicID'],
_remarksController.text) _selectedDoctor['DoctorID'],
.then((_) { _remarksController.text)
.then((_) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg); TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context); Navigator.pop(context);
});
}); }),
}
),
], ],
), ),
), ),

Loading…
Cancel
Save