Vida Plus changes

PatientApp_VIDA_Plus_3.3
haroon amjad 3 years ago
parent 2e72d6a550
commit e50a67ea12

@ -21,7 +21,8 @@ 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/';
var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// 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/';
@ -411,14 +412,14 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 9.8; var VERSION_ID = 7.6;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;
var SESSION_ID = 'TMRhVmkGhOsvamErw'; var SESSION_ID = 'TMRhVmkGhOsvamErw';
var IS_DENTAL_ALLOWED_BACKEND = false; var IS_DENTAL_ALLOWED_BACKEND = false;
var PATIENT_TYPE = 1; var PATIENT_TYPE = 1;
var PATIENT_TYPE_ID = 1; var PATIENT_TYPE_ID = null;
var DEVICE_TOKEN = ""; var DEVICE_TOKEN = "";
var IS_VOICE_COMMAND_CLOSED = true; var IS_VOICE_COMMAND_CLOSED = true;
var IS_TEXT_COMPLETED = false; var IS_TEXT_COMPLETED = false;

@ -1,5 +1,6 @@
class RequestPatientLabSpecialResult { class RequestPatientLabSpecialResult {
String invoiceNo; String invoiceNo;
String invoiceNoVP;
String orderNo; String orderNo;
String setupID; String setupID;
String projectID; String projectID;
@ -20,6 +21,7 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult( RequestPatientLabSpecialResult(
{this.invoiceNo, {this.invoiceNo,
this.invoiceNoVP,
this.orderNo, this.orderNo,
this.setupID, this.setupID,
this.projectID, this.projectID,
@ -40,6 +42,7 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) { RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo = json['InvoiceNo_VP'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
setupID = json['SetupID']; setupID = json['SetupID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
@ -62,6 +65,7 @@ class RequestPatientLabSpecialResult {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;

@ -23,6 +23,7 @@ class RequestSendLabReportEmail {
String doctorName; String doctorName;
String projectID; String projectID;
String invoiceNo; String invoiceNo;
String invoiceNoVP;
String orderDate; String orderDate;
RequestSendLabReportEmail( RequestSendLabReportEmail(
@ -50,6 +51,7 @@ class RequestSendLabReportEmail {
this.doctorName, this.doctorName,
this.projectID, this.projectID,
this.invoiceNo, this.invoiceNo,
this.invoiceNoVP,
this.orderDate}); this.orderDate});
RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) { RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) {
@ -77,6 +79,7 @@ class RequestSendLabReportEmail {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo = json['InvoiceNo_VP'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];
} }
@ -106,6 +109,7 @@ class RequestSendLabReportEmail {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
return data; return data;
} }

@ -77,6 +77,7 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['isVidaPlus'] = true;
body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT);
body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG);
@ -98,31 +99,12 @@ class BaseAppClient {
} else { } else {
body['PatientType'] = PATIENT_TYPE; body['PatientType'] = PATIENT_TYPE;
} }
// }
// body['PatientType'] = body.containsKey('PatientType')
// ? body['PatientType'] != null
// ? body['PatientType']
// : user['PatientType'] != null
// ? user['PatientType']
// : PATIENT_TYPE
// : PATIENT_TYPE;
// if (!body.containsKey('PatientTypeID')) {
if (user != null && user['PatientType'] != null) { if (user != null && user['PatientType'] != null) {
body['PatientTypeID'] = user['PatientType']; body['PatientTypeID'] = user['PatientType'];
} else { } else {
body['PatientType'] = PATIENT_TYPE_ID; body['PatientType'] = PATIENT_TYPE_ID;
} }
// }
// body['PatientTypeID'] = body.containsKey('PatientTypeID')
// ? body['PatientTypeID'] != null
// ? body['PatientTypeID']
// : user['PatientType'] != null
// ? user['PatientType']
// : PATIENT_TYPE_ID
// : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token;
@ -158,11 +140,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
if (AppGlobal.isNetworkDebugEnabled) { // if (AppGlobal.isNetworkDebugEnabled) {
print("URL : $url"); print("Debug URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
print(jsonBody); print("Debug Body : $jsonBody");
} // }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -36,7 +36,8 @@ class LabsService extends BaseService {
hasError = false; hasError = false;
_requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.invoiceNo = "0";
_requestPatientLabSpecialResult.invoiceNoVP = invoiceNo;
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID; _requestPatientLabSpecialResult.setupID = setupID;
@ -54,7 +55,8 @@ class LabsService extends BaseService {
Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { Future getPatientLabResult({PatientLabOrders patientLabOrder}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo_VP'] = patientLabOrder.invoiceNo;
body['InvoiceNo'] = "0";
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -156,7 +158,8 @@ class LabsService extends BaseService {
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo'] = "0";
body['InvoiceNo_VP'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -178,7 +181,8 @@ class LabsService extends BaseService {
Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = "0";
_requestSendLabReportEmail.invoiceNoVP = patientLabOrder.invoiceNo;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName;

@ -28,7 +28,8 @@ class RadiologyService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear(); finalRadiologyList.clear();
response['FinalRadiologyList'].forEach((radiology) { // response['FinalRadiologyList'].forEach((radiology) {
response['FinalRadiologyListAPI'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology)); finalRadiologyList.add(FinalRadiology.fromJson(radiology));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -70,7 +70,7 @@ class _MyApp extends State<MyApp> {
// var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans';
// Re-enable once going live // Re-enable once going live
if (Platform.isAndroid) checkForUpdate(); // if (Platform.isAndroid) checkForUpdate();
ThemeNotifier(defaultTheme()); ThemeNotifier(defaultTheme());
super.initState(); super.initState();

@ -256,7 +256,7 @@ class _Login extends State<Login> {
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.checkPatientAuthentication(request).then((value) { authService.checkPatientAuthentication(request).then((value) {
if (value['UserAccountIsActivated']) { // if (value['UserAccountIsActivated']) {
if (value['isSMSSent']) { if (value['isSMSSent']) {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request);
@ -267,17 +267,17 @@ class _Login extends State<Login> {
this.checkActivationCode(); this.checkActivationCode();
} }
} }
} else { // } else {
ConfirmDialog activationDialog = new ConfirmDialog( // ConfirmDialog activationDialog = new ConfirmDialog(
context: context, // context: context,
confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, // confirmMessage: TranslationBase.of(context).accountDeactivatedMsg,
okText: TranslationBase.of(context).yes, // okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no, // cancelText: TranslationBase.of(context).no,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, // okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()},
cancelFunction: () => {}); // cancelFunction: () => {});
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
activationDialog.showAlertDialog(context); // activationDialog.showAlertDialog(context);
} // }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(

@ -20,7 +20,7 @@ import 'package:flutter/material.dart';
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:flutter_ios_voip_kit/call_state_type.dart'; import 'package:flutter_ios_voip_kit/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_push/huawei_push.dart' as h_push; import 'package:huawei_push/huawei_push.dart' as h_push;
import 'app_shared_preferences.dart'; import 'app_shared_preferences.dart';
@ -115,7 +115,7 @@ class PushNotificationHandler {
final BuildContext context; final BuildContext context;
static PushNotificationHandler _instance; static PushNotificationHandler _instance;
final voIPKit = FlutterIOSVoIPKit.instance; final voIPKit = FlutterIOSVoIPKit.instance;
HmsApiAvailability hmsApiAvailability; // HmsApiAvailability hmsApiAvailability;
Timer timeOutTimer; Timer timeOutTimer;
bool isTalking = false; bool isTalking = false;
@ -161,7 +161,7 @@ class PushNotificationHandler {
} }
init() async { init() async {
hmsApiAvailability = new HmsApiAvailability(); // hmsApiAvailability = new HmsApiAvailability();
// VoIP Callbacks // VoIP Callbacks
voIPKit.getVoIPToken().then((value) { voIPKit.getVoIPToken().then((value) {
print('🎈 example: getVoIPToken: $value'); print('🎈 example: getVoIPToken: $value');
@ -223,12 +223,12 @@ class PushNotificationHandler {
// if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) async { // await hmsApiAvailability.isHMSAvailable().then((value) async {
if (value != 0) { // if (value != 0) {
final fcmToken = await FirebaseMessaging.instance.getToken(); // final fcmToken = await FirebaseMessaging.instance.getToken();
if (fcmToken != null) onToken(fcmToken); // if (fcmToken != null) onToken(fcmToken);
} // }
}); // }).catchError((err) {});
} }
if (Platform.isIOS) { if (Platform.isIOS) {
@ -244,7 +244,6 @@ class PushNotificationHandler {
// 'Android GMS or iOS' (Handle Firebase Messaging Streams // 'Android GMS or iOS' (Handle Firebase Messaging Streams
FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async {
print("Firebase getInitialMessage with message : ${message.data.toString()}");
subscribeFCMTopic(); subscribeFCMTopic();
if (Platform.isIOS) if (Platform.isIOS)
await Future.delayed(Duration(milliseconds: 3000)).then((value) { await Future.delayed(Duration(milliseconds: 3000)).then((value) {
@ -288,29 +287,29 @@ class PushNotificationHandler {
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
if (Platform.isAndroid) { if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) async { // await hmsApiAvailability.isHMSAvailable().then((value) async {
if (value == 0) { // if (value == 0) {
h_push.Push.enableLogger(); // h_push.Push.enableLogger();
final result = await h_push.Push.setAutoInitEnabled(true); // final result = await h_push.Push.setAutoInitEnabled(true);
//
h_push.Push.onNotificationOpenedApp.listen((message) { // h_push.Push.onNotificationOpenedApp.listen((message) {
newMessage(toFirebaseRemoteMessage(message)); // newMessage(toFirebaseRemoteMessage(message));
}, onError: (e) => print(e.toString())); // }, onError: (e) => print(e.toString()));
//
h_push.Push.onMessageReceivedStream.listen((message) { // h_push.Push.onMessageReceivedStream.listen((message) {
newMessage(toFirebaseRemoteMessage(message)); // newMessage(toFirebaseRemoteMessage(message));
}, onError: (e) => print(e.toString())); // }, onError: (e) => print(e.toString()));
//
h_push.Push.getTokenStream.listen((token) { // h_push.Push.getTokenStream.listen((token) {
onToken(token); // onToken(token);
}, onError: (e) => print(e.toString())); // }, onError: (e) => print(e.toString()));
await h_push.Push.getToken(''); // await h_push.Push.getToken('');
//
h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); // h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler);
} // }
}).catchError((err) { // }).catchError((err) {
print(err); // print(err);
}); // });
} }
} }

Loading…
Cancel
Save