From 2437d2da9ceffd2da3cb52c3b32a9373b55a972c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 30 May 2023 14:49:52 +0300 Subject: [PATCH] Updates --- lib/config/config.dart | 8 ++-- .../request_send_rad_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 2 +- .../service/medical/radiology_service.dart | 6 +++ .../medical/radiology_view_model.dart | 5 +++ .../medical/ask_doctor/doctor_response.dart | 41 +++++++++---------- .../radiology/radiology_details_page.dart | 7 ++-- .../radiology/radiology_home_page.dart | 4 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 9 files changed, 49 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c22e6e38..a8bc93d3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // 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/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -39,7 +39,9 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/'; +// var RC_BASE_URL = 'https://rc.hmg.com/'; + +var RC_BASE_URL = 'https://ms.hmg.com/rc/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index a461156e..6819de0d 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -6,6 +6,7 @@ class RequestSendRadReportEmail { String doctorName; String generalid; int invoiceNo; + int invoiceNo_VP; String iPAdress; bool isDentalAllowedBackend; int languageID; @@ -35,6 +36,7 @@ class RequestSendRadReportEmail { this.doctorName, this.generalid, this.invoiceNo, + this.invoiceNo_VP, this.iPAdress, this.isDentalAllowedBackend, this.languageID, @@ -63,6 +65,7 @@ class RequestSendRadReportEmail { doctorName = json['DoctorName']; generalid = json['generalid']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; iPAdress = json['IPAdress']; isDentalAllowedBackend = json['isDentalAllowedBackend']; languageID = json['LanguageID']; @@ -94,6 +97,7 @@ class RequestSendRadReportEmail { data['DoctorName'] = this.doctorName; data['generalid'] = this.generalid; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['IPAdress'] = this.iPAdress; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index db9cc5e8..7d38d794 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 3649158; //3844083 + // body['PatientID'] = 336; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index a289cebd..5a586356 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -8,10 +8,13 @@ class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; + bool isRadiologyVIDAPlus = false; + Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; + body['InvoiceNo_VP'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; @@ -29,10 +32,12 @@ class RadiologyService extends BaseService { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { + isRadiologyVIDAPlus = false; response['FinalRadiologyList'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); } else { + isRadiologyVIDAPlus = true; response['FinalRadiologyListAPI'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); @@ -62,6 +67,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.projectID = finalRadiology.projectID; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; + _requestSendRadReportEmail.invoiceNo_VP = finalRadiology.invoiceNo_VP; _requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo; _requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName; diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index e944b685..311c4366 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -18,9 +18,14 @@ class RadiologyViewModel extends BaseViewModel { List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; + bool _isRadiologyVIDAPlus = false; + + bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; + void getPatientRadOrders() async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(); + _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index 37e5f1c9..1ff9def7 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -27,7 +28,7 @@ class DoctorResponse extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 65, + height: 16, ), AppExpandableNotifier( headerWidget: Padding( @@ -61,14 +62,18 @@ class DoctorResponse extends StatelessWidget { return InkWell( onTap: () { ///go to page ViewDoctorResponsesPage - Navigator.push( - context, - FadePage( - page: ViewDoctorResponsesPage( - doctorResponse: doctor, + if (doctor.transactions != null && doctor.transactions.isNotEmpty) { + Navigator.push( + context, + FadePage( + page: ViewDoctorResponsesPage( + doctorResponse: doctor, + ), ), - ), - ); + ); + } else { + Utils.showErrorToast("There are no doctor responses for this request."); + } }, child: Container( height: 100, @@ -85,24 +90,20 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), - Texts( - '${doctor.requestTypeDescription}'), + Texts('${doctor.requestTypeDescription}'), ], ), ), ), Padding( padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Icon(projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios), + child: Icon(projectViewModel.isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios), ) ], ), @@ -158,24 +159,20 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), - Texts( - '${doctor.requestTypeDescription}'), + Texts('${doctor.requestTypeDescription}'), ], ), ), ), Padding( padding: const EdgeInsets.all(8.0), - child: Icon(projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios), + child: Icon(projectViewModel.isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios), ) ], ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index a84acbae..c7513757 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -19,14 +18,16 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; + bool isRadiologyVidaPlus; - RadiologyDetailsPage({Key key, this.finalRadiology}); + RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getRadImageURL(projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), + onModelReady: (model) => model.getRadImageURL( + projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isRadiologyVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 8a98401a..2c18dc09 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; @@ -78,12 +79,13 @@ class RadiologyHomePage extends StatelessWidget { FadePage( page: RadiologyDetailsPage( finalRadiology: radiology, + isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID), ), ), ), isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, - billNo: radiology.invoiceNo_VP.toString(), + billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..ba9d79ee 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ class MyInAppBrowser extends InAppBrowser { // 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 + static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';