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/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.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/doctor_post_pre_images_page.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
@ -539,6 +541,8 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) { if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) {
navigateToDentalComplaints(context); navigateToDentalComplaints(context);
} else if (widget.isDoctorNameSearch && widget.doctor.clinicID == 253) {
navigateToLaserClinic(context);
} else { } else {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime; final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context); 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 { Future navigateToDentalComplaints(BuildContext context) async {
HospitalsModel selectedHospital = new HospitalsModel(); HospitalsModel selectedHospital = new HospitalsModel();
selectedHospital.name = widget.doctor.projectName; selectedHospital.name = widget.doctor.projectName;

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

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

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

Loading…
Cancel
Save