|
|
|
@ -162,55 +162,54 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
BottomSheetDialogButton(
|
|
|
|
|
label: "${TranslationBase.of(context).refer}",
|
|
|
|
|
onTap: () async {
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
await locator<AnalyticsService>().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);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|