Fixes & updates

merge-update-with-lab-changes
haroon amjad 4 years ago
parent d5b58c07ca
commit 330f2d6c86

@ -68,7 +68,9 @@ const GET_DOCTOR_RATING_DETAILS =
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
@ -570,7 +572,10 @@ const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview";
const GET_NEW_PRODUCTS = "newproducts";

@ -31,6 +31,7 @@ class Orders {
String orderStatusn;
bool canCancel;
bool canRefund;
String orderGuid;
dynamic customerId;
dynamic orderSubtotalExclTax;
dynamic orderShippingExclTax;
@ -47,6 +48,7 @@ class Orders {
this.orderStatusn,
this.canCancel,
this.canRefund,
this.orderGuid,
this.customerId,
this.orderShippingExclTax,
this.orderSubtotalExclTax,
@ -63,6 +65,7 @@ class Orders {
orderStatusn = json['order_statusn'];
canCancel = json['can_cancel'];
canRefund = json['can_refund'];
orderGuid = json['order_guid'];
customerId = json['customer_id'];
orderSubtotalExclTax= json["order_subtotal_excl_tax"];
orderShippingExclTax= json["order_shipping_excl_tax"];

@ -49,9 +49,9 @@ class OrderModelViewModel extends BaseViewModel {
}
}
Future<OrderDetailModel> getOrderDetails(OrderId) async {
Future<OrderDetailModel> getOrderDetails(OrderId, orderGUID) async {
setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(OrderId);
await _orderDetailsService.getOrderDetails(OrderId, orderGUID);
if (_orderDetailsService.hasError) {
error = _orderDetailsService.error;
setState(ViewState.Error);

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:collection/collection.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
@ -8,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
import 'package:health/health.dart';
import 'package:intl/intl.dart';
class syncHealthDataButton extends StatefulWidget {
@ -26,6 +29,8 @@ class syncHealthDataButton extends StatefulWidget {
class _syncHealthDataButtonState extends State<syncHealthDataButton> {
List<DataType> dataTypes = List();
List<HealthDataPoint> _healthDataList = [];
List<healthData> Med_InsertTransactionsInputsList = new List();
List<healthData> Med_InsertTransactionsInputsList2 = new List();
@ -56,12 +61,53 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
padding: const EdgeInsets.all(20.0),
child: DefaultButton(TranslationBase.of(context).syncHealthData, () {
print("ReadAll");
readAll();
fetchData();
// readAll();
}),
),
);
}
Future fetchData() async {
// get everything from midnight until now
DateTime startDate = DateTime(2021, 11, 01, 0, 0, 0);
DateTime endDate = DateTime(2021, 12, 06, 23, 59, 59);
HealthFactory health = HealthFactory();
// define the types to get
List<HealthDataType> types = [
HealthDataType.STEPS,
HealthDataType.HEART_RATE,
Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING
];
// you MUST request access to the data types before reading them
// bool accessWasGranted = await health.requestAuthorization(types);
await health.requestAuthorization(types);
int steps = 0;
try {
List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, endDate, types);
_healthDataList.addAll(healthData);
} catch (e) {
print("Caught exception in getHealthDataFromTypes: $e");
}
// filter out duplicates
_healthDataList = HealthFactory.removeDuplicates(_healthDataList);
// print the results
_healthDataList.forEach((x) {
if(x.type == HealthDataType.STEPS) {
print("Data point: $x");
steps += x.value.round();
}
});
print("Steps: $steps");
}
void readAll() async {
TransactionsListID = 1;
var MedSubCategoryID = 0;
@ -160,7 +206,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
void getAllHealthDataLists() {
var totalSteps = 0.0;
var totalDistance = 0.0;
// double totalCalories = 0.0 ;
double totalHeartRate = 0.0;
double avgTotalHeartRate = 0.0;
var counter = 0;
@ -190,7 +235,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
value.forEach((element) {
if (element['MedCategoryID'] == 6) {
MedCategoryID = 6;
totalSteps += element['Value'];
} else if (element['MedCategoryID'] == 7) {
MedCategoryID = 7;

@ -1,15 +1,16 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:map_launcher/map_launcher.dart';
import 'dart:io' show Platform;
import 'package:url_launcher/url_launcher.dart';
class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel;
const AvailabilityInfo({Key key, this.previousModel}) : super(key: key);
final InAppBrowser browser = new InAppBrowser();
AvailabilityInfo({Key key, this.previousModel}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -22,8 +23,8 @@ class AvailabilityInfo extends StatelessWidget {
),
)
: Container(
margin: EdgeInsets.only(bottom: 40),
child: ListView.builder(
margin: EdgeInsets.only(bottom: 40),
child: ListView.builder(
physics: ScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
@ -55,20 +56,14 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton(
icon: Icon(Icons.location_on),
color: Colors.red,
onPressed: () {
if (Platform.isIOS) { MapLauncher.showMarker(
mapType: MapType.apple,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude),
double.parse(previousModel.productLocationService[index].longitude)),
title: previousModel.productLocationService[index].locationDescription,);
} else { MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude),
double.parse(previousModel.productLocationService[index].longitude)),
onPressed: () async {
// if (await MapLauncher.isMapAvailable(MapType.apple)) {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)),
title: previousModel.productLocationService[index].locationDescription,
// description: location.locationName,
); }
// MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
);
// }
},
),
),
@ -90,7 +85,7 @@ class AvailabilityInfo extends StatelessWidget {
);
},
),
);
);
}
convertCityName(txt) {

@ -104,7 +104,8 @@ class _BannerPagerState extends State<BannerPager> {
}
break;
case 2: {
Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
// Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
Navigator.push(context, FadePage(page: LakumMainPage()));
}
break;
case 5: {

@ -74,7 +74,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
this.context = context;
return BaseView<OrderModelViewModel>(
onModelReady: (model) {
model.getOrderDetails(widget.orderModel.id).then((value) {
model.getOrderDetails(widget.orderModel.id, widget.orderModel.orderGuid).then((value) {
setState(() {
isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty));
});
@ -533,10 +533,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
model.orderListModel[0].orderStatusId == 10
? InkWell(
onTap: () {
print(widget.orderModel.toString());
print(model.orderListModel.toString());
print("calc = ${5.9 * 3}");
// TODO MOSA
openPayment(model.orderListModel[0], model.user);
},
child: Container(
@ -672,11 +668,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
}
}
/***
*
* Online payment methods
*/
openPayment(
OrderDetailModel order,
AuthenticatedUser authenticatedUser,

@ -20,10 +20,10 @@ class OrderDetailsService extends BaseService{
List<OrderDetailModel> get orderList => _orderList;
Future getOrderDetails(OrderId) async {
Future getOrderDetails(OrderId, orderGUID) async {
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId + "/$customerGUID",
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId + "/$orderGUID",
onSuccess: (dynamic response, int statusCode) {
_orderList.clear();
response['orders'].forEach((item) {

@ -20,7 +20,7 @@ class OrderService extends BaseService {
hasError = false;
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
url = GET_ORDER + "customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId&CustomerguId=$customerGUID";
url = GET_ORDER + "customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund,order_guid&page=$pageId&limit=200&customer_id=$customerId&CustomerguId=$customerGUID";
print(url);
await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) {

@ -4,11 +4,11 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class WishListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
bool isLogin = false;
List<Wishlist> _wishListProducts = List();
List<Wishlist> get wishListProducts => _wishListProducts;
// Future<Map> getWishlist() async {
@ -52,18 +52,17 @@ class WishListService extends BaseService {
Future getWishlist() async {
//TODO we need to check why the customer id comes null
String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID)?? "0";
String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID) ?? "0";
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false;
await baseAppClient.getPharmacy(GET_WISHLIST+customerId +"?shopping_cart_type=2",
onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear();
response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
await baseAppClient.getPharmacy(GET_WISHLIST + customerId + "/$customerGUID/" + "?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear();
response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
}

@ -2,21 +2,18 @@ import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'avatar/large_avatar.dart';
import 'my_rich_text.dart';
import 'dart:io' show Platform;
class HospitalLocation extends StatelessWidget {
final GetHMGLocationsModel location;
final bool showCity;
final String waitingTime;
HospitalLocation(this.location, {Key key, this.showCity = false, this.waitingTime}) : super(key: key);
@override
@ -76,20 +73,17 @@ class HospitalLocation extends StatelessWidget {
),
Column(
children: [
contactButton(Icons.location_on, TranslationBase.of(context).locationa, () {
// MapsLauncher.launchCoordinates(double.parse(location.latitude), double.parse(location.longitude), location.locationName);
if (Platform.isIOS) { MapLauncher.showMarker(
// mapType: MapType.google,
mapType: MapType.apple,
coords: Coords(double.parse(location.latitude), double.parse(location.longitude)),
title: location.locationName,);
} else { MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(location.latitude), double.parse(location.longitude)),
title: location.locationName,
// description: location.locationName,
); }}
),
contactButton(
Icons.location_on,
TranslationBase.of(context).locationa,
() async {
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(location.latitude), double.parse(location.longitude)),
title: location.locationName,
);
},
),
SizedBox(height: 10),
contactButton(Icons.call, TranslationBase.of(context).callNow, () {
launch("tel://" + location.phoneNumber);
@ -121,6 +115,4 @@ class HospitalLocation extends StatelessWidget {
),
);
}
}

@ -28,15 +28,13 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType;
// 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 PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
@ -204,9 +202,14 @@ class MyInAppBrowser extends InAppBrowser {
openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser) {
this.browser = browser;
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo);
getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
this.browser.openUrl(url: value);
if (order.customValuesXml.contains("ApplePay")) {
safariBrowser.open(url: value);
} else {
this.browser.openUrl(url: value);
}
});
}

Loading…
Cancel
Save