Livecare updates

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 4ecab57173
commit a20d6c7c28

@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:3334/'; // var BASE_URL = 'http://10.50.100.198:3334/';
var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; var BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -585,6 +585,8 @@ var AUTO_GENERATE_INVOICE_TAMARA = 'Services/PayFort_Serv.svc/REST/Tamara_Getinf
var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players'; var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players';
var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus';
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -87,20 +87,21 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
showVideoProgressIndicator: true, showVideoProgressIndicator: true,
), ),
), ),
if (widget.notification.messageTypeData.length != 0 && widget.notification.notificationType != "2") if (widget.notification.messageTypeData != null)
Padding( if (widget.notification.messageTypeData.length != 0 && widget.notification.notificationType != "2")
padding: const EdgeInsets.only(top: 18), Padding(
child: Image.network(widget.notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) { padding: const EdgeInsets.only(top: 18),
if (loadingProgress == null) return child; child: Image.network(widget.notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) {
return Center( if (loadingProgress == null) return child;
child: SizedBox( return Center(
width: 40.0, child: SizedBox(
height: 40.0, width: 40.0,
child: AppCircularProgressIndicator(), height: 40.0,
), child: AppCircularProgressIndicator(),
); ),
}, fit: BoxFit.fill), );
), }, fit: BoxFit.fill),
),
SizedBox(height: 18), SizedBox(height: 18),
Text( Text(
widget.notification.message.trim(), widget.notification.message.trim(),

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -22,8 +23,10 @@ class LiveCarePatmentPage extends StatefulWidget {
GetERAppointmentFeesList getERAppointmentFeesList; GetERAppointmentFeesList getERAppointmentFeesList;
int waitingTime; int waitingTime;
String clinicName; String clinicName;
bool isPharmaLiveCare;
String pharmaLiveCareClientID;
LiveCarePatmentPage({@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName}); LiveCarePatmentPage({@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName, this.isPharmaLiveCare = false, this.pharmaLiveCareClientID = ""});
@override @override
_LiveCarePatmentPageState createState() => _LiveCarePatmentPageState(); _LiveCarePatmentPageState createState() => _LiveCarePatmentPageState();
@ -278,6 +281,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
() { () {
if (widget.isPharmaLiveCare) cancelAPI();
Navigator.pop(context, false); Navigator.pop(context, false);
}, },
), ),
@ -387,6 +391,13 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
void cancelAPI() {
LiveCareService service = new LiveCareService();
service.cancelPharmaLiveCareRequest(widget.pharmaLiveCareClientID, context).then((res) {}).catchError((err) {
print(err);
});
}
void onRadioChanged(int value) { void onRadioChanged(int value) {
setState(() { setState(() {
_selected = value; _selected = value;

@ -195,7 +195,7 @@ class _clinic_listState extends State<ClinicList> {
} }
showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) {
navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName)).then( navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName, isPharmaLiveCare: widget.isPharmacyLiveCare, pharmaLiveCareClientID: widget.pharmacyLiveCareQRCode)).then(
(value) { (value) {
if (value) { if (value) {
if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
@ -581,7 +581,7 @@ class _clinic_listState extends State<ClinicList> {
widget.isPharmacyLiveCare = true; widget.isPharmacyLiveCare = true;
widget.pharmacyLiveCareQRCode = value.split("/")[1]; widget.pharmacyLiveCareQRCode = value.split("/")[1];
liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA);
selectedClinicID = 7; selectedClinicID = 1;
selectedClinicName = TranslationBase.of(context).pharmaLiveCare; selectedClinicName = TranslationBase.of(context).pharmaLiveCare;
sharedPref.remove(LIVECARE_CLINIC_DATA); sharedPref.remove(LIVECARE_CLINIC_DATA);
startLiveCare(); startLiveCare();

@ -156,7 +156,7 @@ class LiveCareService extends BaseService {
request = { request = {
"ServiceID": serviceID, "ServiceID": serviceID,
"ProjectID": 15, "ProjectID": 12,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -182,7 +182,7 @@ class LiveCareService extends BaseService {
request = { request = {
"ServiceID": serviceID, "ServiceID": serviceID,
"ProjectID": 15, "ProjectID": 12,
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -326,9 +326,7 @@ class LiveCareService extends BaseService {
Future<Map> getOneSignalVOIPToken(String voipToken, BuildContext context) async { Future<Map> getOneSignalVOIPToken(String voipToken, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0};
// request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0, "test_type": 1};
request = { "app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0 };
dynamic localRes; dynamic localRes;
@ -339,4 +337,19 @@ class LiveCareService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> cancelPharmaLiveCareRequest(String pharmaClientRequestID, BuildContext context) async {
Map<String, dynamic> request;
request = {"clientid": pharmaClientRequestID, "status": "Cancel"};
dynamic localRes;
await baseAppClient.post(CANCEL_PHARMA_LIVECARE_REQUEST, isExternal: true, isAllowAny: true, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -37,9 +37,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 LIVE
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT 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 PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';

Loading…
Cancel
Save