From 9d046fd9714af7b927d27093d13cb9a666c6a941 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Dec 2020 15:02:58 +0300 Subject: [PATCH 1/6] updates & fixes --- .../all_habib_medical_service_page.dart | 60 +++++++++---------- .../MyAppointments/models/ArrivedButtons.dart | 12 ++-- .../widgets/AppointmentActions.dart | 55 +++++++++++++++-- .../appointment_services/GetDoctorsList.dart | 38 ++++++++++++ 4 files changed, 125 insertions(+), 40 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 316a2437..030e6c3e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -179,20 +179,20 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( - onTap: () { - Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ), - ), - ); - }, - imageLocation: 'assets/images/emergency_service_image.png', - title: TranslationBase.of(context).emergencyService, - ), + // ServicesContainer( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: ErOptions( + // isAppbar: true, + // ), + // ), + // ); + // }, + // imageLocation: 'assets/images/emergency_service_image.png', + // title: TranslationBase.of(context).emergencyService, + // ), ServicesContainer( onTap: () => Navigator.push( context, @@ -233,22 +233,22 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/virtual_tour_icon.png', title: TranslationBase.of(context).vTour, ), - ServicesContainer( - onTap: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyWebView( - title: TranslationBase.of(context).hmgNews, - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ), - ), - ); - }, - imageLocation: - 'assets/images/new-design/twitter_dashboard_icon.png', - title: TranslationBase.of(context).latestNews, - ), + // ServicesContainer( + // onTap: () { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (BuildContext context) => MyWebView( + // title: TranslationBase.of(context).hmgNews, + // selectedUrl: + // "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + // ), + // ), + // ); + // }, + // imageLocation: + // 'assets/images/new-design/twitter_dashboard_icon.png', + // title: TranslationBase.of(context).latestNews, + // ), ServicesContainer( onTap: () => Navigator.push( context, diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a5132883..ab139203 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -3,12 +3,12 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ArrivedButtons { static var buttons = [ - { - "title": TranslationBase.of(AppGlobal.context).arrived, - "subtitle": TranslationBase.of(AppGlobal.context).status, - "icon": "assets/images/new-design/waiting-room.png", - "caller": "openReschedule" - }, + // { + // "title": TranslationBase.of(AppGlobal.context).arrived, + // "subtitle": TranslationBase.of(AppGlobal.context).status, + // "icon": "assets/images/new-design/waiting-room.png", + // "caller": "openReschedule" + // }, { "title": TranslationBase.of(AppGlobal.context).medicines, "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 9ce6692c..3000def5 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.d import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -62,8 +64,8 @@ class _AppointmentActionsState extends State { toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; final double itemHeight = projectViewModel.isArabic - ? ((size.height - kToolbarHeight - 24) * 0.47) / 2 - : ((size.height - kToolbarHeight - 24) * 0.4) / 2; + ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 + : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemWidth = size.width / 2; return Container( @@ -83,7 +85,7 @@ class _AppointmentActionsState extends State { _handleButtonClicks(e); }, child: Column( - mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.max, children: [ Container( // height: 100.0, @@ -100,7 +102,7 @@ class _AppointmentActionsState extends State { color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, + mainAxisSize: MainAxisSize.max, children: [ Container( margin: @@ -196,6 +198,10 @@ class _AppointmentActionsState extends State { openAppointmentRadiology(); break; + case "labResult": + openAppointmentLabResults(); + break; + case "prescriptions": openPrescriptionReport(); break; @@ -403,6 +409,36 @@ class _AppointmentActionsState extends State { }); } + openAppointmentLabResults() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + PatientLabOrders patientLabOrders = new PatientLabOrders(); + service + .getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, + widget.appo.projectID, widget.appo.clinicID, context) + .then((res) { + print(res['ListLabResultsByAppNo']); + GifLoaderDialogUtils.hideDialog(context); + if (res['ListLabResultsByAppNo'] != null) { + patientLabOrders.orderNo = + res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); + patientLabOrders.invoiceNo = + res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); + patientLabOrders.clinicID = widget.appo.clinicID; + patientLabOrders.projectID = widget.appo.projectID.toString(); + print(patientLabOrders.invoiceNo); + print(patientLabOrders.orderNo); + navigateToLabResults(patientLabOrders); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + openAppointmentRadiology() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -438,10 +474,12 @@ class _AppointmentActionsState extends State { prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); }); print(prescriptionReportEnhList.length); + navigateToMedicinePrescriptionReport(prescriptionReportEnhList, res['ListPRM']); } else { AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); } }).catchError((err) { + print(err); GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); }); @@ -459,6 +497,15 @@ class _AppointmentActionsState extends State { appo: widget.appo))); } + Future navigateToLabResults(PatientLabOrders patientLabOrders) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LaboratoryResultPage(patientLabOrders: patientLabOrders))) + .then((value) {}); + } + Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async { Navigator.push( context, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index a320cf6b..d26c74ad 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1087,6 +1087,44 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, 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; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo": appoNo, + "ProjectID": projID, + "ClinicID": clinicID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getPatientPrescriptionReports( AppoitmentAllHistoryResultList appo, BuildContext context) async { Map request; From 951d9b553fa14d7c6cd91875da394b30eb1027ec Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Dec 2020 17:53:14 +0300 Subject: [PATCH 2/6] fixes & updates --- lib/config/config.dart | 2 + .../all_habib_medical_service_page.dart | 2 +- lib/pages/BookAppointment/SearchResults.dart | 2 +- .../components/SearchByClinic.dart | 63 ++++++++++----- lib/pages/ToDoList/ToDo.dart | 6 +- lib/pages/landing/landing_page.dart | 4 +- lib/pages/paymentService/payment_service.dart | 76 +++++++++++-------- .../bottom_navigation/bottom_nav_bar.dart | 2 +- 8 files changed, 101 insertions(+), 56 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c9f3186a..e14a544a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -43,6 +43,8 @@ const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabO /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; + const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 030e6c3e..870fef97 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -208,7 +208,7 @@ class _AllHabibMedicalServiceState extends State { onTap: () => Navigator.push( context, FadePage( - page: ToDo(), + page: ToDo(isShowAppBar: true), ), ), imageLocation: diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 72226c2e..e9897cf8 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -37,7 +37,7 @@ class _SearchResultsState extends State { ...List.generate( widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( - isExpand: index == 1 ? true : false, + // isExpand: index == 0 ? true : false, title: widget.patientDoctorAppointmentListHospital[index] .filterName + " - " + diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 355bb52b..4d5d4d49 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -216,6 +216,9 @@ class _SearchByClinicState extends State { List arrDistance = []; List result; int numAll; + List _patientDoctorAppointmentListHospital = + List(); + DoctorsListService service = new DoctorsListService(); service .getDoctorsList( @@ -228,23 +231,48 @@ class _SearchByClinicState extends State { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { - print(res['DoctorList']); + // print(res['DoctorList']); doctorsList.clear(); res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); + // arr.add(new DoctorList.fromJson(v).projectName); + // arrDistance.add(new DoctorList.fromJson(v) + // .projectDistanceInKiloMeters + // .toString()); + }); + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } }); } else {} }); result = LinkedHashSet.from(arr).toList(); numAll = result.length; + // navigateToSearchResults( + // context, doctorsList, result, numAll, arrDistance); navigateToSearchResults( - context, doctorsList, result, numAll, arrDistance); + context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -267,17 +295,18 @@ class _SearchByClinicState extends State { } Future navigateToSearchResults( - context, docList, result, numAll, resultDistance) async { - Navigator.push( context, - MaterialPageRoute( - builder: (context) => BranchView( - doctorsList: docList, - result: result, - num: numAll, - resultDistance: resultDistance), - ), - ).then((value) { + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))).then((value) { getProjectsList(); }); } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 25f2e0a7..2e0a3047 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -30,6 +30,10 @@ class ToDo extends StatefulWidget { var languageID; MyInAppBrowser browser; + bool isShowAppBar = true; + + ToDo({@required this.isShowAppBar}); + @override _ToDoState createState() => _ToDoState(); } @@ -62,7 +66,7 @@ class _ToDoState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, - isShowAppBar: false, + isShowAppBar: widget.isShowAppBar, isShowDecPage: true, description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index f86511c1..b8d27d65 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -430,13 +430,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { children: [ HomePage( goToMyProfile: () { - // _changeCurrentTab(1); + _changeCurrentTab(1); }, ), MedicalProfilePage(), BookingOptions(), MyFamily(isAppbarVisible: false), - ToDo(), + ToDo(isShowAppBar: false), ], // Please do not remove the BookingOptions from this array ), bottomNavigationBar: BottomNavBar( diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 63d09f3a..126c3cdc 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -51,9 +51,11 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Container( - margin: EdgeInsets.only(left: 10,right: 10), + margin: EdgeInsets.only(left: 10, right: 10), child: Image.asset( 'assets/images/online_payment_icon.png', fit: BoxFit.fill, @@ -67,37 +69,43 @@ class PaymentService extends StatelessWidget { ), ), Expanded( - child: Container( - margin: EdgeInsets.all(5.0), - padding: EdgeInsets.all(9), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.0), - shape: BoxShape.rectangle), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).onlineCheckIn, - color: HexColor('#B61422'), - bold: true, - ), - Texts( - TranslationBase.of(context).appointment, - fontSize: 14, - fontWeight: FontWeight.normal, - ), - SizedBox(height: 12,), - Align( - alignment: !projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Image.asset( - 'assets/images/device_icon.png', - height: 55, + child: InkWell( + onTap: () => + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: HexColor('#B61422'), + bold: true, ), - ), - ], + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + SizedBox( + height: 12, + ), + Align( + alignment: !projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/device_icon.png', + height: 55, + ), + ), + ], + ), ), ), ) @@ -130,7 +138,9 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Align( alignment: !projectViewModel.isArabic ? Alignment.centerRight diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 1ae7b684..2632ec4a 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -103,6 +103,6 @@ class _BottomNavBarState extends State { } Future navigateToToDoList(context) async { - Navigator.push(context, MaterialPageRoute(builder: (context) => ToDo())); + Navigator.push(context, MaterialPageRoute(builder: (context) => ToDo(isShowAppBar: false))); } } From 5606c88715b80e432d3892a45a5ec71a5791c7c6 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Mon, 14 Dec 2020 18:13:38 +0300 Subject: [PATCH 3/6] hot fixes --- lib/config/localized_values.dart | 4 + lib/core/service/medical/reports_service.dart | 13 +- .../insurance/insurance_card_screen.dart | 3 +- .../insurance/insurance_update_screen.dart | 198 ++++++++++-------- .../medical/reports/report_home_page.dart | 39 +++- .../medical/reports/report_list_widget.dart | 55 +++-- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/buttons/secondary_button.dart | 2 +- 8 files changed, 192 insertions(+), 123 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 059b03ab..98bb0e74 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1162,4 +1162,8 @@ const Map localizedValues = { "en": "Please rate the clinic", "ar": "يرجى تقييم العيادة" }, + "fetch-data": { + "en": "Fetch Data", + "ar": "تحديث الان" + }, }; diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 7acb92ea..b2f90e61 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -100,8 +100,6 @@ class ReportsService extends BaseService { String requestDate, String invoiceNo, int projectID, - String printID, - String procedureID, String stamp, String setupID) async { Map body = new Map(); @@ -114,19 +112,24 @@ class ReportsService extends BaseService { body['DateofBirth'] = user.dateofBirth; body['PatientIditificationNum'] = user.patientIdentificationNo; body['PatientMobileNumber'] = user.mobileNumber; - body['PatientName'] = user.firstName + " " + user.firstName; + body['PatientName'] = user.firstName + " " + user.lastName; body['ProjectName'] = projectName; body['ClinicName'] = clinicName; body['ProjectID'] = projectID; body['InvoiceNo'] = invoiceNo; - body['PrintedByName'] = user.firstName + " " + user.firstName; + body['PrintedByName'] = user.firstName + " " + user.lastName; + + dynamic response; hasError = false; await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL, - onSuccess: (dynamic response, int statusCode) {}, + onSuccess: (dynamic res, int statusCode) { + response = res; + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); + return response; } } diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 42357eea..71c09635 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -167,7 +167,8 @@ class _InsuranceCardState extends State { onTap: () => { getDetails(model.insurance[index]) }, - label: TranslationBase.of(context).seeDetails, + label: TranslationBase.of(context) + .seeDetails, textColor: Colors.white, ), width: double.infinity, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index a7e7c32b..8be58af4 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,5 +1,10 @@ +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; @@ -15,6 +20,7 @@ class InsuranceUpdate extends StatefulWidget { class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; + InsuranceCardService _insuranceCardService = locator(); @override void initState() { @@ -103,94 +109,109 @@ class _InsuranceUpdateState extends State itemCount: model.getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: - EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientName, - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, + return model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .status == + 3 + ? Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB( + 8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10), + ), + child: Container( + width: + MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of( + context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: + FontWeight.w500, + ) + ], + ), ), - SizedBox( - height: 8, + ), + if (false) + Expanded( + flex: 2, + child: Container( + margin: + EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase + .of(context) + .fetchData, + small: true, + textColor: + Colors.white, + onTap: () { + getDetails( + model); + }, + ), + ), + ], + ), ), - Texts( - TranslationBase.of(context) - .fileno + - ": " + - model - .getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index] - .patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], - ), + ) + ], ), ), - if (false) - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of( - context) - .updateInsurance, - small: true, - textColor: Colors.white, - // color: Colors.grey, - ), - //height: 45, - // width:90 - ), - ], - ), - ), - ) - ], - ), - ), - ), - ); + ), + ) + : Container(); }) : Container(), ), @@ -309,4 +330,13 @@ class _InsuranceUpdateState extends State ), ); } + + getDetails(data) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService.getInsuranceDetails(data).then((value) => { + GifLoaderDialogUtils.hideDialog(context), + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) + }); + } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 636d4e00..b99fb40f 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -37,9 +37,21 @@ class _HomeReportPageState extends State @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); return BaseView( onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( @@ -93,7 +105,8 @@ class _HomeReportPageState extends State Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).requested), + child: + Texts(TranslationBase.of(context).requested), ), ), Container( @@ -105,13 +118,15 @@ class _HomeReportPageState extends State Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).completed), + child: + Texts(TranslationBase.of(context).completed), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).cancelled), + child: + Texts(TranslationBase.of(context).cancelled), ), ), ], @@ -130,21 +145,23 @@ class _HomeReportPageState extends State controller: _tabController, children: [ ReportListWidget( - reportList: model.reportsOrderRequestList, + reportList: model.reportsOrderRequestList ), ReportListWidget( - reportList: model.reportsOrderReadyList, + reportList: model.reportsOrderReadyList ), ReportListWidget( - reportList: model.reportsOrderCompletedList, + reportList: model.reportsOrderCompletedList ), ReportListWidget( - reportList: model.reportsOrderCanceledList, + reportList: model.reportsOrderCanceledList ), ], ), ), - SizedBox(height: 110,) + SizedBox( + height: 110, + ) ], ), bottomSheet: Container( diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 4002b1ba..b838fd92 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -1,7 +1,10 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -10,8 +13,9 @@ import 'package:flutter/material.dart'; class ReportListWidget extends StatelessWidget { final List reportList; + final Function onEmailTap; - ReportListWidget({@required this.reportList}); + ReportListWidget({@required this.reportList, this.onEmailTap}); @override Widget build(BuildContext context) { @@ -48,17 +52,6 @@ class ReportListWidget extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - reportList[index].status == 2 - ? Container( - child: InkWell( - onTap: sendReportEmail(), - child: Icon( - Icons.email, - color: Colors.red, - ), - ), - ) - : Container(), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -72,6 +65,21 @@ class ReportListWidget extends StatelessWidget { SizedBox(height: 12), ], ), + reportList[index].status == 2 + ? Container( + margin: EdgeInsets.only(left: 15.0, right: 15.0), + child: InkWell( + onTap: () { + sendReportEmail(reportList[index]); + }, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + size: 35.0, + ), + ), + ) + : Container(), ], ), ), @@ -86,21 +94,26 @@ class ReportListWidget extends StatelessWidget { } sendReportEmail(Reports report) { + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); - _reportsService .sendEmailForMedicalReport( report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), - report.invoiceNo.toString(), - report.projectID, - report.printID, - procedureID, - stamp, - setupID) - .then((value) {}) - .catchError(() {}); + report.invoiceNo.toString(), + report.projectID, + DateUtil.convertDateToString(report.requestDate), + report.setupId) + .then((value) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(value["IsSent"]); + AppToast.showSuccessToast( + message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(err); + }); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index fece63a2..9836fadf 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1018,6 +1018,7 @@ class TranslationBase { String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; + String get fetchData => localizedValues['fetch-data'][locale.languageCode]; } diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 71a88554..ccb436fe 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -236,7 +236,7 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: 17.0, + fontSize: widget.small ? 12.0 : 17.0, fontWeight: FontWeight.w800, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), ), From b9269f525adacdda43c42d3c4512b5fe1c0cd08a Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Mon, 14 Dec 2020 23:10:30 +0300 Subject: [PATCH 4/6] hot fixes --- lib/pages/MyAppointments/MyAppointments.dart | 51 ++++++++++--------- lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/login/login.dart | 2 +- .../medical/patient_sick_leave_page.dart | 46 +++++++++++++---- .../radiology/radiology_details_page.dart | 46 ++++++++++++----- .../medical/reports/report_home_page.dart | 12 +++-- .../medical/reports/report_list_widget.dart | 24 +++++++-- .../rate_appointment_doctor.dart | 14 ++--- lib/uitl/date_uitl.dart | 23 ++++++++- .../medical/time_line_widget.dart | 36 +++++++++---- 10 files changed, 177 insertions(+), 79 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 47e539a0..80f2c9b7 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -84,17 +84,19 @@ class _MyAppointmentsState extends State color: Colors.grey[600], thickness: 0.5, ), - Expanded( - child: new TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - isDataLoaded ? getBookedAppointments() : Container(), - isDataLoaded ? getConfirmedAppointments() : Container(), - isDataLoaded ? getArrivedAppointments() : Container() - ], - controller: _tabController, - ), - ), + isDataLoaded + ? Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + getBookedAppointments(), + getConfirmedAppointments(), + getArrivedAppointments() + ], + controller: _tabController, + ), + ) + : Container(), ]), ), ); @@ -114,19 +116,17 @@ class _MyAppointmentsState extends State service.getPatientAppointmentHistory(false, context).then((res) { print(res['AppoimentAllHistoryResultList'].length); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - isDataLoaded = true; - if (res['AppoimentAllHistoryResultList'].length != 0) { - isDataLoaded = true; - res['AppoimentAllHistoryResultList'].forEach((v) { - widget.appoList - .add(new AppoitmentAllHistoryResultList.fromJson(v)); - }); - sortAppointmentList(); - } else {} - }); + // setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + // isDataLoaded = true; + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + sortAppointmentList(); + } else {} + // }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -256,6 +256,9 @@ class _MyAppointmentsState extends State return; } } + setState(() { + isDataLoaded = true; + }); } Widget getBookedAppointments() { @@ -419,6 +422,4 @@ class _MyAppointmentsState extends State ), ); } - - } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 129f5ce9..98d9cc10 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -54,7 +54,6 @@ class _ToDoState extends State { @override void initState() { - toDoProvider = Provider.of(context); widget.patientShareResponse = new PatientShareResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { if (authenticatedUserObject.isLogin) getPatientData(); @@ -69,6 +68,7 @@ class _ToDoState extends State { @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 366a49d9..729e294a 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -256,6 +256,7 @@ class _Login extends State { appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { + getToDoCount(), GifLoaderDialogUtils.hideDialog(context), if (appointmentRateViewModel.isHaveAppointmentNotRate) { @@ -268,7 +269,6 @@ class _Login extends State { } else { - getToDoCount(), Navigator.pushAndRemoveUntil( context, FadePage( diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 033295aa..fd8ecf0f 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,11 +1,14 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class PatientSickLeavePage extends StatefulWidget { @override @@ -14,9 +17,14 @@ class PatientSickLeavePage extends StatefulWidget { class _PatientSickLeavePageState extends State { List imagesInfo = List(); + @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); return BaseView( onModelReady: (model) => model.getSickLeave(), builder: (_, model, w) => AppScaffold( @@ -37,16 +45,16 @@ class _PatientSickLeavePageState extends State { profileUrl: model.sickLeaveList[index].doctorImageURL, rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), subName: model.sickLeaveList[index].projectName, - isInOutPatient: - model.sickLeaveList[index].isInOutPatient, + isInOutPatient: model.sickLeaveList[index].isInOutPatient, onEmailTap: () { - model.sendSickLeaveEmail( - message: TranslationBase.of(context).emailSentSuccessfully, - requestNo: model.sickLeaveList[index].requestNo, - doctorName: model.sickLeaveList[index].doctorName, - projectName: model.sickLeaveList[index].projectName, - setupID: model.sickLeaveList[index].setupID, - projectID: model.sickLeaveList[index].projectID); + showConfirmMessage(model, index); + // model.sendSickLeaveEmail( + // message: TranslationBase.of(context).emailSentSuccessfully, + // requestNo: model.sickLeaveList[index].requestNo, + // doctorName: model.sickLeaveList[index].doctorName, + // projectName: model.sickLeaveList[index].projectName, + // setupID: model.sickLeaveList[index].setupID, + // projectID: model.sickLeaveList[index].projectID); }, ), ), @@ -54,4 +62,22 @@ class _PatientSickLeavePageState extends State { ), ); } + + void showConfirmMessage(PatientSickLeaveViewMode model, int index) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendSickLeaveEmail( + message: TranslationBase.of(context).emailSentSuccessfully, + requestNo: model.sickLeaveList[index].requestNo, + doctorName: model.sickLeaveList[index].doctorName, + projectName: model.sickLeaveList[index].projectName, + setupID: model.sickLeaveList[index].setupID, + projectID: model.sickLeaveList[index].projectID); + }, + ), + ); + } } diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 0e0967d0..fb4ddddb 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -51,29 +53,32 @@ class RadiologyDetailsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: model.radImageURL.isNotEmpty ? MediaQuery.of(context).size.height * 0.2:MediaQuery.of(context).size.height * 0.15, + height: finalRadiology.dIAPACSURL != "" + ? MediaQuery.of(context).size.height * 0.2 + : MediaQuery.of(context).size.height * 0.15, color: Colors.grey[100], child: Column( mainAxisSize: MainAxisSize.min, children: [ Divider(), - if(model.radImageURL.isNotEmpty) + if (finalRadiology.dIAPACSURL != "") + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + label: TranslationBase.of(context).openRad, + backgroundColor: Colors.grey[800], + ), + ), Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () { - launch(model.radImageURL); + showConfirmMessage( + finalRadiology: finalRadiology, model: model); }, - label: TranslationBase.of(context).openRad, - backgroundColor: Colors.grey[800], - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () => model.sendRadReportEmail( - mes: TranslationBase.of(context).sendSuc, - finalRadiology: finalRadiology), label: TranslationBase.of(context).sendCopyRad, loading: model.state == ViewState.BusyLocal, backgroundColor: Theme.of(context).primaryColor, @@ -84,4 +89,19 @@ class RadiologyDetailsPage extends StatelessWidget { )), ); } + + void showConfirmMessage( + {FinalRadiology finalRadiology, RadiologyViewModel model}) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendRadReportEmail( + mes: TranslationBase.of(AppGlobal.context).sendSuc, + finalRadiology: finalRadiology); + }, + ), + ); + } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index b99fb40f..8866757f 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -145,16 +145,20 @@ class _HomeReportPageState extends State controller: _tabController, children: [ ReportListWidget( - reportList: model.reportsOrderRequestList + reportList: model.reportsOrderRequestList, + emailAddress: model.user.emailAddress ), ReportListWidget( - reportList: model.reportsOrderReadyList + reportList: model.reportsOrderReadyList, + emailAddress: model.user.emailAddress ), ReportListWidget( - reportList: model.reportsOrderCompletedList + reportList: model.reportsOrderCompletedList, + emailAddress: model.user.emailAddress ), ReportListWidget( - reportList: model.reportsOrderCanceledList + reportList: model.reportsOrderCanceledList, + emailAddress: model.user.emailAddress ), ], ), diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index b838fd92..39946cae 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -13,9 +14,9 @@ import 'package:flutter/material.dart'; class ReportListWidget extends StatelessWidget { final List reportList; - final Function onEmailTap; + final String emailAddress; - ReportListWidget({@required this.reportList, this.onEmailTap}); + ReportListWidget({@required this.reportList, this.emailAddress}); @override Widget build(BuildContext context) { @@ -67,10 +68,12 @@ class ReportListWidget extends StatelessWidget { ), reportList[index].status == 2 ? Container( - margin: EdgeInsets.only(left: 15.0, right: 15.0), + margin: + EdgeInsets.only(left: 15.0, right: 15.0), child: InkWell( onTap: () { - sendReportEmail(reportList[index]); + showConfirmMessage(reportList[index]); + // sendReportEmail(reportList[index]); }, child: Icon( Icons.email, @@ -93,6 +96,18 @@ class ReportListWidget extends StatelessWidget { ); } + void showConfirmMessage(Reports report) { + showDialog( + context: AppGlobal.context, + child: ConfirmSendEmailDialog( + email: emailAddress, + onTapSendEmail: () { + sendReportEmail(report); + }, + ), + ); + } + sendReportEmail(Reports report) { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); @@ -108,7 +123,6 @@ class ReportListWidget extends StatelessWidget { report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - print(value["IsSent"]); AppToast.showSuccessToast( message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); }).catchError((err) { diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 1cd560d4..4a1026f6 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -162,15 +162,15 @@ class _RateAppointmentDoctorState extends State { Form( key: formKey, child: TextFields( - hintText: "Notes", + hintText: TranslationBase.of(context).notes, minLines: 4, maxLines: 4, - validator: (value) { - if (value.isEmpty) - return 'Please enter your note'; - else if (rating == 0) return 'Rating cannot be \"0\"'; - return null; - }, + // validator: (value) { + // if (value.isEmpty) + // return 'Please enter your note'; + // else if (rating == 0) return 'Rating cannot be \"0\"'; + // return null; + // }, onChanged: (value) { setState(() { note = value; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 3e6123c2..637b0795 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -23,8 +23,9 @@ class DateUtil { if (date != null) { try { var dateT = date.split('/'); - var year = dateT[2].substring(0,4); - var dateP = DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + var year = dateT[2].substring(0, 4); + var dateP = + DateTime(int.parse(year), int.parse(dateT[1]), int.parse(dateT[0])); return dateP; } catch (e) { print(e); @@ -277,6 +278,24 @@ class DateUtil { return ""; } + static String getMonthDayYearLangDateFormatted( + DateTime dateTime, String lang) { + if (dateTime != null) + return lang == 'en' + ? getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString() + : dateTime.day.toString() + + " " + + getMonthArabic(dateTime.month) + + " " + + dateTime.year.toString(); + else + return ""; + } + /// get data formatted like 26/4/2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime) { diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index ddb3175a..6e946aa5 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -51,8 +51,12 @@ class TimeLineWidget extends StatelessWidget { LargeAvatar( onTap: () { //AppointmentDetails - Navigator.push(context, - FadePage(page: AppointmentDetails(appo: appoitmentAllHistoryResul,))); + Navigator.push( + context, + FadePage( + page: AppointmentDetails( + appo: appoitmentAllHistoryResul, + ))); }, name: appoitmentAllHistoryResul.doctorNameObj, url: appoitmentAllHistoryResul.doctorImageURL, @@ -69,7 +73,8 @@ class TimeLineWidget extends StatelessWidget { height: 15, decoration: BoxDecoration( color: Theme.of(context).primaryColor, - border: Border.all(color: Theme.of(context).primaryColor, width: 2), + border: Border.all( + color: Theme.of(context).primaryColor, width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -80,7 +85,10 @@ class TimeLineWidget extends StatelessWidget { height: 4, ), Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul.appointmentDate)), + DateUtil.getMonthDayYearLangDateFormatted( + DateUtil.convertStringToDate( + appoitmentAllHistoryResul.appointmentDate), + projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -97,7 +105,7 @@ class TimeLineWidget extends StatelessWidget { ) else Positioned( - top:projectViewModel.isArabic ? 35 : 50, + top: projectViewModel.isArabic ? 35 : 50, child: Container( margin: EdgeInsets.only(left: 2, right: 2), child: Column( @@ -109,9 +117,10 @@ class TimeLineWidget extends StatelessWidget { fontWeight: FontWeight.normal, ), Texts( - DateUtil.getMonthDayYearDateFormatted( + DateUtil.getMonthDayYearLangDateFormatted( DateUtil.convertStringToDate( - appoitmentAllHistoryResul.appointmentDate)), + appoitmentAllHistoryResul.appointmentDate), + projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -124,7 +133,8 @@ class TimeLineWidget extends StatelessWidget { height: 15, decoration: BoxDecoration( color: Theme.of(context).primaryColor, - border: Border.all(color: Theme.of(context).primaryColor, width: 2), + border: Border.all( + color: Theme.of(context).primaryColor, width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -137,9 +147,13 @@ class TimeLineWidget extends StatelessWidget { color: Colors.white, ), LargeAvatar( - onTap: (){ - Navigator.push(context, - FadePage(page: AppointmentDetails(appo: appoitmentAllHistoryResul,))); + onTap: () { + Navigator.push( + context, + FadePage( + page: AppointmentDetails( + appo: appoitmentAllHistoryResul, + ))); }, name: appoitmentAllHistoryResul.doctorNameObj, url: appoitmentAllHistoryResul.doctorImageURL, From a2e385f28236544c747ffbe6b342da0ee145c440 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 15 Dec 2020 11:37:51 +0300 Subject: [PATCH 5/6] family file drawer --- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index b30a3922..9ac2f8f9 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -257,7 +257,7 @@ class _AppDrawerState extends State { padding: EdgeInsets.only(left: 5, right: 5), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), - AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), ]))), ], ))) From bf999e611b092a05c1662e25b3aa65917f34ccd7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 15 Dec 2020 14:19:28 +0300 Subject: [PATCH 6/6] my appointment fix --- lib/pages/MyAppointments/MyAppointments.dart | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 80f2c9b7..f36a2828 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -117,19 +117,22 @@ class _MyAppointmentsState extends State service.getPatientAppointmentHistory(false, context).then((res) { print(res['AppoimentAllHistoryResultList'].length); GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - // setState(() { - if (res['AppoimentAllHistoryResultList'].length != 0) { - // isDataLoaded = true; - res['AppoimentAllHistoryResultList'].forEach((v) { - widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); - }); - sortAppointmentList(); - } else {} - // }); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } + setState(() { + if (res['MessageStatus'] == 1) { + // setState(() { + if (res['AppoimentAllHistoryResultList'].length != 0) { + // isDataLoaded = true; + res['AppoimentAllHistoryResultList'].forEach((v) { + widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + sortAppointmentList(); + } else {} + // }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -256,9 +259,6 @@ class _MyAppointmentsState extends State return; } } - setState(() { - isDataLoaded = true; - }); } Widget getBookedAppointments() {