|
|
@ -76,13 +76,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(TranslationBase.of(context).nearestAppo,
|
|
|
|
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
|
|
|
|
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
widget.clnicIds != null &&
|
|
|
|
widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
|
|
|
|
widget.clnicIds.length > 1 &&
|
|
|
|
|
|
|
|
isLoaded == true
|
|
|
|
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: clinicsList.map<Widget>((result) {
|
|
|
|
children: clinicsList.map<Widget>((result) {
|
|
|
@ -95,14 +92,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
if (!isDentalSelectedAndSupported()) {
|
|
|
|
if (!isDentalSelectedAndSupported()) {
|
|
|
|
projectDropdownValue = "";
|
|
|
|
projectDropdownValue = "";
|
|
|
|
getDoctorsList(context);
|
|
|
|
getDoctorsList(context);
|
|
|
|
}
|
|
|
|
} else {}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
title: Text(result.clinicDescription,
|
|
|
|
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
|
|
|
color: Colors.grey[700],
|
|
|
|
|
|
|
|
letterSpacing: 1.0))));
|
|
|
|
|
|
|
|
}).toList())
|
|
|
|
}).toList())
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
height: 60.0,
|
|
|
|
height: 60.0,
|
|
|
@ -123,25 +116,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
value: dropdownValue,
|
|
|
|
value: dropdownValue,
|
|
|
|
items: clinicsList.map((item) {
|
|
|
|
items: clinicsList.map((item) {
|
|
|
|
return new DropdownMenuItem<String>(
|
|
|
|
return new DropdownMenuItem<String>(
|
|
|
|
value: item.clinicID.toString() +
|
|
|
|
value: item.clinicID.toString() + "-" + item.isLiveCareClinicAndOnline.toString() + "-" + item.liveCareClinicID.toString() + "-" + item.liveCareServiceID.toString(),
|
|
|
|
"-" +
|
|
|
|
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
|
|
|
item.isLiveCareClinicAndOnline.toString() +
|
|
|
|
Text(item.clinicDescription),
|
|
|
|
"-" +
|
|
|
|
item.isLiveCareClinicAndOnline ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 15, width: 15, fit: BoxFit.cover) : Container(),
|
|
|
|
item.liveCareClinicID.toString() +
|
|
|
|
]),
|
|
|
|
"-" +
|
|
|
|
|
|
|
|
item.liveCareServiceID.toString(),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(item.clinicDescription),
|
|
|
|
|
|
|
|
item.isLiveCareClinicAndOnline
|
|
|
|
|
|
|
|
? SvgPicture.asset(
|
|
|
|
|
|
|
|
'assets/images/new-design/video_icon_green_right.svg',
|
|
|
|
|
|
|
|
height: 15,
|
|
|
|
|
|
|
|
width: 15,
|
|
|
|
|
|
|
|
fit: BoxFit.cover)
|
|
|
|
|
|
|
|
: Container(),
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
onChanged: (newValue) {
|
|
|
|
onChanged: (newValue) {
|
|
|
@ -151,13 +130,14 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
if (!isDentalSelectedAndSupported() && !nearestAppo) {
|
|
|
|
if (!isDentalSelectedAndSupported() && !nearestAppo) {
|
|
|
|
projectDropdownValue = "";
|
|
|
|
projectDropdownValue = "";
|
|
|
|
getDoctorsList(context);
|
|
|
|
getDoctorsList(context);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
print("Dental");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
isDentalSelectedAndSupported() == true ||
|
|
|
|
isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
|
|
|
|
(nearestAppo && isProjectLoaded)
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
height: 60.0,
|
|
|
|
height: 60.0,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
@ -196,9 +176,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isDentalSelectedAndSupported() {
|
|
|
|
bool isDentalSelectedAndSupported() {
|
|
|
|
return dropdownValue != "" &&
|
|
|
|
if (dropdownValue != null)
|
|
|
|
(dropdownValue == "17") &&
|
|
|
|
return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow;
|
|
|
|
isMobileAppDentalAllow;
|
|
|
|
else
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getClinicsList() {
|
|
|
|
getClinicsList() {
|
|
|
@ -245,9 +226,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
// TODO Mosa_REMARk to come back later
|
|
|
|
// TODO Mosa_REMARk to come back later
|
|
|
|
getDoctorsList(BuildContext context) {
|
|
|
|
getDoctorsList(BuildContext context) {
|
|
|
|
SearchInfo searchInfo = new SearchInfo();
|
|
|
|
SearchInfo searchInfo = new SearchInfo();
|
|
|
|
if (dropdownValue == "17") {
|
|
|
|
if (dropdownValue.split("-")[0] == "17") {
|
|
|
|
searchInfo.ProjectID = int.parse(projectDropdownValue);
|
|
|
|
searchInfo.ProjectID = int.parse(projectDropdownValue);
|
|
|
|
searchInfo.ClinicID = int.parse(dropdownValue);
|
|
|
|
searchInfo.ClinicID = int.parse(dropdownValue.split("-")[0]);
|
|
|
|
searchInfo.date = DateTime.now();
|
|
|
|
searchInfo.date = DateTime.now();
|
|
|
|
|
|
|
|
|
|
|
|
navigateToDentalComplaints(context, searchInfo);
|
|
|
|
navigateToDentalComplaints(context, searchInfo);
|
|
|
@ -258,10 +239,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: LiveCareBookAppointment(
|
|
|
|
page: LiveCareBookAppointment(clinicName: "Family Medicine", liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]),
|
|
|
|
clinicName: "Family Medicine",
|
|
|
|
|
|
|
|
liveCareClinicID: dropdownValue.split("-")[2],
|
|
|
|
|
|
|
|
liveCareServiceID: dropdownValue.split("-")[3]),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).then((value) {
|
|
|
|
).then((value) {
|
|
|
|
print(value);
|
|
|
|
print(value);
|
|
|
@ -285,17 +263,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
List<String> arrDistance = [];
|
|
|
|
List<String> arrDistance = [];
|
|
|
|
List<String> result;
|
|
|
|
List<String> result;
|
|
|
|
int numAll;
|
|
|
|
int numAll;
|
|
|
|
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
|
|
|
|
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
|
|
|
|
List();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
service
|
|
|
|
service.getDoctorsList(int.parse(dropdownValue.split("-")[0]), projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) {
|
|
|
|
.getDoctorsList(
|
|
|
|
|
|
|
|
int.parse(dropdownValue.split("-")[0]),
|
|
|
|
|
|
|
|
projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0,
|
|
|
|
|
|
|
|
nearestAppo,
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.then((res) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
@ -305,27 +276,17 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
doctorsList.add(new DoctorList.fromJson(v));
|
|
|
|
doctorsList.add(new DoctorList.fromJson(v));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
doctorsList.forEach((element) {
|
|
|
|
doctorsList.forEach((element) {
|
|
|
|
List<PatientDoctorAppointmentList> doctorByHospital =
|
|
|
|
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
|
|
|
|
_patientDoctorAppointmentListHospital
|
|
|
|
.where(
|
|
|
|
.where(
|
|
|
|
(elementClinic) => elementClinic.filterName == element.projectName,
|
|
|
|
(elementClinic) =>
|
|
|
|
)
|
|
|
|
elementClinic.filterName == element.projectName,
|
|
|
|
.toList();
|
|
|
|
)
|
|
|
|
|
|
|
|
.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.add(
|
|
|
|
_patientDoctorAppointmentListHospital
|
|
|
|
PatientDoctorAppointmentList(
|
|
|
|
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
|
|
|
|
filterName: element.projectName,
|
|
|
|
|
|
|
|
distanceInKMs:
|
|
|
|
|
|
|
|
element.projectDistanceInKiloMeters.toString(),
|
|
|
|
|
|
|
|
patientDoctorAppointment: element));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {}
|
|
|
|
} else {}
|
|
|
@ -333,8 +294,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
|
|
|
|
|
|
|
|
result = LinkedHashSet<String>.from(arr).toList();
|
|
|
|
result = LinkedHashSet<String>.from(arr).toList();
|
|
|
|
numAll = result.length;
|
|
|
|
numAll = result.length;
|
|
|
|
navigateToSearchResults(
|
|
|
|
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
|
|
|
|
context, doctorsList, _patientDoctorAppointmentListHospital);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -345,8 +305,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future navigateToDentalComplaints(
|
|
|
|
Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async {
|
|
|
|
BuildContext context, SearchInfo searchInfo) async {
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
@ -355,20 +314,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future navigateToSearchResults(
|
|
|
|
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
|
|
|
|
context,
|
|
|
|
|
|
|
|
List<DoctorList> docList,
|
|
|
|
|
|
|
|
List<PatientDoctorAppointmentList>
|
|
|
|
|
|
|
|
patientDoctorAppointmentListHospital) async {
|
|
|
|
|
|
|
|
isProjectLoaded = false;
|
|
|
|
isProjectLoaded = false;
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: SearchResults(
|
|
|
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
|
|
|
doctorsList: docList,
|
|
|
|
|
|
|
|
patientDoctorAppointmentListHospital:
|
|
|
|
|
|
|
|
patientDoctorAppointmentListHospital)))
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
.then((value) {
|
|
|
|
getProjectsList();
|
|
|
|
getProjectsList();
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -377,9 +325,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
|
|
|
|
filterClinic() {
|
|
|
|
filterClinic() {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
if (widget.clnicIds != null && widget.clnicIds.length > 0) {
|
|
|
|
if (widget.clnicIds != null && widget.clnicIds.length > 0) {
|
|
|
|
clinicsList = clinicsList
|
|
|
|
clinicsList = clinicsList.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1).toList();
|
|
|
|
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
isLoaded = true;
|
|
|
|
isLoaded = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|