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

roaa_redesign_labs
RoaaGhali98 4 years ago
parent 99d47226d3
commit 39b4c3d55f

@ -161,55 +161,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 || if (appointmentDate == null ||
_selectedBranch == null || _selectedBranch == null ||
_selectedClinic == null || _selectedClinic == null ||
_selectedDoctor == null || _selectedDoctor == null ||
_remarksController.text == null) return; _remarksController.text == null) return;
model model
.makeReferral( .makeReferral(
patient, patient,
appointmentDate.toIso8601String(), appointmentDate.toIso8601String(),
_selectedBranch['facilityId'], _selectedBranch['facilityId'],
_selectedClinic['ClinicID'], _selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'], _selectedDoctor['DoctorID'],
_remarksController.text) _remarksController.text)
.then((_) { .then((_) {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg); TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context); Navigator.pop(context);
}); });
} }),
),
], ],
), ),
), ),

Loading…
Cancel
Save