|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
@ -177,15 +178,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
_selectedClinic = null;
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
model.getDoctorBranch().then((value) {
|
|
|
|
|
model.getDoctorBranch().then((value) async {
|
|
|
|
|
_selectedBranch = value;
|
|
|
|
|
if (_referTo['id'] == 1) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model
|
|
|
|
|
await model
|
|
|
|
|
.getClinics(_selectedBranch['facilityId'])
|
|
|
|
|
.then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -226,15 +230,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
attributeValueId: 'facilityId',
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() async {
|
|
|
|
|
_selectedBranch = selectedValue;
|
|
|
|
|
_selectedClinic = null;
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model
|
|
|
|
|
await model
|
|
|
|
|
.getClinics(_selectedBranch['facilityId'])
|
|
|
|
|
.then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context));
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
@ -277,15 +284,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
|
|
|
|
|
TranslationBase.of(context).clinicSearch,
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() async {
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
_selectedClinic = selectedValue;
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model
|
|
|
|
|
await model
|
|
|
|
|
.getClinicDoctors(
|
|
|
|
|
_selectedClinic['ClinicID'].toString())
|
|
|
|
|
.then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context));
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|