|
|
|
@ -640,14 +640,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
|
|
|
|
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
|
|
|
|
|
|
|
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
service
|
|
|
|
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue!) : 0, nearestAppo, languageID, context).then((res) async {
|
|
|
|
.getDoctorsList(
|
|
|
|
|
|
|
|
clinicID,
|
|
|
|
|
|
|
|
projectDropdownValue != "" ? int.parse(projectDropdownValue!) : 0,
|
|
|
|
|
|
|
|
nearestAppo,
|
|
|
|
|
|
|
|
languageID,
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.then((res) async {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
RegionList regionHospitalList = RegionList();
|
|
|
|
RegionList regionHospitalList = RegionList();
|
|
|
|
|
|
|
|
|
|
|
|
@ -661,21 +654,12 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
if (nearestAppo) {
|
|
|
|
if (nearestAppo) {
|
|
|
|
doctorsList.forEach((element) {
|
|
|
|
doctorsList.forEach((element) {
|
|
|
|
List<PatientDoctorAppointmentList> doctorByHospital =
|
|
|
|
List<PatientDoctorAppointmentList> doctorByHospital =
|
|
|
|
_patientDoctorAppointmentListHospital
|
|
|
|
_patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList();
|
|
|
|
.where((elementClinic) =>
|
|
|
|
|
|
|
|
elementClinic.filterName ==
|
|
|
|
|
|
|
|
element.getProjectCompleteName())
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (doctorByHospital.length != 0) {
|
|
|
|
if (doctorByHospital.length != 0) {
|
|
|
|
_patientDoctorAppointmentListHospital[
|
|
|
|
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
|
|
|
|
_patientDoctorAppointmentListHospital
|
|
|
|
|
|
|
|
.indexOf(doctorByHospital[0])]
|
|
|
|
|
|
|
|
.patientDoctorAppointmentList!
|
|
|
|
|
|
|
|
.add(element);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_patientDoctorAppointmentListHospital
|
|
|
|
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(
|
|
|
|
.add(PatientDoctorAppointmentList(
|
|
|
|
|
|
|
|
filterName: element.getProjectCompleteName(),
|
|
|
|
filterName: element.getProjectCompleteName(),
|
|
|
|
distanceInKMs: element.projectDistanceInKiloMeters.toString(),
|
|
|
|
distanceInKMs: element.projectDistanceInKiloMeters.toString(),
|
|
|
|
projectTopName: element.projectTopName,
|
|
|
|
projectTopName: element.projectTopName,
|
|
|
|
@ -685,20 +669,16 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
navigateToSearchResultsForNearestAppointment(
|
|
|
|
navigateToSearchResultsForNearestAppointment(context, doctorsList, _patientDoctorAppointmentListHospital);
|
|
|
|
context, doctorsList, _patientDoctorAppointmentListHospital);
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList,
|
|
|
|
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, isArabic: isArabic);
|
|
|
|
isArabic: isArabic);
|
|
|
|
|
|
|
|
var lat = await sharedPref.getDouble(USER_LAT);
|
|
|
|
var lat = await sharedPref.getDouble(USER_LAT);
|
|
|
|
|
|
|
|
|
|
|
|
var lng = await sharedPref.getDouble(USER_LONG);
|
|
|
|
var lng = await sharedPref.getDouble(USER_LONG);
|
|
|
|
var isLocationEnabled =
|
|
|
|
var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
|
|
|
|
(lat != null && lat != 0.0) && (lng != null && lng != 0.0);
|
|
|
|
regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
|
|
|
|
regionHospitalList = await DoctorMapper.sortList(
|
|
|
|
|
|
|
|
isLocationEnabled, regionHospitalList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -733,10 +713,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
navigateToSearchResultsForNearestAppointment(
|
|
|
|
navigateToSearchResultsForNearestAppointment(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) {
|
|
|
|
context,
|
|
|
|
|
|
|
|
List<DoctorList> docList,
|
|
|
|
|
|
|
|
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) {
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
@ -744,8 +721,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
isDoctorNameSearch: true,
|
|
|
|
isDoctorNameSearch: true,
|
|
|
|
doctorsList: docList,
|
|
|
|
doctorsList: docList,
|
|
|
|
patientDoctorAppointmentListHospital:
|
|
|
|
patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital,
|
|
|
|
patientDoctorAppointmentListHospital,
|
|
|
|
|
|
|
|
isDoctorSearchResult: true,
|
|
|
|
isDoctorSearchResult: true,
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|