From e5d8505c2d4791f69a405a6c1e42aabe7ed4f8c6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 3 Jan 2024 11:08:00 +0300 Subject: [PATCH] Updates & fixes --- lib/core/service/medical/labs_service.dart | 3 + lib/core/viewModels/er/rrt-view-model.dart | 8 +-- lib/pages/BookAppointment/BookConfirm.dart | 6 +- lib/pages/BookAppointment/BookSuccess.dart | 4 +- lib/pages/BookAppointment/DoctorProfile.dart | 4 +- .../components/LaserClinic.dart | 2 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 4 +- .../rapid-response-team/rrt-main-screen.dart | 2 +- .../rapid-response-team/rrt-request-page.dart | 7 +- .../MyAppointments/AppointmentDetails.dart | 2 +- .../widgets/PrescriptionReport.dart | 8 ++- .../ToDoList/ObGyne/ObGyne-TimeSlots.dart | 4 +- lib/pages/ToDoList/ToDo.dart | 8 +-- lib/pages/medical/eye/EyeHomePage.dart | 5 +- .../appointment_services/GetDoctorsList.dart | 70 +++++++++++++------ lib/widgets/new_design/doctor_header.dart | 2 +- 16 files changed, 90 insertions(+), 49 deletions(-) diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 1d635c69..8e5ac3b4 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -191,6 +191,8 @@ class LabsService extends BaseService { body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; + body['Procedure'] = procedure; + body['LanguageID'] = 1; await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { @@ -223,6 +225,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.isDownload = isDownload; _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; + _requestSendLabReportEmail.languageID = 1; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { if (isDownload) { diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index d615ef98..0ed0cf55 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -38,10 +38,10 @@ class RRTViewModel extends BaseViewModel { _RRTServiceData rrtServiceData = _RRTServiceData(); - Future<_RRTServiceData> loadRequiredData() async { + Future<_RRTServiceData> loadRequiredData(int languageID) async { // await getServicePrice(); // await getAllOrders(); - await getProcedureDetails(); + await getProcedureDetails(languageID); await getAllOrdersRC(); // getProcedureDetails(); return rrtServiceData; @@ -120,9 +120,9 @@ class RRTViewModel extends BaseViewModel { return rrtServiceData; } - Future<_RRTServiceData> getProcedureDetails() async { + Future<_RRTServiceData> getProcedureDetails(int languageID) async { DoctorsListService service = new DoctorsListService(); - await service.getRRTProcedures(15).then((res) { + await service.getRRTProcedures(15, languageID).then((res) { rrtProcedureList.clear(); var data = res["Vida_ProcedureList"]; data.forEach((json) { diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 74f7c142..63f58910 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -329,7 +329,7 @@ class _BookConfirmState extends State { GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; widget.service - .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, null, null, null, projectViewModel) + .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, null, null, null, projectViewModel) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); @@ -385,7 +385,7 @@ class _BookConfirmState extends State { widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5); GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; - widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { + widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context).then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); print(res['AppointmentNo']); @@ -489,7 +489,7 @@ class _BookConfirmState extends State { } getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { - widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { + widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) { widget.patientShareResponse = new PatientShareResponse.fromJson(res); GifLoaderDialogUtils.hideDialog(context); navigateToBookSuccess(context, docObject, widget.patientShareResponse, false); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index ea0f186b..52113d74 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -493,7 +493,7 @@ class _BookSuccessState extends State { setOnlineCheckInForAppointment() { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, context).then((res) { + service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; @@ -538,7 +538,7 @@ class _BookSuccessState extends State { GifLoaderDialogUtils.showMyDialog(context); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 426df212..1ad0bf67 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -234,7 +234,7 @@ class _DoctorProfileState extends State with TickerProviderStateM getDoctorRatings() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { + service.getDoctorsRating(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['NotesDoctorRatingList']); @@ -251,7 +251,7 @@ class _DoctorProfileState extends State with TickerProviderStateM getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index c7e32565..61ca55d7 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -69,7 +69,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD).then((res) { + service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD, projectViewModel.isArabic ? 1 : 2).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index d5c60b20..8acf6efe 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -412,7 +412,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat insertCovidQuestionnaire(context, DoctorList docObject) async { DoctorsListService service = new DoctorsListService(); List qa = await sharedPref.getObject(COVID_QA_LIST); - service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, projectViewModel.isArabic ? 1 : 2, widget.selectedProject.testProcedureEnum).then((res) { insertAppointmentCovidTest(context, docObject); }).catchError((err) { print(err); @@ -430,7 +430,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat DoctorsListService service = new DoctorsListService(); AppoitmentAllHistoryResultList appo; service - .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID, + .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, projectViewModel.isArabic ? 1 : 2, context, widget.selectedProcedure.procedureID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum) .then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index b56e28d5..ec1d5a23 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -56,7 +56,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS onModelReady: (vm) async { viewModel = vm; loadingData = true; - await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false)); + await vm.loadRequiredData(projectViewModel.isArabic ? 1 : 2).then((value) {}).whenComplete(() => setState(() => loadingData = false)); }, builder: (ctx, vm, widget) => content(), )); diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 8541b859..beada490 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; @@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class RRTRequestPage extends StatefulWidget { final List pendingOrders; @@ -32,6 +34,8 @@ class RRTRequestPageState extends State { bool acceptTerms = false; VidaProcedureList selectedProcedure; + ProjectViewModel projectViewModel; + @override void initState() { // getProcedureDetails(); @@ -40,6 +44,7 @@ class RRTRequestPageState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( onModelReady: (vm) { // viewModel = vm; @@ -272,7 +277,7 @@ class RRTRequestPageState extends State { getProcedureDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getRRTProcedures(15).then((res) { + service.getRRTProcedures(15, projectViewModel.isArabic ? 1 : 2).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['Vida_ProcedureList']); }).catchError((err) { diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 67b165b8..cd5597db 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -328,7 +328,7 @@ class _AppointmentDetailsState extends State with SingleTick void getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.appo.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); diff --git a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart index 33c55ddd..69470f23 100644 --- a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart +++ b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PrescriptionReportPage extends StatefulWidget { List prescriptionReportEnhList; @@ -26,6 +28,9 @@ class PrescriptionReportPage extends StatefulWidget { } class _PrescriptionReportState extends State { + + ProjectViewModel projectViewModel; + @override void initState() { super.initState(); @@ -33,6 +38,7 @@ class _PrescriptionReportState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, appBarTitle: 'Items', @@ -117,7 +123,7 @@ class _PrescriptionReportState extends State { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); service - .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, + .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, projectViewModel.isArabic ? 1 : 2, widget.listPres, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart index ff3bc13c..242a072f 100644 --- a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart +++ b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart @@ -353,7 +353,7 @@ class _CovidTimeSlotsState extends State with TickerProviderSta AppoitmentAllHistoryResultList appo; service .insertAppointment( - docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse.procedureId) + docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, projectViewModel.isArabic ? 1 : 2, context, widget.obGyneProcedureListResponse.procedureId) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); @@ -394,7 +394,7 @@ class _CovidTimeSlotsState extends State with TickerProviderSta DoctorsListService service = new DoctorsListService(); service .updateObGyneAppointment(widget.obGyneProcedureListResponse.episodeID, int.parse(appoNo), widget.obGyneProcedureListResponse.orderNo, widget.obGyneProcedureListResponse.procedureId, - widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID) + widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID, projectViewModel.isArabic ? 1 : 2) .then((res) {}) .catchError((err) { print(err); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b5f417e2..5fb46243 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -776,7 +776,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); List doctorsList = []; List _patientDoctorAppointmentListHospital = []; - service.getOBGyneDoctorsList(projectID, setupID, context).then((res) { + service.getOBGyneDoctorsList(projectID, setupID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['HIS_ObgyneUltrasoundDoctorsList'][0]); if (res['MessageStatus'] == 1) { @@ -967,7 +967,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); - service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { + service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); widget.patientShareResponse = new PatientShareResponse.fromJson(res); openPaymentDialog(appo, widget.patientShareResponse); @@ -1274,7 +1274,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); @@ -1334,7 +1334,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 901ce187..288689fb 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -36,6 +36,7 @@ class EyeHomePage extends StatefulWidget { class _EyeHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; List doctorDetailsList = List(); + ProjectViewModel projectViewModel; @override void initState() { @@ -54,7 +55,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -180,7 +181,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat void getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 02559d95..8f47063c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; +import 'package:diplomaticquarterapp/pages/final_products_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -174,7 +175,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsRating(int docID, context) async { + Future getDoctorsRating(int docID,int languageID, context) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -191,6 +192,7 @@ class DoctorsListService extends BaseService { "PatientID": 0, "License": true, "IsRegistered": true, + "LanguageID": languageID, "isDentalAllowedBackend": false }; @@ -224,7 +226,7 @@ class DoctorsListService extends BaseService { return Future.value(images); } - Future getDoctorsRatingDetails(int docID, context) async { + Future getDoctorsRatingDetails(int docID,int languageID, context) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -241,6 +243,7 @@ class DoctorsListService extends BaseService { "PatientID": 0, "License": true, "IsRegistered": true, + "LanguageID": languageID, "isDentalAllowedBackend": false }; @@ -273,6 +276,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "SessionID": null, "isDentalAllowedBackend": false, + "LanguageID": 1, "DeviceTypeID": 1 }; @@ -316,6 +320,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": authUser.outSA, "SessionID": null, "isDentalAllowedBackend": false, + "LanguageID": 1, "DeviceTypeID": 1 }; @@ -329,7 +334,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context, + Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context, [String procedureID, num testTypeEnum, num testProcedureEnum, ProjectViewModel projectViewModel]) async { Map request; @@ -392,7 +397,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, BuildContext context) async { + Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -482,14 +487,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future setOnlineCheckInForAppointment(String appoID, int projectID, BuildContext context) async { + Future setOnlineCheckInForAppointment(String appoID, int projectID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - request = {"ProjectID": projectID, "AppointmentNo": appoID}; + request = {"ProjectID": projectID, "AppointmentNo": appoID, "LanguageID": languageID}; dynamic localRes; @@ -501,7 +506,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { + Future getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -527,6 +532,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -562,7 +568,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getOBGyneDoctorsList(int projectID, String setupID, BuildContext context) async { + Future getOBGyneDoctorsList(int projectID, String setupID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -579,6 +585,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -697,6 +704,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; @@ -710,7 +718,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, BuildContext context) async { + Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -751,6 +759,7 @@ class DoctorsListService extends BaseService { "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType, "VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN), + "LanguageID": languageID, "IsVoip": Platform.isIOS ? true : false }; @@ -796,6 +805,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; @@ -834,6 +844,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; @@ -909,6 +920,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; dynamic localRes; @@ -955,6 +967,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; dynamic localRes; @@ -998,6 +1011,7 @@ class DoctorsListService extends BaseService { "PatientType": authUser.patientType, "DeviceToken": await sharedPref.getString(PUSH_TOKEN), "VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN), + "LanguageID": 1, "IsVoip": Platform.isIOS ? true : false }; @@ -1034,6 +1048,7 @@ class DoctorsListService extends BaseService { }); request = { + "LanguageID": 1, "RequestAncillaryOrderInvoice": [ {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} ], @@ -1234,7 +1249,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, BuildContext context) async { + Future getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1258,6 +1273,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1270,7 +1286,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendPrescriptionEmail(String appoDate, String setupId, dynamic prescriptionReportEnhList, BuildContext context) async { + Future sendPrescriptionEmail(String appoDate, String setupId, int languageID, dynamic prescriptionReportEnhList, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1297,6 +1313,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": authUser.patientType, "PatientType": authUser.patientType }; @@ -1340,6 +1357,7 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; dynamic localRes; @@ -1378,7 +1396,7 @@ class DoctorsListService extends BaseService { "PaymentMethod": paymentMethodName, "VersionID": req.VersionID, "Channel": req.Channel, - + "LanguageID": 1, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1414,6 +1432,7 @@ class DoctorsListService extends BaseService { "generalid": req.generalid, "PatientOutSA": authUser.outSA, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "ERAdvanceAmount": { "ProjectId": projectID, "PatientId": authUser.patientID, @@ -1454,6 +1473,7 @@ class DoctorsListService extends BaseService { "generalid": req.generalid, "PatientOutSA": authUser.outSA, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "EROnlineCheckinPaymentDetails": { "CheckinDate": DateUtil.convertDateToString(DateTime.now()), "ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()), @@ -1516,7 +1536,7 @@ class DoctorsListService extends BaseService { Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; - request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy}; + request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { localRes = response; @@ -1531,6 +1551,7 @@ class DoctorsListService extends BaseService { request = { "ProjectID": projectID, + "LanguageID": 1, }; dynamic localRes; await baseAppClient.post(HAS_DENTAL_PLAN, onSuccess: (response, statusCode) async { @@ -1592,12 +1613,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLaserBodyPartsList(int laserCategoryID, int projectID) async { + Future getLaserBodyPartsList(int laserCategoryID, int projectID, int languageID) async { Map request; request = { "LaserCategoryID": laserCategoryID, "ProjectID": projectID, + "LanguageID": languageID, }; dynamic localRes; await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async { @@ -1608,11 +1630,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int testProcedureEnum) async { + Future insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int languageID, int testProcedureEnum) async { Map request; request = { "ProjectID": projectID, + "LanguageID": languageID, "IsForTravel": qa[0]['ans'].toString(), "IsComingOutSA": qa[1]['ans'].toString(), "IsFeverCurrently": qa[2]['ans'].toString(), @@ -1655,11 +1678,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID) async { + Future updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID, int languageID) async { Map request; request = { "EpisodeID": episodeID, + "LanguageID": languageID, "AppointmentNo": appointmentNo, "OrderNo": orderNo, "ProcedureId": procedureId, @@ -1678,10 +1702,10 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getRRTProcedures(int projectID) async { + Future getRRTProcedures(int projectID, int languageID) async { Map request; - request = {"ProjectID": projectID}; + request = {"ProjectID": projectID, "LanguageID": languageID}; dynamic localRes; await baseAppClient.post(GET_RRT_PROCEDURE_LIST, onSuccess: (response, statusCode) async { @@ -1699,6 +1723,7 @@ class DoctorsListService extends BaseService { "ClientRequestID": clientRequestID, "Status": status, "FortID": tamaraOrderID, // Tamara order ID + "LanguageID": 1, "Installments_Number": selectedInstallments }; @@ -1714,7 +1739,7 @@ class DoctorsListService extends BaseService { Future markAppointmentForTamara(int projectID, String appoNo) async { Map request; - request = {"ProjectID": projectID, "AppointmentNo": appoNo}; + request = {"ProjectID": projectID, "AppointmentNo": appoNo, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(MARK_APPOINTMENT_TAMARA_STATUS, onSuccess: (response, statusCode) async { localRes = response; @@ -1727,7 +1752,7 @@ class DoctorsListService extends BaseService { Future autoGenerateInvoiceTamara(int projectID, String appoNo, String mobileNo) async { Map request; - request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102}; + request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(AUTO_GENERATE_INVOICE_TAMARA, onSuccess: (response, statusCode) async { localRes = response; @@ -1740,7 +1765,7 @@ class DoctorsListService extends BaseService { Future checkPatientNphiesEligibility(int projectID) async { Map request; - request = {"ProjectID": projectID}; + request = {"ProjectID": projectID, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(CHECK_PATIENT_NPHIES_ELIGIBILITY, onSuccess: (response, statusCode) async { localRes = response; @@ -1753,7 +1778,7 @@ class DoctorsListService extends BaseService { Future convertPatientToCash(int projectID) async { Map request; - request = {"ProjectID": projectID}; + request = {"ProjectID": projectID, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(CONVERT_PATIENT_TO_CASH, onSuccess: (response, statusCode) async { localRes = response; @@ -1797,6 +1822,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "SessionID": null, "isDentalAllowedBackend": false, + "LanguageID": 1, "DeviceTypeID": 1 }; diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 549c182a..7e75b63a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -203,7 +203,7 @@ class DoctorHeader extends StatelessWidget { List doctorDetailsList = List(); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) { + service.getDoctorsRatingDetails(headerModel.doctorId, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear();