From 657248803f74e43c58a2b599d1468a9acb0aec93 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 8 Aug 2023 17:54:04 +0300 Subject: [PATCH 01/19] Ask doc disabled for LiveCare appointments --- lib/pages/MyAppointments/widgets/AppointmentActions.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 63ad920b..6924cb63 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -72,7 +72,7 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { - bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule"); + bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); return InkWell( onTap: shouldEnable ? null From 9b3c07d3b11349500a1eb34a05bed51178b3d808 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Aug 2023 11:32:08 +0300 Subject: [PATCH 02/19] Added AED in advance payment --- lib/config/localized_values.dart | 1 + lib/core/model/hospitals/hospitals_model.dart | 2 +- lib/pages/Blood/confirm_payment_page.dart | 2 +- lib/pages/medical/balance/confirm_payment_page.dart | 7 ++++++- lib/uitl/translations_delegate_base.dart | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2336430b..80237255 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -581,6 +581,7 @@ const Map localizedValues = { "items": {"en": "item(s)", "ar": "عنصر"}, "checkOut": {"en": "CHECK OUT", "ar": "الدفع"}, "sar": {"en": "SAR", "ar": " ر.س "}, + "aed": {"en": "AED", "ar": "درهم"}, "payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "}, "cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "}, "confirmAddress": {"en": "CONFIRM ADDRESS ", "ar": " تأكيد العنوان "}, diff --git a/lib/core/model/hospitals/hospitals_model.dart b/lib/core/model/hospitals/hospitals_model.dart index 246de0b1..43e2e50b 100644 --- a/lib/core/model/hospitals/hospitals_model.dart +++ b/lib/core/model/hospitals/hospitals_model.dart @@ -13,7 +13,7 @@ class HospitalsModel { String latitude; String longitude; dynamic mainProjectID; - dynamic projectOutSA; + bool projectOutSA; bool usingInDoctorApp; HospitalsModel( diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 4b3f96e2..149d1a33 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -84,7 +84,7 @@ class ConfirmPaymentPage extends StatelessWidget { child: selectedPaymentMethod == "ApplePay" ? SvgPicture.asset(getImagePath(selectedPaymentMethod)) : Image.asset(getImagePath(selectedPaymentMethod)), ), Texts( - '${advanceModel.amount} SAR', + advanceModel.hospitalsModel.projectOutSA ? '${advanceModel.amount} AED' : '${advanceModel.amount} SAR', fontSize: 26, bold: true, ) diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 7c562b43..b3b29384 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; + // import 'package:pay/pay.dart'; import 'package:provider/provider.dart'; @@ -52,6 +53,7 @@ class _ConfirmPaymentPageState extends State { String tamaraPaymentStatus; String tamaraOrderID; + // Pay _payClient; @override @@ -137,7 +139,10 @@ class _ConfirmPaymentPageState extends State { : Image.asset(getImagePath(widget.selectedPaymentMethod)), ), Text( - '${widget.advanceModel.amount} ' + TranslationBase.of(context).sar, + widget.advanceModel.hospitalsModel.projectOutSA + ? '${widget.advanceModel.amount} ' + TranslationBase.of(context).aed + : '${widget.advanceModel.amount} ' + TranslationBase.of(context).sar, + // '${widget.advanceModel.amount} ' + TranslationBase.of(context).sar, style: TextStyle( fontSize: 20, fontWeight: FontWeight.w900, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5f2d0f3f..04c85504 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1071,6 +1071,8 @@ class TranslationBase { String get sar => localizedValues['sar'][locale.languageCode]; + String get aed => localizedValues['aed'][locale.languageCode]; + String get payOnline => localizedValues['payOnline'][locale.languageCode]; String get cancelOrder => localizedValues['cancelOrder'][locale.languageCode]; From a17b941c63d97e9d0c45e4dcb9c3897aa395f7c6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Aug 2023 15:28:05 +0300 Subject: [PATCH 03/19] InPatient Medical Report continued --- lib/config/localized_values.dart | 2 + .../reports/admission_for_medical_report.dart | 228 ++++++++++++++++++ lib/core/service/medical/reports_service.dart | 45 +++- .../medical/reports_view_model.dart | 83 +++++-- .../inpatient_medical_reports_page.dart | 132 ++++++++++ .../medical/reports/report_home_page.dart | 130 +++++++++- .../medical/reports/report_list_widget.dart | 4 +- lib/uitl/translations_delegate_base.dart | 2 + 8 files changed, 594 insertions(+), 32 deletions(-) create mode 100644 lib/core/model/reports/admission_for_medical_report.dart create mode 100644 lib/pages/medical/reports/inpatient_medical_reports_page.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 80237255..4984053d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1891,4 +1891,6 @@ const Map localizedValues = { "updateInsuranceManuallyDialog": {"en": "Would you like to update your insurance manually?", "ar": "هل ترغب في تحديث التأمين الخاص بك يدويًا؟"}, "viewReport": {"en": "View Report", "ar": "عرض التقرير"}, "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, + "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, + "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, }; \ No newline at end of file diff --git a/lib/core/model/reports/admission_for_medical_report.dart b/lib/core/model/reports/admission_for_medical_report.dart new file mode 100644 index 00000000..a185762d --- /dev/null +++ b/lib/core/model/reports/admission_for_medical_report.dart @@ -0,0 +1,228 @@ +class AdmissionMedicalReport { + int rowID; + String setupID; + int projectID; + int admissionNo; + String admissionDate; + int admissionRequestNo; + int admissionType; + int patientType; + int patientID; + int clinicID; + int doctorID; + int admittingClinicID; + int admittingDoctorID; + int categoryID; + String roomID; + String bedID; + String dischargeDate; + int approvalNo; + dynamic relativeID; + String registrationDate; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int patientCategory; + int gender; + String dateofBirth; + String dateofBirthN; + String nationalityID; + String firstVisit; + String lastVisit; + int noOfVisit; + String mobileNumber; + String patientIdentificationNo; + int sTATUS; + int admissionStatus; + int buildingID; + String buildingDescription; + String buildingDescriptionN; + int floorID; + int bedGender; + int tariffType; + dynamic cRSVerificationStatus; + String nursingStationID; + String description; + String clinicName; + String doctorNameObj; + int patientDataVerified; + String projectName; + dynamic projectNameN; + String statusDescription; + String statusDescriptionN; + + AdmissionMedicalReport( + {this.rowID, + this.setupID, + this.projectID, + this.admissionNo, + this.admissionDate, + this.admissionRequestNo, + this.admissionType, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.admittingClinicID, + this.admittingDoctorID, + this.categoryID, + this.roomID, + this.bedID, + this.dischargeDate, + this.approvalNo, + this.relativeID, + this.registrationDate, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.patientCategory, + this.gender, + this.dateofBirth, + this.dateofBirthN, + this.nationalityID, + this.firstVisit, + this.lastVisit, + this.noOfVisit, + this.mobileNumber, + this.patientIdentificationNo, + this.sTATUS, + this.admissionStatus, + this.buildingID, + this.buildingDescription, + this.buildingDescriptionN, + this.floorID, + this.bedGender, + this.tariffType, + this.cRSVerificationStatus, + this.nursingStationID, + this.description, + this.clinicName, + this.doctorNameObj, + this.patientDataVerified, + this.projectName, + this.projectNameN, + this.statusDescription, + this.statusDescriptionN}); + + AdmissionMedicalReport.fromJson(Map json) { + rowID = json['RowID']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + admissionDate = json['AdmissionDate']; + admissionRequestNo = json['AdmissionRequestNo']; + admissionType = json['AdmissionType']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + admittingClinicID = json['AdmittingClinicID']; + admittingDoctorID = json['AdmittingDoctorID']; + categoryID = json['CategoryID']; + roomID = json['RoomID']; + bedID = json['BedID']; + dischargeDate = json['DischargeDate']; + approvalNo = json['ApprovalNo']; + relativeID = json['RelativeID']; + registrationDate = json['RegistrationDate']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + patientCategory = json['PatientCategory']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + dateofBirthN = json['DateofBirthN']; + nationalityID = json['NationalityID']; + firstVisit = json['FirstVisit']; + lastVisit = json['LastVisit']; + noOfVisit = json['NoOfVisit']; + mobileNumber = json['MobileNumber']; + patientIdentificationNo = json['PatientIdentificationNo']; + sTATUS = json['STATUS']; + admissionStatus = json['AdmissionStatus']; + buildingID = json['BuildingID']; + buildingDescription = json['BuildingDescription']; + buildingDescriptionN = json['BuildingDescriptionN']; + floorID = json['FloorID']; + bedGender = json['BedGender']; + tariffType = json['TariffType']; + cRSVerificationStatus = json['CRSVerificationStatus']; + nursingStationID = json['NursingStationID']; + description = json['Description']; + clinicName = json['ClinicName']; + doctorNameObj = json['DoctorNameObj']; + patientDataVerified = json['PatientDataVerified']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + statusDescription = json['StatusDescription']; + statusDescriptionN = json['StatusDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionDate'] = this.admissionDate; + data['AdmissionRequestNo'] = this.admissionRequestNo; + data['AdmissionType'] = this.admissionType; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['AdmittingClinicID'] = this.admittingClinicID; + data['AdmittingDoctorID'] = this.admittingDoctorID; + data['CategoryID'] = this.categoryID; + data['RoomID'] = this.roomID; + data['BedID'] = this.bedID; + data['DischargeDate'] = this.dischargeDate; + data['ApprovalNo'] = this.approvalNo; + data['RelativeID'] = this.relativeID; + data['RegistrationDate'] = this.registrationDate; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['PatientCategory'] = this.patientCategory; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['DateofBirthN'] = this.dateofBirthN; + data['NationalityID'] = this.nationalityID; + data['FirstVisit'] = this.firstVisit; + data['LastVisit'] = this.lastVisit; + data['NoOfVisit'] = this.noOfVisit; + data['MobileNumber'] = this.mobileNumber; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['STATUS'] = this.sTATUS; + data['AdmissionStatus'] = this.admissionStatus; + data['BuildingID'] = this.buildingID; + data['BuildingDescription'] = this.buildingDescription; + data['BuildingDescriptionN'] = this.buildingDescriptionN; + data['FloorID'] = this.floorID; + data['BedGender'] = this.bedGender; + data['TariffType'] = this.tariffType; + data['CRSVerificationStatus'] = this.cRSVerificationStatus; + data['NursingStationID'] = this.nursingStationID; + data['Description'] = this.description; + data['ClinicName'] = this.clinicName; + data['DoctorNameObj'] = this.doctorNameObj; + data['PatientDataVerified'] = this.patientDataVerified; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['StatusDescription'] = this.statusDescription; + data['StatusDescriptionN'] = this.statusDescriptionN; + return data; + } +} diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index a496c6df..9281c51c 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -1,12 +1,17 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/admission_for_medical_report.dart'; import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; class ReportsService extends BaseService { List reportsList = List(); + List inpatientReportsList = List(); List appointHistoryList = List(); + + List admissionsMedicalReport = List(); + String userAgreementContent = ""; RequestReports _requestReports = RequestReports(isReport: true, encounterType: 1, requestType: 1, patientOutSA: 0, projectID: 0); @@ -23,13 +28,27 @@ class ReportsService extends BaseService { }, body: _requestReports.toJson()); } + Future getInPatientReports() async { + RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 1, requestType: 2, patientOutSA: 0, projectID: 0); + hasError = false; + await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) { + inpatientReportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + inpatientReportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReportsInpatient.toJson()); + } + Future getInpatientAdmissionsList() async { hasError = false; await baseAppClient.post(GET_INPATIENT_ADMISSIONS, onSuccess: (dynamic response, int statusCode) { - reportsList.clear(); + admissionsMedicalReport.clear(); print(response['AdmissionsForMedicalReport']); response['AdmissionsForMedicalReport'].forEach((reports) { - // reportsList.add(Reports.fromJson(reports)); + admissionsMedicalReport.add(AdmissionMedicalReport.fromJson(reports)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -105,6 +124,28 @@ class ReportsService extends BaseService { }, body: body); } + Future insertRequestForInPatientMedicalReport(int clinicID, int doctorID, String setupID, int admissionNo, int projectID) async { + Map body = new Map(); + body['ClinicID'] = clinicID; + body['DoctorID'] = doctorID; + body['SetupID'] = setupID; + body['EncounterNo'] = admissionNo; + body['EncounterType'] = 2; // appointmentHistory.appointmentType; + body['IsActive'] = true; + body['ProjectID'] = projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 2; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + Future sendEmailForMedicalReport(String projectName, String clinicName, String doctorName, String requestDate, String invoiceNo, int projectID, String stamp, String setupID) async { Map body = new Map(); body['SetupID'] = setupID; diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart index 544ead18..8f55b3b7 100644 --- a/lib/core/viewModels/medical/reports_view_model.dart +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/reports/admission_for_medical_report.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -15,17 +16,20 @@ class ReportsViewModel extends BaseViewModel { List reportsOrderRequestList = List(); List reportsOrderReadyList = List(); - List reportsOrderCompletedList = List(); List reportsOrderCanceledList = List(); - List get appointHistoryList => - _reportsService.appointHistoryList; + List reportsInPatientOrderRequestList = List(); + List reportsInPatientOrderReadyList = List(); + List reportsInPatientOrderCanceledList = List(); + + List get appointHistoryList => _reportsService.appointHistoryList; + + List get admissionsMedicalReportList => _reportsService.admissionsMedicalReport; getReports() async { setState(ViewState.Busy); reportsOrderRequestList.clear(); reportsOrderReadyList.clear(); - reportsOrderCompletedList.clear(); reportsOrderCanceledList.clear(); await _reportsService.getReports(); if (_reportsService.hasError) { @@ -38,6 +42,21 @@ class ReportsViewModel extends BaseViewModel { } } + getInPatientReports() async { + setState(ViewState.Busy); + reportsInPatientOrderRequestList.clear(); + reportsInPatientOrderReadyList.clear(); + reportsInPatientOrderCanceledList.clear(); + await _reportsService.getInPatientReports(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + _filterInPatientList(); + setState(ViewState.Idle); + } + } + getPatentAppointmentHistory() async { setState(ViewState.Busy); await _reportsService.getPatentAppointmentHistory(); @@ -49,6 +68,23 @@ class ReportsViewModel extends BaseViewModel { } } + void _filterInPatientList() { + _reportsService.inpatientReportsList.forEach((report) { + switch (report.status) { + case 1: + reportsInPatientOrderRequestList.add(report); + break; + case 2: + reportsInPatientOrderReadyList.add(report); + break; + case 4: + reportsInPatientOrderCanceledList.add(report); + break; + default: + } + }); + } + void _filterList() { _reportsService.reportsList.forEach((report) { switch (report.status) { @@ -58,9 +94,6 @@ class ReportsViewModel extends BaseViewModel { case 2: reportsOrderReadyList.add(report); break; - case 3: - reportsOrderCompletedList.add(report); - break; case 4: reportsOrderCanceledList.add(report); break; @@ -69,17 +102,31 @@ class ReportsViewModel extends BaseViewModel { }); } + insertRequestForMedicalReport(AppointmentHistory appointmentHistory, String mes) async { + setState(ViewState.Busy); + await _reportsService.insertRequestForMedicalReport(appointmentHistory); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: mes); + getInPatientReports(); + setState(ViewState.Idle); + } + } - insertRequestForMedicalReport(AppointmentHistory appointmentHistory,String mes)async{ - setState(ViewState.Busy); - await _reportsService.insertRequestForMedicalReport(appointmentHistory); - if (_reportsService.hasError) { - error = _reportsService.error; - AppToast.showErrorToast(message: error); - setState(ViewState.ErrorLocal); - } else { - AppToast.showSuccessToast(message: mes); - setState(ViewState.Idle); - } + insertRequestForInPatientMedicalReport(int clinicID, int doctorID, String setupID, int admissionNo, int projectID, String mes) async { + setState(ViewState.Busy); + await _reportsService.insertRequestForInPatientMedicalReport(clinicID, doctorID, setupID, admissionNo, projectID); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: mes); + setState(ViewState.Idle); + } } + } diff --git a/lib/pages/medical/reports/inpatient_medical_reports_page.dart b/lib/pages/medical/reports/inpatient_medical_reports_page.dart new file mode 100644 index 00000000..4eb10085 --- /dev/null +++ b/lib/pages/medical/reports/inpatient_medical_reports_page.dart @@ -0,0 +1,132 @@ +import 'package:diplomaticquarterapp/core/model/reports/admission_for_medical_report.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class InPatientMedicalReports extends StatefulWidget { + final AdmissionMedicalReport admissionMedicalReport; + + InPatientMedicalReports({@required this.admissionMedicalReport}); + + @override + State createState() => _InPatientMedicalReportsState(); +} + +class _InPatientMedicalReportsState extends State { + int _currentPage = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) { + model.getInPatientReports(); + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).newMedReport, + title: TranslationBase.of(context).medReport, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), + body: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(21), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + myRadioButton(TranslationBase.of(context).requested, 0), + myRadioButton(TranslationBase.of(context).ready, 1), + myRadioButton(TranslationBase.of(context).cancelled, 2), + ], + ), + ), + Expanded( + child: IndexedStack( + index: _currentPage, + children: [ + ReportListWidget(reportList: model.reportsInPatientOrderRequestList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsInPatientOrderReadyList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsInPatientOrderCanceledList, emailAddress: model.user.emailAddress), + ], + ), + ), + Padding( + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, + () { + confirmBox(model); + }, + ), + ), + ], + ), + ), + ), + ); + } + + void confirmBox(ReportsViewModel reportsViewModel) { + showDialog( + context: context, + builder: (cxt) => ConfirmWithMessageDialog( + message: TranslationBase.of(context).confirmMsgReport, + onTap: () => reportsViewModel.insertRequestForInPatientMedicalReport(widget.admissionMedicalReport.clinicID, widget.admissionMedicalReport.doctorID, widget.admissionMedicalReport.setupID, + widget.admissionMedicalReport.admissionNo, widget.admissionMedicalReport.projectID, TranslationBase.of(context).successSendReport), + ), + ); + return; + } + + Widget myRadioButton(String _label, int _value) { + return InkWell( + onTap: () { + setState(() { + _currentPage = _value; + }); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 22, + height: 22, + child: Radio( + value: _value, + activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8), + groupValue: _currentPage, + onChanged: (index) { + setState(() { + _currentPage = index; + }); + }, + ), + ), + SizedBox(width: 10), + Text( + _label, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 375bbb8c..3a902332 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -1,14 +1,21 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/reports/admission_for_medical_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/inpatient_medical_reports_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -28,9 +35,6 @@ class _HomeReportPageState extends State with SingleTickerProvid @override void initState() { _tabController_new = TabController(length: 2, vsync: this); - WidgetsBinding.instance.addPostFrameCallback((_) { - getInPatientAdmissionList(); - }); super.initState(); } @@ -50,7 +54,9 @@ class _HomeReportPageState extends State with SingleTickerProvid 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(), + onModelReady: (model) { + model.getReports(); + }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).newMedReport, @@ -87,11 +93,11 @@ class _HomeReportPageState extends State with SingleTickerProvid }, tabs: [ Text( - TranslationBase.of(context).inPatient, + TranslationBase.of(context).outpatient, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), ), Text( - TranslationBase.of(context).outpatient, + TranslationBase.of(context).inPatient, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), ), ], @@ -102,7 +108,6 @@ class _HomeReportPageState extends State with SingleTickerProvid physics: BouncingScrollPhysics(), controller: _tabController_new, children: [ - Container(), Container( child: Column( children: [ @@ -129,11 +134,118 @@ class _HomeReportPageState extends State with SingleTickerProvid ) ], ), + ), + // InPatient Medical Reports + Container( + child: model.admissionsMedicalReportList.isNotEmpty + ? Column( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + TranslationBase.of(context).selectAdmissionText, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + ), + ListView.separated( + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12), + itemBuilder: (context, index) { + AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index]; + return InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: InPatientMedicalReports( + admissionMedicalReport: admissionMedicalReport, + ))); + }, + child: Container( + // height: 100.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + Text(admissionMedicalReport.projectName, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + ], + ), + ], + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (admissionMedicalReport.clinicName != null) + MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + MyRichText( + TranslationBase.of(context).status + ":", + projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription, + projectViewModel.isArabic), + Icon( + Icons.arrow_forward, + color: Theme.of(context).primaryColor, + ) + ], + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }, + separatorBuilder: (context, index) => SizedBox( + height: 16.0, + ), + itemCount: model.admissionsMedicalReportList.length), + ], + ) + : getNoDataWidget(context), ) ], ), ), - if (projectViewModel.havePrivilege(21) && _tabController_new.index == 1) + if (projectViewModel.havePrivilege(21) && _tabController_new.index == 0) Padding( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( @@ -193,6 +305,4 @@ class _HomeReportPageState extends State with SingleTickerProvid ), ); } - - void getInPatientAdmissionList() {} } diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index e47b8244..5c62de22 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -91,8 +91,8 @@ class ReportListWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - if (report.projectName != null) MyRichText(TranslationBase.of(context).clinic + ":", report.projectName, projectViewModel.isArabic), - if (report.clinicDescription != null) MyRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription, projectViewModel.isArabic), + if (report.projectName != null) MyRichText(TranslationBase.of(context).hospital + ":", report.projectName, projectViewModel.isArabic), + if (report.clinicDescription != null) MyRichText(TranslationBase.of(context).clinic + ":", report.clinicDescription, projectViewModel.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 04c85504..8d8f51ee 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2900,6 +2900,8 @@ class TranslationBase { String get updateInsuranceManuallyDialog => localizedValues["updateInsuranceManuallyDialog"][locale.languageCode]; String get viewReport => localizedValues["viewReport"][locale.languageCode]; String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode]; + String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; + String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; } From 44d8f0efe23ca8d128f51b79aafb1d1f9679ad95 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Aug 2023 10:28:53 +0300 Subject: [PATCH 04/19] InPatient medical report contd. --- lib/core/service/medical/reports_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 9281c51c..f3938992 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -29,7 +29,7 @@ class ReportsService extends BaseService { } Future getInPatientReports() async { - RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 1, requestType: 2, patientOutSA: 0, projectID: 0); + RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 2, patientOutSA: 0, projectID: 0); hasError = false; await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) { inpatientReportsList.clear(); From e4e3377c5c61adcd26bfa9ca4d6416a57f9f00e6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 13 Aug 2023 10:56:55 +0300 Subject: [PATCH 05/19] update --- lib/core/service/medical/reports_service.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index f3938992..f9a0041c 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -43,6 +43,8 @@ class ReportsService extends BaseService { } Future getInpatientAdmissionsList() async { + Map body = new Map(); + body['IsForMedicalReport'] = true; hasError = false; await baseAppClient.post(GET_INPATIENT_ADMISSIONS, onSuccess: (dynamic response, int statusCode) { admissionsMedicalReport.clear(); @@ -53,7 +55,7 @@ class ReportsService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestReports.toJson()); + }, body: body); } Future getPatentAppointmentHistory() async { From 2455f48fe1ce68e94fd5dad6e521cd8e6ab3a885 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 15 Aug 2023 10:03:18 +0300 Subject: [PATCH 06/19] View medical report done --- lib/config/config.dart | 1 + lib/core/service/medical/reports_service.dart | 30 +++++++++++ .../medical/reports/report_list_widget.dart | 54 +++++++++++++++++-- pubspec.yaml | 2 + 4 files changed, 83 insertions(+), 4 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 73b647bf..17840c50 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -184,6 +184,7 @@ var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; var INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; var SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; var GET_INPATIENT_ADMISSIONS = 'Services/inps.svc/REST/getAdmissionForMedicalReport'; +var GET_MEDICAL_REPORT_PDF = 'Services/inps.svc/REST/getMedicalReportPDF'; ///Rate // var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index f9a0041c..9f8bfb45 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -177,4 +177,34 @@ class ReportsService extends BaseService { }, body: body); return response; } + + Future getMedicalReportPDF(String projectName, String clinicName, String doctorName, String requestDate, String invoiceNo, int projectID, String stamp, String setupID) async { + Map body = new Map(); + body['SetupID'] = setupID; + body['PrintDate'] = requestDate; + body['ProcedureID'] = "05005009"; + body['Reporttype'] = "MEDICAL REPORT"; + body['stamp'] = stamp; + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.lastName; + body['ProjectName'] = projectName; + body['ClinicName'] = clinicName; + body['ProjectID'] = projectID; + body['InvoiceNo'] = invoiceNo; + body['PrintedByName'] = user.firstName + " " + user.lastName; + + dynamic response; + + hasError = false; + await baseAppClient.post(GET_MEDICAL_REPORT_PDF, 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/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 5c62de22..016fad79 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -1,3 +1,7 @@ +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; @@ -14,6 +18,8 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:open_file/open_file.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -111,10 +117,22 @@ class ReportListWidget extends StatelessWidget { if (reportList[index].status == 2) Row( children: [ - Padding( - padding: const EdgeInsets.only(right: 11.0, left: 11.0), - child: Text(TranslationBase.of(context).viewReport, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontStyle: FontStyle.italic, color: CustomColors.accentColor, letterSpacing: -0.48, height: 18 / 12, decoration: TextDecoration.underline)), + InkWell( + onTap: () { + getMedicalReportPDF(report); + }, + child: Padding( + padding: const EdgeInsets.only(right: 11.0, left: 11.0), + child: Text(TranslationBase.of(context).viewReport, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.italic, + color: CustomColors.accentColor, + letterSpacing: -0.48, + height: 18 / 12, + decoration: TextDecoration.underline)), + ), ), IconButton( icon: Icon(Icons.email), @@ -155,6 +173,26 @@ class ReportListWidget extends StatelessWidget { ); } + void getMedicalReportPDF(Reports report) { + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + ReportsService _reportsService = locator(); + _reportsService + .getMedicalReportPDF(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID, + DateUtil.convertDateToString(report.requestDate), report.setupId) + .then((value) async { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + try { + String path = await _createFileFromString(value["MedicalReportBase64"], "pdf"); + OpenFile.open(path); + } catch (ex) { + AppToast.showErrorToast(message: "Cannot open file."); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print(err); + }); + } + sendReportEmail(Reports report) { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); @@ -169,4 +207,12 @@ class ReportListWidget extends StatelessWidget { print(err); }); } + + Future _createFileFromString(String encodedStr, String ext) async { + Uint8List bytes = base64.decode(encodedStr); + String dir = (await getApplicationDocumentsDirectory()).path; + File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext); + await file.writeAsBytes(bytes); + return file.path; + } } diff --git a/pubspec.yaml b/pubspec.yaml index c4265c47..c7bbbdf2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -207,6 +207,8 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 + open_file: ^3.2.1 + path_provider: ^2.0.8 # flutter_callkit_incoming: ^1.0.3+3 # firebase_core: 1.12.0 From 7c68779324dc93392106a08dd2ad0176a10d97a0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 17 Aug 2023 00:03:18 +0300 Subject: [PATCH 07/19] Nphies integration --- lib/config/config.dart | 3 + lib/pages/BookAppointment/BookConfirm.dart | 56 +++++++++++++++++-- lib/pages/ToDoList/ToDo.dart | 55 +++++++++++++++++- .../insurance/UpdateInsuranceManually.dart | 1 + .../appointment_services/GetDoctorsList.dart | 26 +++++++++ lib/widgets/dialogs/confirm_dialog.dart | 7 ++- .../dialogs/radio_selection_dialog.dart | 47 ++++++++++++++-- 7 files changed, 182 insertions(+), 13 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 17840c50..091acb7b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -604,6 +604,9 @@ var GET_NATIONALITY = 'Services/Lists.svc/REST/GetNationality'; var PAYFORT_TEST_URL = 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi'; var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi'; +var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; +var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; + class AppGlobal { static var context; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 473c8650..4214b01c 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -7,6 +7,9 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; +import 'package:diplomaticquarterapp/pages/insurance/UpdateInsuranceManually.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; @@ -271,7 +274,51 @@ class _BookConfirmState extends State { }); } - insertAppointment(context, DoctorList docObject, int initialSlotDuration) async{ + checkPatientNphiesEligibility(DoctorList docObject, String appointmentNo, BuildContext context) { + widget.service.checkPatientNphiesEligibility(docObject.projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res["isNphiesMatchedWithVida"]) { + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); + } else { + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: "Update insurance", + cancelText: "Continue as cash", + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(docObject, appointmentNo)}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + void openUpdateInsurance() { + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + } + + void continueAsCash(DoctorList docObject, String appointmentNo) { + GifLoaderDialogUtils.showMyDialog(context); + widget.service.convertPatientToCash(docObject.projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res["MessageStatus"] == 1) { + getPatientShare(context, appointmentNo, docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); + } else { + AppToast.showErrorToast(message: res["ErrorEndUserMessage"]); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + insertAppointment(context, DoctorList docObject, int initialSlotDuration) async { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; String logs = await sharedPref.getString('selectedLogSlots'); List decodedLogs = json.decode(logs); @@ -284,14 +331,13 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); Future.delayed(new Duration(milliseconds: 500), () { - getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - getToDoCount(); + checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); }); - widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs,res['AppointmentNo'], context).then((res) { + widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { if (res['MessageStatus'] == 1) { print("Logs Saved"); - }else{ + } else { print("Error Saving logs"); } }); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d8eeded9..d3705a7c 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -17,6 +17,8 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -28,6 +30,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; @@ -540,7 +543,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { confirmAppointment(appo); break; case 20: - getPatientShare(context, appo); + // getPatientShare(context, appo); + checkPatientNphiesEligibility(context, appo); break; case 30: getAppoQR(context, appo); @@ -837,6 +841,53 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { // getAncillaryOrders(); } + checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.checkPatientNphiesEligibility(appo.projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res["isNphiesMatchedWithVida"]) { + getPatientShare(context, appo); + // getToDoCount(); + } else { + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: "Update insurance", + cancelText: "Continue as cash", + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(appo)}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + void openUpdateInsurance() { + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + } + + void continueAsCash(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.convertPatientToCash(appo.projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res["MessageStatus"] == 1) { + getPatientShare(context, appo); + // getToDoCount(); + } else { + AppToast.showErrorToast(message: res["ErrorEndUserMessage"]); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + getPatientShare(context, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); if (appo.isLiveCareAppointment) { @@ -1119,7 +1170,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { error_type: res['Response_Message']); } }).catchError((err) { - if(mounted) GifLoaderDialogUtils.hideDialog(context); + if (mounted) GifLoaderDialogUtils.hideDialog(context); print(err); }); } diff --git a/lib/pages/insurance/UpdateInsuranceManually.dart b/lib/pages/insurance/UpdateInsuranceManually.dart index 32378aa0..d1a74d11 100644 --- a/lib/pages/insurance/UpdateInsuranceManually.dart +++ b/lib/pages/insurance/UpdateInsuranceManually.dart @@ -193,6 +193,7 @@ class _UpdateInsuranceManuallyState extends State { listData: list, selectedIndex: _selectedInsuranceCompanyIndex, isScrollable: true, + isShowSearch: true, onValueSelected: (index) { _selectedInsuranceCompanyIndex = index; selectedInsuranceCompanyObj = insuranceCompaniesList[index]; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 51471790..9fa1ac3c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1757,6 +1757,32 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future checkPatientNphiesEligibility(int projectID) async { + Map request; + request = {"ProjectID": projectID}; + dynamic localRes; + await baseAppClient.post(CHECK_PATIENT_NPHIES_ELIGIBILITY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + + Future convertPatientToCash(int projectID) async { + Map request; + request = {"ProjectID": projectID}; + dynamic localRes; + await baseAppClient.post(CONVERT_PATIENT_TO_CASH, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + Future getPayfortSDKTokenForPayment(String deviceID, String signatureValue, {bool isTest = true}) async { Map request; request = {"service_command": "SDK_TOKEN", "access_code": "BsM6He4FMBaZ86W64kjZ", "merchant_identifier": "ipxnRXXq", "language": "en", "device_id": deviceID, "signature": signatureValue}; diff --git a/lib/widgets/dialogs/confirm_dialog.dart b/lib/widgets/dialogs/confirm_dialog.dart index b677fb3e..4892d09f 100644 --- a/lib/widgets/dialogs/confirm_dialog.dart +++ b/lib/widgets/dialogs/confirm_dialog.dart @@ -14,8 +14,9 @@ class ConfirmDialog { final cancelText; final Function okFunction; final Function cancelFunction; + final isDissmissable; - ConfirmDialog({@required this.context, this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, @required this.okFunction, @required this.cancelFunction}); + ConfirmDialog({@required this.context, this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, @required this.okFunction, @required this.cancelFunction, this.isDissmissable = true}); showAlertDialog(BuildContext context) { Dialog alert = Dialog( @@ -35,6 +36,7 @@ class ConfirmDialog { // show the dialog showDialog( + barrierDismissible: isDissmissable, context: context, builder: (BuildContext context) { return alert; @@ -99,7 +101,7 @@ class Mdialog extends StatelessWidget { child: Container( decoration: containerRadius(CustomColors.lightGreyColor, 12), padding: EdgeInsets.only(top: 8,bottom: 8), - child: Center(child: Texts(cancelText)), + child: Center(child: Texts(cancelText, variant: "caption3")), ), ), ), @@ -114,6 +116,7 @@ class Mdialog extends StatelessWidget { child: Texts( okText, color: Colors.white, + variant: "caption3", ), ), ), diff --git a/lib/widgets/dialogs/radio_selection_dialog.dart b/lib/widgets/dialogs/radio_selection_dialog.dart index ffce6c29..b6380a3c 100644 --- a/lib/widgets/dialogs/radio_selection_dialog.dart +++ b/lib/widgets/dialogs/radio_selection_dialog.dart @@ -14,8 +14,9 @@ class RadioSelectionDialog extends StatefulWidget { final List listData; final int selectedIndex; final bool isScrollable; + final bool isShowSearch; - const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false}) : super(key: key); + const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false, this.isShowSearch = false}) : super(key: key); @override State createState() => new RadioSelectionDialogState(); @@ -24,10 +25,22 @@ class RadioSelectionDialog extends StatefulWidget { class RadioSelectionDialogState extends State { int selectedIndex; + List tempListData = []; + TextEditingController controller = new TextEditingController(); + @override void initState() { selectedIndex = widget.selectedIndex ?? 0; super.initState(); + addAllData(); + } + + addAllData() { + tempListData.clear(); + for (int i = 0; i < widget.listData.length; i++) { + tempListData.add(widget.listData[i]); + } + setState(() {}); } Widget build(BuildContext context) { @@ -69,6 +82,32 @@ class RadioSelectionDialogState extends State { TranslationBase.of(context).pleaseSelectFromBelowOptions, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), + widget.isShowSearch ? Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + controller: controller, + onChanged: (v) { + if (v.length > 0) { + tempListData.clear(); + for (int i = 0; i < widget.listData.length; i++) { + if (widget.listData[i].title.toLowerCase().contains(v.toLowerCase())) { + tempListData.add(widget.listData[i]); + } + } + } else { + addAllData(); + } + setState(() {}); + }, + decoration: InputDecoration( + hintStyle: TextStyle(fontSize: 17), + hintText: 'Search Insurance', + suffixIcon: Icon(Icons.search), + border: InputBorder.none, + contentPadding: EdgeInsets.all(12), + ), + ), + ) : Container(), SizedBox(height: widget.isScrollable ? 12 : 0), SizedBox( height: widget.isScrollable ? MediaQuery.of(context).size.height * .4 : null, @@ -80,7 +119,7 @@ class RadioSelectionDialogState extends State { return InkWell( onTap: () { setState(() { - selectedIndex = widget.listData[index].value; + selectedIndex = tempListData[index].value; }); }, child: Row( @@ -90,7 +129,7 @@ class RadioSelectionDialogState extends State { width: 22, height: 22, child: Radio( - value: widget.listData[index].value, + value: tempListData[index].value, groupValue: selectedIndex, onChanged: (value) { setState(() { @@ -102,7 +141,7 @@ class RadioSelectionDialogState extends State { SizedBox(width: 8), Expanded( child: Text( - widget.listData[index].title, + tempListData[index].title, // maxLines: 2, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56), ), From 965df3325370736ef24793cb96d2c1cb3441a983 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 17 Aug 2023 10:02:09 +0300 Subject: [PATCH 08/19] Appointment actions fixes --- lib/pages/MyAppointments/widgets/AppointmentActions.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 6924cb63..8068c541 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -72,7 +72,8 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { - bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); + // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); + bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); return InkWell( onTap: shouldEnable ? null From c58e180c9114e23bc31d8cb4718a97158a4321ca Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 17 Aug 2023 17:50:16 +0300 Subject: [PATCH 09/19] Updates --- lib/config/config.dart | 2 +- lib/pages/BookAppointment/BookConfirm.dart | 5 ++++- lib/pages/insurance/insurance_card_screen.dart | 13 +++++-------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 091acb7b..e93af7c8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -326,7 +326,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.7; +var VERSION_ID = 10.8; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 4214b01c..0405f657 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -278,7 +278,7 @@ class _BookConfirmState extends State { widget.service.checkPatientNphiesEligibility(docObject.projectID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["isNphiesMatchedWithVida"]) { - getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getPatientShare(context, appointmentNo, docObject.clinicID, docObject.projectID, docObject); getToDoCount(); } else { ConfirmDialog dialog = new ConfirmDialog( @@ -332,6 +332,8 @@ class _BookConfirmState extends State { Future.delayed(new Duration(milliseconds: 500), () { checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); + // getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + // getToDoCount(); }); widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { @@ -435,6 +437,7 @@ class _BookConfirmState extends State { } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { projectViewModel.selectedBodyPartList.clear(); projectViewModel.laserSelectionDuration = 0; diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index b84b63d3..0788305d 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -9,6 +9,7 @@ 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/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -53,10 +54,7 @@ class _InsuranceCardState extends State { Navigator.push(context, FadePage(page: InsuranceUpdate())); }, backgroundColor: CustomColors.accentColor, - label: Text(TranslationBase.of(context).update, style: TextStyle( - fontSize: 12.0, - fontWeight: FontWeight.bold - )), + label: Text(TranslationBase.of(context).update, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold)), ), body: Container( child: ListView.separated( @@ -176,12 +174,11 @@ class _InsuranceCardState extends State { if (model.insurance[index].isActive == true) Container( color: Colors.transparent, - child: SecondaryButton( - onTap: () => { + child: DefaultButton( + TranslationBase.of(context).seeDetails, + () => { getDetails(model.insurance[index]), }, - label: TranslationBase.of(context).seeDetails, - textColor: Colors.white, ), width: double.infinity, ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 2bf8d454f56f7f6713a81e262644d4212bfff179 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Aug 2023 09:33:06 +0300 Subject: [PATCH 10/19] updates --- lib/pages/insurance/insurance_card_update_details.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index 71637051..3fb1c19d 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -53,8 +53,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { // height: projectViewModel.isArabic ? 320 : 240, // decoration: containerRadius(CustomColors.accentColor, 12), child: Container( - decoration: cardRadius(12,color: CustomColors.accentColor), - + decoration: cardRadius(12, color: CustomColors.accentColor), child: Padding( padding: const EdgeInsets.all(12.0), child: Column( @@ -229,7 +228,6 @@ class InsuranceCardUpdateDetails extends StatelessWidget { children: [ Container( child: Container( - decoration: cardRadius(12), child: Container( width: MediaQuery.of(context).size.width, @@ -324,7 +322,6 @@ class InsuranceCardUpdateDetails extends StatelessWidget { AppToast.showErrorToast(message: err.toString()); print(err); }); - }, ), if (insuranceCardDetailsModel.isNotEmpty) From 7702960bb56e1e89079dd15bf7f814b39223aaff Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 21 Aug 2023 13:04:39 +0300 Subject: [PATCH 11/19] InPatient medical report & view medical report commented out --- .../medical/reports_view_model.dart | 2 +- .../medical/reports/report_home_page.dart | 349 +++++++++--------- .../medical/reports/report_list_widget.dart | 34 +- 3 files changed, 194 insertions(+), 191 deletions(-) diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart index 8f55b3b7..7fb4cf93 100644 --- a/lib/core/viewModels/medical/reports_view_model.dart +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -37,7 +37,7 @@ class ReportsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _filterList(); - await _reportsService.getInpatientAdmissionsList(); + // await _reportsService.getInpatientAdmissionsList(); setState(ViewState.Idle); } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 3a902332..a520b956 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -28,20 +28,20 @@ class HomeReportPage extends StatefulWidget { } class _HomeReportPageState extends State with SingleTickerProviderStateMixin { - TabController _tabController_new; + // TabController _tabController_new; List imagesInfo = List(); int _currentPage = 0; @override void initState() { - _tabController_new = TabController(length: 2, vsync: this); + // _tabController_new = TabController(length: 2, vsync: this); super.initState(); } @override void dispose() { super.dispose(); - _tabController_new.dispose(); + // _tabController_new.dispose(); } @override @@ -70,182 +70,185 @@ class _HomeReportPageState extends State with SingleTickerProvid body: Container( child: Column( children: [ - TabBar( - controller: _tabController_new, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Color(0xff2B353E), - unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - labelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - unselectedLabelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - onTap: (int value) { - print(value); - setState(() {}); - }, - tabs: [ - Text( - TranslationBase.of(context).outpatient, - style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - ), - Text( - TranslationBase.of(context).inPatient, - style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - ), - ], - ), + // TabBar( + // controller: _tabController_new, + // indicatorWeight: 3.0, + // indicatorSize: TabBarIndicatorSize.tab, + // labelColor: Color(0xff2B353E), + // unselectedLabelColor: Color(0xff575757), + // labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + // labelStyle: TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.48, + // ), + // unselectedLabelStyle: TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.48, + // ), + // onTap: (int value) { + // print(value); + // setState(() {}); + // }, + // tabs: [ + // Text( + // TranslationBase.of(context).outpatient, + // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + // ), + // Text( + // TranslationBase.of(context).inPatient, + // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + // ), + // ], + // ), if (model.user != null) Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController_new, - children: [ + child: + // TabBarView( + // physics: BouncingScrollPhysics(), + // controller: _tabController_new, + // children: [ Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(21), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - myRadioButton(TranslationBase.of(context).requested, 0), - myRadioButton(TranslationBase.of(context).ready, 1), - myRadioButton(TranslationBase.of(context).cancelled, 2), - ], - ), - ), - Expanded( - child: IndexedStack( - index: _currentPage, - children: [ - ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), - ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), - ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), - ], - ), - ) - ], + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(21), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + myRadioButton(TranslationBase.of(context).requested, 0), + myRadioButton(TranslationBase.of(context).ready, 1), + myRadioButton(TranslationBase.of(context).cancelled, 2), + ], + ), ), - ), - // InPatient Medical Reports - Container( - child: model.admissionsMedicalReportList.isNotEmpty - ? Column( - children: [ - Padding( - padding: const EdgeInsets.all(16.0), - child: Text( - TranslationBase.of(context).selectAdmissionText, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - ), - ListView.separated( - physics: BouncingScrollPhysics(), - shrinkWrap: true, - padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12), - itemBuilder: (context, index) { - AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index]; - return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: InPatientMedicalReports( - admissionMedicalReport: admissionMedicalReport, - ))); - }, - child: Container( - // height: 100.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), - Text(admissionMedicalReport.projectName, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), - ], - ), - ], - ), - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - if (admissionMedicalReport.clinicName != null) - MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - MyRichText( - TranslationBase.of(context).status + ":", - projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription, - projectViewModel.isArabic), - Icon( - Icons.arrow_forward, - color: Theme.of(context).primaryColor, - ) - ], - ), - ], - ), - ), - ], - ) - ], - ), - ), - ), - ); - }, - separatorBuilder: (context, index) => SizedBox( - height: 16.0, - ), - itemCount: model.admissionsMedicalReportList.length), - ], - ) - : getNoDataWidget(context), - ) - ], + Expanded( + child: IndexedStack( + index: _currentPage, + children: [ + ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), + ], + ), + ) + ], + ), ), + // InPatient Medical Reports + // Container( + // child: model.admissionsMedicalReportList.isNotEmpty + // ? Column( + // children: [ + // Padding( + // padding: const EdgeInsets.all(16.0), + // child: Text( + // TranslationBase.of(context).selectAdmissionText, + // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + // ), + // ), + // ListView.separated( + // physics: BouncingScrollPhysics(), + // shrinkWrap: true, + // padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12), + // itemBuilder: (context, index) { + // AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index]; + // return InkWell( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: InPatientMedicalReports( + // admissionMedicalReport: admissionMedicalReport, + // ))); + // }, + // child: Container( + // // height: 100.0, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(10.0), + // ), + // boxShadow: [ + // BoxShadow( + // color: Color(0xff000000).withOpacity(.05), + // blurRadius: 27, + // offset: Offset(0, -3), + // ), + // ], + // color: Colors.white), + // child: Padding( + // padding: const EdgeInsets.all(12.0), + // child: Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Text( + // TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj, + // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)), + // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + // Text(admissionMedicalReport.projectName, + // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + // ], + // ), + // ], + // ), + // Row( + // children: [ + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // if (admissionMedicalReport.clinicName != null) + // MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // MyRichText( + // TranslationBase.of(context).status + ":", + // projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription, + // projectViewModel.isArabic), + // Icon( + // Icons.arrow_forward, + // color: Theme.of(context).primaryColor, + // ) + // ], + // ), + // ], + // ), + // ), + // ], + // ) + // ], + // ), + // ), + // ), + // ); + // }, + // separatorBuilder: (context, index) => SizedBox( + // height: 16.0, + // ), + // itemCount: model.admissionsMedicalReportList.length), + // ], + // ) + // : getNoDataWidget(context), + // ) + // ], + // ), ), - if (projectViewModel.havePrivilege(21) && _tabController_new.index == 0) + if (projectViewModel.havePrivilege(21) + // && _tabController_new.index == 0 + ) Padding( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 016fad79..b8b457de 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget { if (reportList[index].status == 2) Row( children: [ - InkWell( - onTap: () { - getMedicalReportPDF(report); - }, - child: Padding( - padding: const EdgeInsets.only(right: 11.0, left: 11.0), - child: Text(TranslationBase.of(context).viewReport, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.italic, - color: CustomColors.accentColor, - letterSpacing: -0.48, - height: 18 / 12, - decoration: TextDecoration.underline)), - ), - ), + // InkWell( + // onTap: () { + // getMedicalReportPDF(report); + // }, + // child: Padding( + // padding: const EdgeInsets.only(right: 11.0, left: 11.0), + // child: Text(TranslationBase.of(context).viewReport, + // style: TextStyle( + // fontSize: 12, + // fontWeight: FontWeight.w600, + // fontStyle: FontStyle.italic, + // color: CustomColors.accentColor, + // letterSpacing: -0.48, + // height: 18 / 12, + // decoration: TextDecoration.underline)), + // ), + // ), IconButton( icon: Icon(Icons.email), color: Color(0xff28323A), From e64a91855f60e715bb729849876b2c53a651f067 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 21 Aug 2023 16:41:38 +0300 Subject: [PATCH 12/19] fixes --- lib/pages/medical/reports/reports_page.dart | 4 +- .../dialogs/radio_selection_dialog.dart | 231 +++++++++--------- 2 files changed, 121 insertions(+), 114 deletions(-) diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index bdd638e5..0dfa2ac9 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -24,7 +24,9 @@ class MedicalReports extends StatelessWidget { message: TranslationBase.of(context).confirmMsgReport, onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), ), - ); + ).then((value) { + Navigator.pop(context); + }); return; } diff --git a/lib/widgets/dialogs/radio_selection_dialog.dart b/lib/widgets/dialogs/radio_selection_dialog.dart index b6380a3c..dc460009 100644 --- a/lib/widgets/dialogs/radio_selection_dialog.dart +++ b/lib/widgets/dialogs/radio_selection_dialog.dart @@ -50,126 +50,131 @@ class RadioSelectionDialogState extends State { insetPadding: EdgeInsets.only(left: 21, right: 21), child: Padding( padding: EdgeInsets.only(left: 20, right: 20, top: 18, bottom: 28), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.only(top: 16.0), - child: Text( - TranslationBase.of(context).select, - style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.only(top: 16.0), + child: Text( + TranslationBase.of(context).select, + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96), + ), ), ), - ), - IconButton( - padding: EdgeInsets.zero, - icon: Icon(Icons.close), - color: Color(0xff2B353E), - constraints: BoxConstraints(), - onPressed: () { - Navigator.pop(context); - }, - ) - ], - ), - SizedBox(height: 21), - Text( - TranslationBase.of(context).pleaseSelectFromBelowOptions, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), - ), - widget.isShowSearch ? Padding( - padding: const EdgeInsets.all(8.0), - child: TextField( - controller: controller, - onChanged: (v) { - if (v.length > 0) { - tempListData.clear(); - for (int i = 0; i < widget.listData.length; i++) { - if (widget.listData[i].title.toLowerCase().contains(v.toLowerCase())) { - tempListData.add(widget.listData[i]); - } - } - } else { - addAllData(); - } - setState(() {}); - }, - decoration: InputDecoration( - hintStyle: TextStyle(fontSize: 17), - hintText: 'Search Insurance', - suffixIcon: Icon(Icons.search), - border: InputBorder.none, - contentPadding: EdgeInsets.all(12), - ), + IconButton( + padding: EdgeInsets.zero, + icon: Icon(Icons.close), + color: Color(0xff2B353E), + constraints: BoxConstraints(), + onPressed: () { + Navigator.pop(context); + }, + ) + ], ), - ) : Container(), - SizedBox(height: widget.isScrollable ? 12 : 0), - SizedBox( - height: widget.isScrollable ? MediaQuery.of(context).size.height * .4 : null, - child: ListView.separated( - physics: widget.isScrollable ? BouncingScrollPhysics() : NeverScrollableScrollPhysics(), - shrinkWrap: !widget.isScrollable, - padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10), - itemBuilder: (context, index) { - return InkWell( - onTap: () { - setState(() { - selectedIndex = tempListData[index].value; - }); - }, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - width: 22, - height: 22, - child: Radio( - value: tempListData[index].value, - groupValue: selectedIndex, - onChanged: (value) { - setState(() { - selectedIndex = value; - }); - }, + SizedBox(height: 21), + Text( + TranslationBase.of(context).pleaseSelectFromBelowOptions, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + ), + widget.isShowSearch + ? Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + controller: controller, + onChanged: (v) { + if (v.length > 0) { + tempListData.clear(); + for (int i = 0; i < widget.listData.length; i++) { + if (widget.listData[i].title.toLowerCase().contains(v.toLowerCase())) { + tempListData.add(widget.listData[i]); + } + } + } else { + addAllData(); + } + setState(() {}); + }, + decoration: InputDecoration( + hintStyle: TextStyle(fontSize: 17), + hintText: 'Search Insurance', + suffixIcon: Icon(Icons.search), + border: InputBorder.none, + contentPadding: EdgeInsets.all(12), + ), + ), + ) + : Container(), + SizedBox(height: widget.isScrollable ? 12 : 0), + SizedBox( + height: widget.isScrollable ? MediaQuery.of(context).size.height * .4 : null, + child: ListView.separated( + physics: widget.isScrollable ? BouncingScrollPhysics() : NeverScrollableScrollPhysics(), + // shrinkWrap: !widget.isScrollable, + shrinkWrap: !widget.isScrollable, + padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10), + itemBuilder: (context, index) { + return InkWell( + onTap: () { + setState(() { + selectedIndex = tempListData[index].value; + }); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: 22, + height: 22, + child: Radio( + value: tempListData[index].value, + groupValue: selectedIndex, + onChanged: (value) { + setState(() { + selectedIndex = value; + }); + }, + ), ), - ), - SizedBox(width: 8), - Expanded( - child: Text( - tempListData[index].title, - // maxLines: 2, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56), + SizedBox(width: 8), + Expanded( + child: Text( + tempListData[index].title, + // maxLines: 2, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56), + ), ), - ), - ], - ), - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 10), - itemCount: widget.listData.length), - ), - SizedBox(height: widget.isScrollable ? 12 : 0), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).save, - () { - Navigator.pop(context); - widget.onValueSelected(selectedIndex); + ], + ), + ); }, - color: Color(0xff349745), + separatorBuilder: (context, index) => SizedBox(height: 10), + itemCount: tempListData.length), + ), + SizedBox(height: widget.isScrollable ? 12 : 0), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).save, + () { + Navigator.pop(context); + widget.onValueSelected(selectedIndex); + }, + color: Color(0xff349745), + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), ); From 75685b1f614d7870bb18dc938a0cf7ca3ae1faec Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 22 Aug 2023 11:19:42 +0300 Subject: [PATCH 13/19] Project selection added in Laser & advance payment --- lib/core/service/hospital_service.dart | 3 ++- .../medical/my_balance_view_model.dart | 4 ++-- .../ancillaryOrdersDetails.dart | 11 +++++++++++ .../components/SearchByClinic.dart | 17 ++++++++++------- .../medical/balance/advance_payment_page.dart | 6 +++--- lib/pages/medical/patient_sick_leave_page.dart | 13 +++++++++---- 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index 321d2d09..be0024ab 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -51,12 +51,13 @@ class HospitalService extends BaseService { } } - Future getHospitals({bool isResBasedOnLoc = true}) async { + Future getHospitals({bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async { if (isResBasedOnLoc) await _getCurrentLocation(); Map body = Map(); body['Latitude'] = await this.sharedPref.getDouble(USER_LAT); body['Longitude'] = await this.sharedPref.getDouble(USER_LONG); body['IsOnlineCheckIn'] = isResBasedOnLoc; + body['IsAdvancePayment'] = isAdvancePayment; await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { _hospitals.clear(); diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index e12e2b07..4166a4b3 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -70,9 +70,9 @@ class MyBalanceViewModel extends BaseViewModel { } } - Future getHospitals() async { + Future getHospitals({bool isAdvancePayment = false}) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(); + await _hospitalService.getHospitals(isAdvancePayment: isAdvancePayment); if (_hospitalService.hasError) { error = _hospitalService.error; setState(ViewState.Error); diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 1dd34876..da5ce04a 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -57,6 +57,16 @@ class _AnicllaryOrdersState extends State with SingleTic super.dispose(); } + void getAncillaryOrderDetails(AnciallryOrdersViewModel model) { + GifLoaderDialogUtils.showMyDialog(context); + model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { + addToSelectedProcedures(model); + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + }); + } + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -64,6 +74,7 @@ class _AnicllaryOrdersState extends State with SingleTic AppGlobal.context = context; return BaseView( onModelReady: (model) { + // getAncillaryOrderDetails(model); model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { addToSelectedProcedures(model); }); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 891d01cb..2d5d514d 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -240,11 +240,10 @@ class _SearchByClinicState extends State { dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); if (dropdownValue == "253-false-0-0") { - Navigator.push(context, FadePage(page: LaserClinic())); + // Navigator.push(context, FadePage(page: LaserClinic())); } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; - if(!nearestAppo) - getDoctorsList(context); + if (!nearestAppo) getDoctorsList(context); } else {} }); projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); @@ -333,7 +332,11 @@ class _SearchByClinicState extends State { setState(() { selectedHospital = newValue; projectDropdownValue = newValue.mainProjectID.toString(); - getDoctorsList(context); + if (dropdownValue.split("-")[0] == "253") { + Navigator.push(context, FadePage(page: LaserClinic())); + } else { + getDoctorsList(context); + } }); }, ), @@ -458,7 +461,7 @@ class _SearchByClinicState extends State { bool isDentalSelectedAndSupported() { if (dropdownValue != null) - return dropdownValue != "" && (dropdownValue.split("-")[0] == "17") && isMobileAppDentalAllow; + return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow; else return false; } @@ -531,8 +534,8 @@ class _SearchByClinicState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - if(projectViewModel.isLogin) { - if(projectViewModel.user.age > 12) { + if (projectViewModel.isLogin) { + if (projectViewModel.user.age > 12) { navigateToDentalComplaints(context, searchInfo); } else { callDoctorsSearchAPI(17); diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index b555a1bf..a07944f1 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -67,7 +67,7 @@ class _AdvancePaymentPageState extends State { projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { - model.getHospitals(); + model.getHospitals(isAdvancePayment: true); model.getFamilyFiles(); }, builder: (_, model, w) => AppScaffold( @@ -315,7 +315,6 @@ class _AdvancePaymentPageState extends State { advanceModel.patientName = patientName; GifLoaderDialogUtils.showMyDialog(context); - model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) { GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { @@ -327,7 +326,8 @@ class _AdvancePaymentPageState extends State { onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { setState(() {}); }, - isShowInstallments: false, isFromAdvancePayment: true), + isShowInstallments: false, + isFromAdvancePayment: true), ), ).then( (value) { diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index a82ff6b3..479b5fe6 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -131,11 +131,16 @@ class _PatientSickLeavePageState extends State { GifLoaderDialogUtils.showMyDialog(context); service.getSickLeaveStatusByAdmissionNo(model.sickLeaveList[index].projectID, model.sickLeaveList[index].admissionNo).then((res) { + print(res); GifLoaderDialogUtils.hideDialog(context); - if (res["List_GetSickLeaveStatusByAdmissionNo"].length != 0) { - admissionStatusForSickLeave = AdmissionStatusForSickLeave.fromJson(res["List_GetSickLeaveStatusByAdmissionNo"][0]); - if (admissionStatusForSickLeave.status != 6) { - AppToast.showErrorToast(message: TranslationBase.of(context).sickLeaveAdmittedPatient); + if (res != null && res["List_GetSickLeaveStatusByAdmissionNo"] != null) { + if (res["List_GetSickLeaveStatusByAdmissionNo"].length != 0) { + admissionStatusForSickLeave = AdmissionStatusForSickLeave.fromJson(res["List_GetSickLeaveStatusByAdmissionNo"][0]); + if (admissionStatusForSickLeave.status != 6) { + AppToast.showErrorToast(message: TranslationBase.of(context).sickLeaveAdmittedPatient); + } else { + openWorkPlaceUpdatePageFunc(requestNumber, setupID, model, index, projectID); + } } else { openWorkPlaceUpdatePageFunc(requestNumber, setupID, model, index, projectID); } From 6b121e7f395470ad418e026f381b41c950df9501 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 22 Aug 2023 15:28:38 +0300 Subject: [PATCH 14/19] Store build version 4.5.026 --- lib/config/config.dart | 4 ++-- lib/pages/BookAppointment/components/SearchByClinic.dart | 6 ++++-- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- pubspec.yaml | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e93af7c8..5c9912e4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; -var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 2d5d514d..8dbfe320 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -240,7 +240,7 @@ class _SearchByClinicState extends State { dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); if (dropdownValue == "253-false-0-0") { - // Navigator.push(context, FadePage(page: LaserClinic())); + Navigator.push(context, FadePage(page: LaserClinic())); } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; if (!nearestAppo) getDoctorsList(context); @@ -461,7 +461,9 @@ class _SearchByClinicState extends State { bool isDentalSelectedAndSupported() { if (dropdownValue != null) - return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow; + return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" + // || dropdownValue.split("-")[0] == "253" + ) && isMobileAppDentalAllow; else return false; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index c7bbbdf2..1170b282 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.024+4050024 +version: 4.5.026+4050026 environment: sdk: ">=2.7.0 <3.0.0" @@ -218,7 +218,7 @@ dependencies: dependency_overrides: provider: ^5.0.0 # permission_handler : ^10.2.0 - flutter_svg: ^1.0.0 + flutter_svg: ^1.1.6 # firebase_messaging_platform_interface: any # flutter_inappwebview: 5.7.2+3 # git: From fb9a4d52972350d09c48d00ddc6b798d55182036 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 24 Aug 2023 10:36:07 +0300 Subject: [PATCH 15/19] Laser clinic changes --- lib/pages/BookAppointment/components/LaserClinic.dart | 7 +++++-- lib/pages/BookAppointment/components/SearchByClinic.dart | 8 +++----- lib/services/appointment_services/GetDoctorsList.dart | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index 04db5bed..918ca9ad 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -1,5 +1,6 @@ import 'dart:collection'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; @@ -17,7 +18,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LaserClinic extends StatefulWidget { - LaserClinic({Key key}) : super(key: key); + HospitalsModel selectedHospital; + + LaserClinic({this.selectedHospital}); @override _LaserClinicState createState() { @@ -66,7 +69,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getLaserBodyPartsList(laserCategoryId).then((res) { + service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 8dbfe320..dc126e78 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -240,7 +240,7 @@ class _SearchByClinicState extends State { dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); if (dropdownValue == "253-false-0-0") { - Navigator.push(context, FadePage(page: LaserClinic())); + // Navigator.push(context, FadePage(page: LaserClinic())); } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; if (!nearestAppo) getDoctorsList(context); @@ -333,7 +333,7 @@ class _SearchByClinicState extends State { selectedHospital = newValue; projectDropdownValue = newValue.mainProjectID.toString(); if (dropdownValue.split("-")[0] == "253") { - Navigator.push(context, FadePage(page: LaserClinic())); + Navigator.push(context, FadePage(page: LaserClinic(selectedHospital: selectedHospital))); } else { getDoctorsList(context); } @@ -461,9 +461,7 @@ class _SearchByClinicState extends State { bool isDentalSelectedAndSupported() { if (dropdownValue != null) - return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" - // || dropdownValue.split("-")[0] == "253" - ) && isMobileAppDentalAllow; + return dropdownValue != "" && (dropdownValue.split("-")[0] == "17" || dropdownValue.split("-")[0] == "253") && isMobileAppDentalAllow; else return false; } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 9fa1ac3c..7d97239c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1612,11 +1612,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLaserBodyPartsList(int laserCategoryID) async { + Future getLaserBodyPartsList(int laserCategoryID, int projectID) async { Map request; request = { "LaserCategoryID": laserCategoryID, + "ProjectID": projectID, }; dynamic localRes; await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async { From 66600fe66c688e8bdf5526ae049c335402f1ba35 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 24 Aug 2023 10:43:34 +0300 Subject: [PATCH 16/19] Medical report CR implemented --- .../medical/reports_view_model.dart | 2 +- .../medical/reports/report_home_page.dart | 294 +++++++++--------- .../medical/reports/report_list_widget.dart | 34 +- 3 files changed, 165 insertions(+), 165 deletions(-) diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart index 7fb4cf93..8f55b3b7 100644 --- a/lib/core/viewModels/medical/reports_view_model.dart +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -37,7 +37,7 @@ class ReportsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _filterList(); - // await _reportsService.getInpatientAdmissionsList(); + await _reportsService.getInpatientAdmissionsList(); setState(ViewState.Idle); } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index a520b956..7cc8fc2b 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -28,20 +28,20 @@ class HomeReportPage extends StatefulWidget { } class _HomeReportPageState extends State with SingleTickerProviderStateMixin { - // TabController _tabController_new; + TabController _tabController_new; List imagesInfo = List(); int _currentPage = 0; @override void initState() { - // _tabController_new = TabController(length: 2, vsync: this); + _tabController_new = TabController(length: 2, vsync: this); super.initState(); } @override void dispose() { super.dispose(); - // _tabController_new.dispose(); + _tabController_new.dispose(); } @override @@ -70,45 +70,45 @@ class _HomeReportPageState extends State with SingleTickerProvid body: Container( child: Column( children: [ - // TabBar( - // controller: _tabController_new, - // indicatorWeight: 3.0, - // indicatorSize: TabBarIndicatorSize.tab, - // labelColor: Color(0xff2B353E), - // unselectedLabelColor: Color(0xff575757), - // labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - // labelStyle: TextStyle( - // fontSize: 16, - // fontWeight: FontWeight.w600, - // letterSpacing: -0.48, - // ), - // unselectedLabelStyle: TextStyle( - // fontSize: 16, - // fontWeight: FontWeight.w600, - // letterSpacing: -0.48, - // ), - // onTap: (int value) { - // print(value); - // setState(() {}); - // }, - // tabs: [ - // Text( - // TranslationBase.of(context).outpatient, - // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - // ), - // Text( - // TranslationBase.of(context).inPatient, - // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - // ), - // ], - // ), + TabBar( + controller: _tabController_new, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + onTap: (int value) { + print(value); + setState(() {}); + }, + tabs: [ + Text( + TranslationBase.of(context).outpatient, + style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + ), + Text( + TranslationBase.of(context).inPatient, + style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + ), + ], + ), if (model.user != null) Expanded( child: - // TabBarView( - // physics: BouncingScrollPhysics(), - // controller: _tabController_new, - // children: [ + TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController_new, + children: [ Container( child: Column( children: [ @@ -137,114 +137,114 @@ class _HomeReportPageState extends State with SingleTickerProvid ), ), // InPatient Medical Reports - // Container( - // child: model.admissionsMedicalReportList.isNotEmpty - // ? Column( - // children: [ - // Padding( - // padding: const EdgeInsets.all(16.0), - // child: Text( - // TranslationBase.of(context).selectAdmissionText, - // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - // ), - // ), - // ListView.separated( - // physics: BouncingScrollPhysics(), - // shrinkWrap: true, - // padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12), - // itemBuilder: (context, index) { - // AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index]; - // return InkWell( - // onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: InPatientMedicalReports( - // admissionMedicalReport: admissionMedicalReport, - // ))); - // }, - // child: Container( - // // height: 100.0, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(10.0), - // ), - // boxShadow: [ - // BoxShadow( - // color: Color(0xff000000).withOpacity(.05), - // blurRadius: 27, - // offset: Offset(0, -3), - // ), - // ], - // color: Colors.white), - // child: Padding( - // padding: const EdgeInsets.all(12.0), - // child: Column( - // mainAxisSize: MainAxisSize.min, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Text( - // TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj, - // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - // ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.end, - // children: [ - // Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)), - // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), - // Text(admissionMedicalReport.projectName, - // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), - // ], - // ), - // ], - // ), - // Row( - // children: [ - // Expanded( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // if (admissionMedicalReport.clinicName != null) - // MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // MyRichText( - // TranslationBase.of(context).status + ":", - // projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription, - // projectViewModel.isArabic), - // Icon( - // Icons.arrow_forward, - // color: Theme.of(context).primaryColor, - // ) - // ], - // ), - // ], - // ), - // ), - // ], - // ) - // ], - // ), - // ), - // ), - // ); - // }, - // separatorBuilder: (context, index) => SizedBox( - // height: 16.0, - // ), - // itemCount: model.admissionsMedicalReportList.length), - // ], - // ) - // : getNoDataWidget(context), - // ) - // ], - // ), + Container( + child: model.admissionsMedicalReportList.isNotEmpty + ? Column( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + TranslationBase.of(context).selectAdmissionText, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + ), + ListView.separated( + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12), + itemBuilder: (context, index) { + AdmissionMedicalReport admissionMedicalReport = model.admissionsMedicalReportList[index]; + return InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: InPatientMedicalReports( + admissionMedicalReport: admissionMedicalReport, + ))); + }, + child: Container( + // height: 100.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + Text(admissionMedicalReport.projectName, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), + ], + ), + ], + ), + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (admissionMedicalReport.clinicName != null) + MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + MyRichText( + TranslationBase.of(context).status + ":", + projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription, + projectViewModel.isArabic), + Icon( + Icons.arrow_forward, + color: Theme.of(context).primaryColor, + ) + ], + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }, + separatorBuilder: (context, index) => SizedBox( + height: 16.0, + ), + itemCount: model.admissionsMedicalReportList.length), + ], + ) + : getNoDataWidget(context), + ) + ], + ), ), if (projectViewModel.havePrivilege(21) // && _tabController_new.index == 0 diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index b8b457de..016fad79 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget { if (reportList[index].status == 2) Row( children: [ - // InkWell( - // onTap: () { - // getMedicalReportPDF(report); - // }, - // child: Padding( - // padding: const EdgeInsets.only(right: 11.0, left: 11.0), - // child: Text(TranslationBase.of(context).viewReport, - // style: TextStyle( - // fontSize: 12, - // fontWeight: FontWeight.w600, - // fontStyle: FontStyle.italic, - // color: CustomColors.accentColor, - // letterSpacing: -0.48, - // height: 18 / 12, - // decoration: TextDecoration.underline)), - // ), - // ), + InkWell( + onTap: () { + getMedicalReportPDF(report); + }, + child: Padding( + padding: const EdgeInsets.only(right: 11.0, left: 11.0), + child: Text(TranslationBase.of(context).viewReport, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.italic, + color: CustomColors.accentColor, + letterSpacing: -0.48, + height: 18 / 12, + decoration: TextDecoration.underline)), + ), + ), IconButton( icon: Icon(Icons.email), color: Color(0xff28323A), From 5ddf8d4b7ae7da371739f1c6f563ca5270a69a65 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 27 Aug 2023 10:19:50 +0300 Subject: [PATCH 17/19] View Dr response fix --- lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart index 2e930330..c73b0fd6 100644 --- a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart +++ b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart @@ -210,7 +210,7 @@ class _ViewDoctorResponsesPageState extends State { child: DefaultButton( TranslationBase.of(context).submit, () { - if (textController.text.isEmpty) { + if (rate == 0 && textController.text.isEmpty) { AppToast.showErrorToast(message: "Please enter comments"); } else { rateDoctorResponse(); From 0f863cd2593299f3a064c90b33c33bcf19b12d94 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 28 Aug 2023 11:11:46 +0300 Subject: [PATCH 18/19] Updates & fixes --- lib/config/config.dart | 4 +- .../insuranceManualUpdateRequest.dart | 28 ++-- lib/core/service/client/base_app_client.dart | 2 +- .../AttachInsuranceCardImageDialog.dart | 15 +- .../insurance/UpdateInsuranceManually.dart | 16 +- .../insurance_card_update_details.dart | 13 +- lib/pages/insurance/insurance_page.dart | 149 ++++++++++-------- .../insurance/insurance_update_screen.dart | 7 +- .../medical/ask_doctor/request_type.dart | 2 +- .../medical/reports/report_list_widget.dart | 4 +- pubspec.yaml | 3 +- 11 files changed, 148 insertions(+), 95 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c9912e4..e93af7c8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; diff --git a/lib/core/model/insurance/insuranceManualUpdateRequest.dart b/lib/core/model/insurance/insuranceManualUpdateRequest.dart index 13fee506..5eb8ebb9 100644 --- a/lib/core/model/insurance/insuranceManualUpdateRequest.dart +++ b/lib/core/model/insurance/insuranceManualUpdateRequest.dart @@ -12,21 +12,23 @@ class InsuranceManualUpdateRequest { String policyNo; String schemeClass; int requestType; + int patientID; InsuranceManualUpdateRequest( {this.setupID, - this.patientIdentificationID, - this.projectID, - this.mobileNo, - this.activityId, - this.component, - this.enableLogging, - this.insuranceCompanyName, - this.cardHolderName, - this.memberShipNo, - this.policyNo, - this.schemeClass, - this.requestType}); + this.patientIdentificationID, + this.projectID, + this.mobileNo, + this.activityId, + this.component, + this.enableLogging, + this.insuranceCompanyName, + this.cardHolderName, + this.memberShipNo, + this.policyNo, + this.schemeClass, + this.requestType, + this.patientID}); InsuranceManualUpdateRequest.fromJson(Map json) { setupID = json['SetupID']; @@ -42,6 +44,7 @@ class InsuranceManualUpdateRequest { policyNo = json['PolicyNo']; schemeClass = json['SchemeClass']; requestType = json['RequestType']; + patientID = json['PatientID']; } Map toJson() { @@ -59,6 +62,7 @@ class InsuranceManualUpdateRequest { data['PolicyNo'] = this.policyNo; data['SchemeClass'] = this.schemeClass; data['RequestType'] = this.requestType; + data['PatientID'] = this.patientID; return data; } } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 9cb81a41..fb3c900a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -149,7 +149,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 2001273; //3844083 + // body['PatientID'] = 4767370; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index e7d57363..c331da2a 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -13,9 +13,11 @@ import 'package:flutter/material.dart'; class AttachInsuranceCardImageDialog extends StatefulWidget { final String name; final String fileNo; + final String identificationNo; + final String mobileNo; final Function(File file, String image) image; - const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.image}) : super(key: key); + const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.identificationNo, this.mobileNo, this.image}) : super(key: key); @override _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState(); @@ -134,7 +136,16 @@ class _AttachInsuranceCardImageDialogState extends State createState() => _UpdateInsuranceManuallyState(); @@ -51,7 +55,7 @@ class _UpdateInsuranceManuallyState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - _nationalIDTextController.text = projectViewModel.user.patientIdentificationNo; + _nationalIDTextController.text = widget.patientIdentificationNo; return AppScaffold( isShowAppBar: true, isShowDecPage: false, @@ -160,7 +164,7 @@ class _UpdateInsuranceManuallyState extends State { child: DefaultButton( TranslationBase.of(context).submit, () { - if(isFormValid()) + if (isFormValid()) submitManualInsuranceUpdateRequest(); else AppToast.showErrorToast(message: TranslationBase.of(context).enterInsuranceDetails); @@ -240,16 +244,18 @@ class _UpdateInsuranceManuallyState extends State { insuranceManualUpdateRequest.projectID = selectedInsuranceCompanyObj.projectID; insuranceManualUpdateRequest.requestType = 2; - insuranceManualUpdateRequest.mobileNo = projectViewModel.user.mobileNumber; + insuranceManualUpdateRequest.mobileNo = widget.patientMobileNumber; insuranceManualUpdateRequest.cardHolderName = _cardHolderNameTextController.text; insuranceManualUpdateRequest.insuranceCompanyName = selectedInsuranceCompanyObj.companyName; insuranceManualUpdateRequest.memberShipNo = _membershipNoTextController.text; insuranceManualUpdateRequest.policyNo = _policyNoTextController.text; - insuranceManualUpdateRequest.patientIdentificationID = projectViewModel.user.patientIdentificationNo; + insuranceManualUpdateRequest.patientIdentificationID = widget.patientIdentificationNo; insuranceManualUpdateRequest.schemeClass = selectedInsuranceCompaniesSchemesObj.subCategoryDesc; insuranceManualUpdateRequest.setupID = selectedInsuranceCompanyObj.setupID; + insuranceManualUpdateRequest.patientID = widget.patientID; _insuranceCardService.submitManualInsuranceUpdateRequest(insuranceManualUpdateRequest).then((value) { + print(value); AppToast.showSuccessToast(message: TranslationBase.of(context).insuranceRequestSubmit); Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index 3fb1c19d..2f0cc5a5 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -22,8 +22,9 @@ class InsuranceCardUpdateDetails extends StatelessWidget { final String patientIdentificationID; final int patientID; final String name; + final String mobileNo; - const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name}) : super(key: key); + const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name, this.mobileNo}) : super(key: key); @override Widget build(BuildContext context) { @@ -304,7 +305,8 @@ class InsuranceCardUpdateDetails extends StatelessWidget { color: CustomColors.accentColor, small: true, onTap: () async { - confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); + confirmAttachInsuranceCardImageDialogDialog( + context: context, name: name, fileNo: patientID.toString(), identificationNo: patientIdentificationID, mobileNo: mobileNo, model: model); }, ), if (insuranceCardDetailsModel.isNotEmpty) @@ -334,7 +336,8 @@ class InsuranceCardUpdateDetails extends StatelessWidget { label: TranslationBase.of(context).disagree.toUpperCase(), color: Colors.grey[800], onTap: () async { - confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model); + confirmAttachInsuranceCardImageDialogDialog( + context: context, name: name, fileNo: patientID.toString(), identificationNo: patientIdentificationID, mobileNo: mobileNo, model: model); }, ) ], @@ -346,12 +349,14 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ); } - void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) { + void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, String identificationNo, String mobileNo, InsuranceViewModel model}) { showDialog( context: context, builder: (cxt) => AttachInsuranceCardImageDialog( fileNo: fileNo, name: name, + identificationNo: identificationNo, + mobileNo: mobileNo, image: (file, image) async { GifLoaderDialogUtils.showMyDialog(context); await model.uploadInsuranceCard(context, patientIdentificationID: patientIdentificationID, patientID: patientID, image: image); diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index 324c9fa1..f8b2da65 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/insurance/UpdateInsuranceManually.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../../locator.dart'; import '../../widgets/dialogs/confirm_dialog.dart'; @@ -18,8 +20,11 @@ class InsurancePage extends StatelessWidget { InsurancePage({Key key, this.model}) : super(key: key); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(12.0), @@ -36,11 +41,16 @@ class InsurancePage extends StatelessWidget { getDetails( setupID: '010266', projectID: 15, - patientIdentificationID: model.user.patientIdentificationNo, - patientID: model.user.patientID, + patientIdentificationID: projectViewModel.user.patientIdentificationNo, + //model.user.patientIdentificationNo, + patientID: projectViewModel.user.patientID, + //model.user.patientID, parentID: 0, - isFamily: false, - name: model.user.firstName + " " + model.user.lastName, + isFamily: projectViewModel.isLoginChild, + //false, + name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + mobileNumber: projectViewModel.user.mobileNumber, + //model.user.firstName + " " + model.user.lastName, context: context, ); }, @@ -54,7 +64,7 @@ class InsurancePage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.user.firstName + " " + model.user.lastName, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -62,7 +72,7 @@ class InsurancePage extends StatelessWidget { ), ), Text( - TranslationBase.of(context).fileno + ": " + model.user.patientID.toString(), + TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), //model.user.patientID.toString(), style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, @@ -79,71 +89,73 @@ class InsurancePage extends StatelessWidget { ), ), ), - if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) - ListView.separated( - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 - ? InkWell( - onTap: () { - getDetails( - projectID: 15, - patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, - setupID: '010266', - patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, - name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, - parentID: model.user.patientID, - isFamily: true, - context: context); - }, - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 12.0), + if (!projectViewModel.isLoginChild) + if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) + ListView.separated( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + ? InkWell( + onTap: () { + getDetails( + projectID: 15, + patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, + setupID: '010266', + patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, + name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, + parentID: model.user.patientID, + isFamily: true, + mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].mobileNumber, + context: context); + }, child: Container( - decoration: cardRadius(12), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46), - ), - Text( - TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46), - ), - ], + width: double.infinity, + margin: EdgeInsets.only(top: 12.0), + child: Container( + decoration: cardRadius(12), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46), + ), + Text( + TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46), + ), + ], + ), ), - ), - Icon(Icons.arrow_forward), - ], + Icon(Icons.arrow_forward), + ], + ), ), ), ), - ), - ) - : Container(); - }, - separatorBuilder: (context, index) { - return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0); - }, - itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, - ), + ) + : Container(); + }, + separatorBuilder: (context, index) { + return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0); + }, + itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, + ), ], ), ), ); } - getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) { + getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, String mobileNumber, bool isFamily, int parentID = 0, BuildContext context}) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService .getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID) @@ -158,23 +170,34 @@ class InsurancePage extends StatelessWidget { patientID: patientID, patientIdentificationID: patientIdentificationID, name: name, + mobileNo: mobileNumber, ))).then((value) { model.getInsuranceUpdated(); }); } else { // AppToast.showErrorToast(message: _insuranceCardService.error); - updateManually(context, _insuranceCardService.error); + updateManually(context, _insuranceCardService.error, patientIdentificationID, patientID, mobileNumber); } }); } - void updateManually(BuildContext context, String errorMsg) { + void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) { ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog, okText: TranslationBase.of(context).yes, cancelText: TranslationBase.of(context).no, - okFunction: () => {Navigator.pop(context), Navigator.push(context, FadePage(page: UpdateInsuranceManually()))}, + okFunction: () => { + Navigator.pop(context), + Navigator.push( + context, + FadePage( + page: UpdateInsuranceManually( + patientIdentificationNo: patientIdentificationID, + patientID: patientID, + patientMobileNumber: mobileNumber, + ))) + }, cancelFunction: () => {}); dialog.showAlertDialog(context); } diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 5b68687f..56f67282 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,10 +1,12 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../base/base_view.dart'; import 'insurance_page.dart'; @@ -17,6 +19,7 @@ class InsuranceUpdate extends StatefulWidget { class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; List imagesInfo = List(); + ProjectViewModel projectViewModel; @override void initState() { @@ -33,6 +36,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv } Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( @@ -123,7 +127,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.user.firstName + " " + model.user.lastName, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -141,7 +145,6 @@ class _InsuranceUpdateState extends State with SingleTickerProv letterSpacing: -0.46, ), ), - Text( model.insuranceUpdate[index].createdOn, style: TextStyle( diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 4ceb5bf5..4c21e826 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -110,7 +110,7 @@ class _RequestTypePageState extends State { TranslationBase.of(context).submit, () => { model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { - if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) { + if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) { Navigator.pop(context); AppToast.showSuccessToast(message: TranslationBase.of(context).RRTRequestSuccess); } diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 016fad79..adaef00e 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -18,7 +18,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:open_file/open_file.dart'; +import 'package:open_filex/open_filex.dart'; import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -183,7 +183,7 @@ class ReportListWidget extends StatelessWidget { GifLoaderDialogUtils.hideDialog(AppGlobal.context); try { String path = await _createFileFromString(value["MedicalReportBase64"], "pdf"); - OpenFile.open(path); + OpenFilex.open(path); } catch (ex) { AppToast.showErrorToast(message: "Cannot open file."); } diff --git a/pubspec.yaml b/pubspec.yaml index 1170b282..9f3755da 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -207,7 +207,8 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 - open_file: ^3.2.1 +# open_file: ^3.2.1 + open_filex: ^4.3.2 path_provider: ^2.0.8 # flutter_callkit_incoming: ^1.0.3+3 # firebase_core: 1.12.0 From 275c99a4ceb576ccd298a0514c471756c3326eb0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Aug 2023 16:25:54 +0300 Subject: [PATCH 19/19] updates --- lib/pages/BookAppointment/BookConfirm.dart | 6 +++--- lib/pages/ToDoList/ToDo.dart | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 0405f657..830bd6bb 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -331,9 +331,9 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); Future.delayed(new Duration(milliseconds: 500), () { - checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); - // getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - // getToDoCount(); + // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); + getToDoCount(); + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); }); widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d3705a7c..9d806a18 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -543,8 +543,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { confirmAppointment(appo); break; case 20: - // getPatientShare(context, appo); - checkPatientNphiesEligibility(context, appo); + getPatientShare(context, appo); + // checkPatientNphiesEligibility(context, appo); break; case 30: getAppoQR(context, appo);