Laser appointment booking changes

merge-update-with-lab-changes
haroon amjad 1 year ago
parent dff03796e9
commit 849164be2c

@ -9,6 +9,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/LaserClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
@ -539,6 +541,8 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
if (projectViewModel.isLogin) {
if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) {
navigateToDentalComplaints(context);
} else if (widget.isDoctorNameSearch && widget.doctor.clinicID == 253) {
navigateToLaserClinic(context);
} else {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context);
@ -560,6 +564,17 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
}
}
Future navigateToLaserClinic(BuildContext context) async {
HospitalsModel tempselectedHospital = new HospitalsModel();
tempselectedHospital.iD = widget.doctor.projectID;
Navigator.push(
context,
FadePage(
page: LaserClinic(selectedHospital: tempselectedHospital!),
),
);
}
Future navigateToDentalComplaints(BuildContext context) async {
HospitalsModel selectedHospital = new HospitalsModel();
selectedHospital.name = widget.doctor.projectName;

@ -2,6 +2,7 @@ import 'dart:collection';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/LaserClinic.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
@ -118,15 +119,11 @@ class _SearchByHospitalState extends State<SearchByHospital> {
child: DropdownButtonHideUnderline(
child: DropdownButton<HospitalsModel>(
key: projectDropdownKey,
hint: Text(
TranslationBase.of(context).selectHospital),
hint: Text(TranslationBase.of(context).selectHospital),
value: selectedHospital,
iconSize: 0,
isExpanded: true,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: Colors.black),
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((HospitalsModel item) {
return DropdownMenuItem<HospitalsModel>(
value: item,
@ -164,29 +161,16 @@ class _SearchByHospitalState extends State<SearchByHospital> {
mHeight(8),
InkWell(
onTap: () {
showClickListDialog(context, clinicIds ?? List.empty(),
onSelection: (ListClinicCentralized clincs) {
showClickListDialog(context, clinicIds ?? List.empty(), onSelection: (ListClinicCentralized clincs) {
selectedClinic = clincs;
Navigator.pop(context);
setState(() {
dropdownTitle = clincs.clinicDescription!;
dropdownValue = clincs.clinicID.toString() +
"-" +
clincs.isLiveCareClinicAndOnline.toString() +
"-" +
clincs.liveCareClinicID.toString() +
"-" +
clincs.liveCareServiceID.toString();
dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
});
getDoctorsList(context);
context
.read<ProjectViewModel>()
.analytics
.appointment
.book_appointment_select_clinic(
appointment_type: 'regular',
clinic: clincs.clinicDescription);
context.read<ProjectViewModel>().analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription);
});
},
child: Container(
@ -302,8 +286,7 @@ class _SearchByHospitalState extends State<SearchByHospital> {
});
List<ListClinicCentralized> clinicId = [];
try {
Map res = await service.getClinicByHospital(
projectID: newValue?.mainProjectID.toString() ?? "");
Map res = await service.getClinicByHospital(projectID: newValue?.mainProjectID.toString() ?? "");
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
List list = res['ListClinic'];
@ -376,8 +359,7 @@ class _SearchByHospitalState extends State<SearchByHospital> {
super.dispose();
}
Future navigateToDentalComplaints(
BuildContext context, SearchInfo searchInfo) async {
Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async {
Navigator.push(
context,
FadePage(
@ -401,20 +383,10 @@ class _SearchByHospitalState extends State<SearchByHospital> {
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
[];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(
clinicID,
selectedHospital?.mainProjectID.toString() != ""
? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1")
: 0,
nearestAppo,
languageID,
null)
.then((res) {
service.getDoctorsList(clinicID, selectedHospital?.mainProjectID.toString() != "" ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") : 0, nearestAppo, languageID, null).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
@ -424,27 +396,17 @@ class _SearchByHospitalState extends State<SearchByHospital> {
doctorsList.add(DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.getProjectCompleteName(),
)
.toList();
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.getProjectCompleteName(),
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList!
.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital.add(
PatientDoctorAppointmentList(
filterName: element.getProjectCompleteName(),
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.getProjectCompleteName(), distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
@ -452,8 +414,7 @@ class _SearchByHospitalState extends State<SearchByHospital> {
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -464,20 +425,9 @@ class _SearchByHospitalState extends State<SearchByHospital> {
});
}
Future navigateToSearchResults(
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
Navigator.push(
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: docList,
isDoctorSearchResult: false,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)))
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context,
FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, isDoctorSearchResult: false, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) {
print("navigation return ");
dropdownValue = null;
@ -493,7 +443,7 @@ class _SearchByHospitalState extends State<SearchByHospital> {
Navigator.push(
context,
FadePage(
page: LaserBooking(),
page: LaserClinic(selectedHospital: selectedHospital!),
),
).then((value) {
print("LaserBooking navigation return ");
@ -534,10 +484,7 @@ class _SearchByHospitalState extends State<SearchByHospital> {
Navigator.push(
context,
FadePage(
page: LiveCareBookAppointment(
clinicName: dropdownTitle,
liveCareClinicID: dropdownValue!.split("-")[2],
liveCareServiceID: dropdownValue!.split("-")[3]),
page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue!.split("-")[2], liveCareServiceID: dropdownValue!.split("-")[3]),
),
).then((value) {
print("navigation return ");

@ -433,7 +433,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
FadePage(
page: AppointmentDetails(
appo: _appointmentResult,
parentIndex: _currentPage,
// parentIndex: _currentPage,
parentIndex: _appointmentResult.patientStatusType == 42 ? 1 : 0,
),
),
).then((value) {

@ -436,7 +436,9 @@ class PrescriptionItemsPage extends StatelessWidget {
doctorID: prescriptions.doctorID!,
mes: TranslationBase.of(context).sendSuc,
projectID: prescriptions.projectID!,
isInOutPatient: prescriptions.isInOutPatient!);
isInOutPatient: prescriptions.isInOutPatient!
);
},
),
);

Loading…
Cancel
Save