master
haroon amjad 1 month ago
parent 618f967073
commit c44c8dac15

@ -21,8 +21,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:2018/'; // var BASE_URL = 'http://10.50.100.198:2018/';
// 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 = 'http://10.201.204.103/'; // var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -703,6 +703,8 @@ var IS_DOCTOR_AVAILABLE_BY_CALENDAR_SCHEDULE = 'Services/OUTPs.svc/REST/HIS_IsDo
var GET_OFFER_DETAILS = 'Services/Authentication.svc/REST/GetNDOfferData'; var GET_OFFER_DETAILS = 'Services/Authentication.svc/REST/GetNDOfferData';
var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatbot_SendMedicationInstructionByWhatsApp';
//PAYFORT //PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";

@ -2845,4 +2845,5 @@ const Map localizedValues = {
"thisResult": {"en": "This Result", "ar": "هذه النتيجة"}, "thisResult": {"en": "This Result", "ar": "هذه النتيجة"},
"seeAllGraphValues": {"en": "View all results", "ar": "عرض جميع النتائج"}, "seeAllGraphValues": {"en": "View all results", "ar": "عرض جميع النتائج"},
"verify-with-biometric": {"en": "Biometric", "ar": "الحيوية"}, "verify-with-biometric": {"en": "Biometric", "ar": "الحيوية"},
"medicationInstructions": {"en": "Medication Instructions", "ar": "تعليمات الدواء"},
}; };

@ -20,6 +20,7 @@ class HospitalsModel {
String? regionArabic; String? regionArabic;
String? regionEnglish; String? regionEnglish;
String? regionID; String? regionID;
num? amountWithTax;
HospitalsModel( HospitalsModel(
{this.desciption, {this.desciption,
@ -37,13 +38,13 @@ class HospitalsModel {
this.longitude, this.longitude,
this.mainProjectID, this.mainProjectID,
this.projectOutSA, this.projectOutSA,
this.usingInDoctorApp, this.usingInDoctorApp,
this.isHMC, this.isHMC,
this.region, this.region,
this.regionArabic, this.regionArabic,
this.regionEnglish, this.regionEnglish,
this.regionID, this.regionID,
}); this.amountWithTax});
HospitalsModel.fromJson(Map<String, dynamic> json) { HospitalsModel.fromJson(Map<String, dynamic> json) {
desciption = json['Desciption']; desciption = json['Desciption'];

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:hmg_patient_app/widgets/data_display/medical/LabResult/newUI/labWidgets.dart'; import 'package:hmg_patient_app/widgets/data_display/medical/LabResult/newUI/labWidgets.dart';
class LabResultList { class LabResultList {
@ -219,6 +220,14 @@ class LabResult {
bool shouldShowResultBarAndGraph() { bool shouldShowResultBarAndGraph() {
if (resultTypeID == null) return false; if (resultTypeID == null) return false;
if (resultTypeID == 6) return false; if (resultTypeID == 6) return false;
if (referanceRange == null || referanceRange == "" || referanceRange == "\n") return false;
try {
num.parse(resultValue ?? "");
} catch (e) {
debugPrint("Exception in parsing result value: $e");
return false;
}
return true; return true;
} }

@ -187,7 +187,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232 // body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 4767477; //4609100 // body['PatientID'] = 4771637; //4609100
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

@ -24,6 +24,8 @@ class PrescriptionsService extends BaseService {
String prescriptionReportPDF = ""; String prescriptionReportPDF = "";
String prescriptionInstructionsPDFLink = "";
Future getPrescriptions() async { Future getPrescriptions() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -259,4 +261,24 @@ class PrescriptionsService extends BaseService {
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future getMedicationsInstructionsPDF({required String setupID, required int projectID, required String appointmentNo}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['SetupID'] = setupID;
body['ProjectID'] = projectID;
body['AppointmentNo'] = appointmentNo;
// body['AppointmentNo'] = "2016072489";
body['LocationID'] = "0";
body['SalesInvoiceNo'] = "0";
body['IsTest'] = false;
body['ChannelID'] = "3";
await baseAppClient.post(GET_PRESCRIPTION_INSTRUCTIONS_PDF, onSuccess: (dynamic response, int statusCode) {
// print(response["InvoiceUrl"]);
prescriptionInstructionsPDFLink = response["InvoiceUrl"];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -213,8 +213,8 @@ class LabsViewModel extends BaseViewModel {
} catch (e) {} } catch (e) {}
}); });
threePointGraphValue.last.label = "thisResult"; // threePointGraphValue.last.label = "thisResult";
threePointGraphValue.last.isStringResource = true; // threePointGraphValue.last.isStringResource = true;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -240,8 +240,8 @@ class LabsViewModel extends BaseViewModel {
} }
++counter; ++counter;
}); });
completeeGraphValues.last.label = "thisResult"; // completeeGraphValues.last.label = "thisResult";
completeeGraphValues.last.isStringResource = true; // completeeGraphValues.last.isStringResource = true;
setState(ViewState.Idle); setState(ViewState.Idle);
onComplete(); onComplete();
} }

@ -150,19 +150,33 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
), ),
), ),
(projectViewModel.havePrivilege(111) && projectViewModel.hisProjectOffers.isNotEmpty) (projectViewModel.havePrivilege(111) && projectViewModel.hisProjectOffers.isNotEmpty)
? InkWell( ? Padding(
onTap: () { padding: const EdgeInsets.only(left: 20, right: 20),
Navigator.push( child: InkWell(
context, onTap: () {
MaterialPageRoute( Navigator.push(
builder: (context) => OfferDetailsPage( context,
title: projectViewModel.isArabic ? projectViewModel.hisProjectOffers.first.titleArabic! : projectViewModel.hisProjectOffers.first.titleName!, MaterialPageRoute(
onLoginClick: widget.onLoginClick!, builder: (context) => OfferDetailsPage(
title: projectViewModel.isArabic
? projectViewModel.hisProjectOffers.first.titleArabic!.split("\$")[0].trim()
: projectViewModel.hisProjectOffers.first.titleName!.split("\$")[0].trim(),
onLoginClick: widget.onLoginClick!,
),
), ),
), );
); },
}, child: SvgPicture.network(
child: DiscountCardWidget(), "https://marathoon.com/service/hmgvideo/Banner_English.svg",
// "https://marathoon.com/service/hmgvideo/Banner_Arabic.svg",
// projectViewModel.isArabic ? projectViewModel.hisProjectOffers.first.titleArabic!.split("\$")[1].trim() : projectViewModel.hisProjectOffers.first.titleName!.split("\$")[1].trim(),
// height: 300,
width: MediaQuery.of(context).size.width,
fit: BoxFit.contain,
// color: color,
),
// DiscountCardWidget(),
),
) )
: SizedBox.shrink(), : SizedBox.shrink(),
projectViewModel.isLogin projectViewModel.isLogin

@ -48,7 +48,7 @@ class _DiscountCardWidgetState extends State<DiscountCardWidget> {
Text( Text(
projectViewModel.hisProjectOffers.first.titleArabic!, projectViewModel.hisProjectOffers.first.titleArabic!,
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 18,
fontFamily: 'Cairo', fontFamily: 'Cairo',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
@ -105,7 +105,7 @@ class _DiscountCardWidgetState extends State<DiscountCardWidget> {
'This Offer is valid till ${DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(projectViewModel.hisProjectOffers.first.validTo))}', 'This Offer is valid till ${DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(projectViewModel.hisProjectOffers.first.validTo))}',
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 11, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
), ),
@ -113,7 +113,7 @@ class _DiscountCardWidgetState extends State<DiscountCardWidget> {
"يسري العرض حتى ${DateUtil.getMonthDayYearDateFormattedAr(DateUtil.convertStringToDate(projectViewModel.hisProjectOffers.first.validTo))}", "يسري العرض حتى ${DateUtil.getMonthDayYearDateFormattedAr(DateUtil.convertStringToDate(projectViewModel.hisProjectOffers.first.validTo))}",
style: TextStyle( style: TextStyle(
fontFamily: 'Cairo', fontFamily: 'Cairo',
fontSize: 11, fontSize: 10,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
color: Colors.white, color: Colors.white,
), ),

@ -57,207 +57,207 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
late String tamaraOrderID; late String tamaraOrderID;
late MyInAppBrowser browser; late MyInAppBrowser browser;
num paymentAmount = 295.0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Directionality( return AppScaffold(
// lock the whole page to LTR isShowDecPage: false,
textDirection: TextDirection.ltr, isShowAppBar: false,
child: AppScaffold( showNewAppBar: true,
isShowDecPage: false, isHelp: true,
isShowAppBar: false, showNewAppBarTitle: true,
showNewAppBar: true, appBarTitle: widget.title,
isHelp: true, body: Column(
showNewAppBarTitle: true, children: [
appBarTitle: widget.title, Expanded(
body: Column( child: SingleChildScrollView(
children: [ child: Column(
Expanded( children: [
child: SingleChildScrollView( /// Banner
child: Column( SvgPicture.asset(
children: [ "assets/images/svg/details_page_banner.svg",
/// Banner height: 120,
SvgPicture.asset( fit: BoxFit.fill,
"assets/images/svg/details_page_banner.svg", ),
height: 120,
fit: BoxFit.fill,
),
/// Arabic Offer Section
Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 32.0),
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 32),
child: Directionality(
textDirection: TextDirection.rtl,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
projectViewModel.hisProjectOffers.first.titleArabic!,
style: TextStyle(
fontFamily: 'Cairo',
fontSize: 22,
fontWeight: FontWeight.bold,
color: Color(0xff008b4c),
),
),
Text(
projectViewModel.hisProjectOffers.first.descriptionArabic!,
style: TextStyle(
fontFamily: 'Cairo',
fontWeight: FontWeight.w300,
fontSize: 16,
),
),
SizedBox(height: 12),
Text(
projectViewModel.hisProjectOffers.first.detailsArabic!,
style: TextStyle(
fontFamily: 'Cairo',
fontWeight: FontWeight.w300,
fontSize: 14,
),
),
],
),
),
),
const SizedBox(height: 20), /// Arabic Offer Section
const Divider(thickness: 1, color: Color(0xff008b4c)), Padding(
const SizedBox(height: 20), padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 32.0),
child: Column(
/// English Offer Section children: [
Padding( // Padding(
padding: const EdgeInsets.symmetric(horizontal: 16), // padding: const EdgeInsets.only(top: 32),
child: Column( // child: Directionality(
crossAxisAlignment: CrossAxisAlignment.start, // textDirection: TextDirection.rtl,
children: [ // child: Column(
Text( // crossAxisAlignment: CrossAxisAlignment.start,
projectViewModel.hisProjectOffers.first.titleName!, // children: [
style: TextStyle( // Text(
fontSize: 22, // projectViewModel.hisProjectOffers.first.titleArabic!,
fontWeight: FontWeight.bold, // style: TextStyle(
color: Color(0xff008b4c), // fontFamily: 'Cairo',
), // fontSize: 22,
// fontWeight: FontWeight.bold,
// color: Color(0xff008b4c),
// ),
// ),
// Text(
// projectViewModel.hisProjectOffers.first.descriptionArabic!,
// style: TextStyle(
// fontFamily: 'Cairo',
// fontWeight: FontWeight.w300,
// fontSize: 16,
// ),
// ),
// SizedBox(height: 12),
// Text(
// projectViewModel.hisProjectOffers.first.detailsArabic!,
// style: TextStyle(
// fontFamily: 'Cairo',
// fontWeight: FontWeight.w300,
// fontSize: 14,
// ),
// ),
// ],
// ),
// ),
// ),
// const SizedBox(height: 20),
// const Divider(thickness: 1, color: Color(0xff008b4c)),
const SizedBox(height: 20),
/// English Offer Section
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
projectViewModel.isArabic
? projectViewModel.hisProjectOffers.first.titleArabic!.split("\$")[0].trim()
: projectViewModel.hisProjectOffers.first.titleName!.split("\$")[0].trim(),
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Color(0xff008b4c),
), ),
Text( ),
projectViewModel.hisProjectOffers.first.descriptionEnglish!, Text(
style: TextStyle( projectViewModel.isArabic ? projectViewModel.hisProjectOffers.first.descriptionArabic! : projectViewModel.hisProjectOffers.first.descriptionEnglish!,
fontFamily: 'Poppins', style: TextStyle(
fontSize: 16, // fontFamily: 'Poppins',
fontWeight: FontWeight.bold, fontSize: 16,
), fontWeight: FontWeight.bold,
), ),
SizedBox(height: 12), ),
Text( SizedBox(height: 12),
projectViewModel.hisProjectOffers.first.detailsEnglish!, Text(
style: TextStyle( projectViewModel.isArabic ? projectViewModel.hisProjectOffers.first.detailsArabic! : projectViewModel.hisProjectOffers.first.detailsEnglish!,
fontSize: 14, style: TextStyle(
fontFamily: 'Poppins', fontSize: 14,
), // fontFamily: 'Poppins',
), ),
],
),
),
const SizedBox(height: 24),
/// Hospital Dropdown (mock UI)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(12),
), ),
child: InkWell( ],
onTap: () { ),
openHospitalSelection(context); ),
},
child: Row( const SizedBox(height: 24),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ /// Hospital Dropdown (mock UI)
Expanded( Padding(
child: Column( padding: const EdgeInsets.symmetric(horizontal: 16),
children: [ child: Container(
Directionality( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
textDirection: TextDirection.rtl, decoration: BoxDecoration(
child: Text( color: Colors.grey.shade300,
selectedHospital?.nameN ?? TranslationBase.of(context).selectHospital, borderRadius: BorderRadius.circular(12),
style: TextStyle( ),
fontWeight: FontWeight.bold, child: InkWell(
fontFamily: 'Cairo', onTap: () {
), openHospitalSelection(context);
), },
), child: Row(
Text( mainAxisAlignment: MainAxisAlignment.spaceBetween,
selectedHospital?.name ?? TranslationBase.of(context).selectHospital, children: [
Expanded(
child: Column(
children: [
Directionality(
textDirection: TextDirection.rtl,
child: Text(
selectedHospital?.nameN ?? TranslationBase.of(context).selectHospital,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Cairo',
), ),
), ),
], ),
), Text(
selectedHospital?.name ?? TranslationBase.of(context).selectHospital,
style: TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
],
), ),
Icon(Icons.arrow_drop_down), ),
], Icon(Icons.arrow_drop_down),
), ],
), ),
), ),
), ),
),
const SizedBox(height: 24), const SizedBox(height: 24),
/// Buttons /// Buttons
], ],
),
), ),
),
const SizedBox(height: 30), const SizedBox(height: 30),
], ],
),
), ),
), ),
Padding( ),
padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 8), Padding(
child: Row( padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 8),
children: [ child: Row(
SizedBox( children: [
width: MediaQuery.of(context).size.width - 24, SizedBox(
height: 50, width: MediaQuery.of(context).size.width - 24,
child: DefaultButton("Pay Now ادفع الآن", () { height: 50,
if (projectViewModel.isLogin) { child: DefaultButton("Pay Now ادفع الآن", () {
if (selectedHospital != null) { if (projectViewModel.isLogin) {
startPaymentProcess(context); if (selectedHospital != null) {
} else { startPaymentProcess(context);
AppToast.showErrorToast(message: TranslationBase.of(context).selectHospital);
}
} else { } else {
ConfirmDialog dialog = new ConfirmDialog( AppToast.showErrorToast(message: TranslationBase.of(context).selectHospital);
context: context,
confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
Navigator.of(context).pop();
widget.onLoginClick!();
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
} }
}), } else {
), ConfirmDialog dialog = new ConfirmDialog(
], context: context,
), confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
Navigator.of(context).pop();
widget.onLoginClick!();
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}),
),
],
), ),
], ),
), ],
), ),
); );
} }
@ -270,19 +270,19 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
selectedPaymentMethod = metohd; selectedPaymentMethod = metohd;
}, },
patientShare: projectViewModel.hisProjectOffers.first.amountWithTax, patientShare: paymentAmount,
isShowInstallments: false, isShowInstallments: false,
isFromAdvancePayment: false), isFromAdvancePayment: true),
), ),
).then((value) { ).then((value) {
if (selectedPaymentMethod == "ApplePay") { if (selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) { if (projectViewModel.havePrivilege(103)) {
startApplePay(context); startApplePay(context);
} else { } else {
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, projectViewModel.hisProjectOffers.first.amountWithTax!, AppoitmentAllHistoryResultList()); openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, paymentAmount, AppoitmentAllHistoryResultList());
} }
} else { } else {
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, projectViewModel.hisProjectOffers.first.amountWithTax!, AppoitmentAllHistoryResultList()); openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, paymentAmount, AppoitmentAllHistoryResultList());
} }
}); });
} }
@ -322,7 +322,7 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0"; applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = projectViewModel.hisProjectOffers.first.amountWithTax.toString(); applePayInsertRequest.amount = paymentAmount.toString();
applePayInsertRequest.isSchedule = "0"; applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
@ -349,7 +349,7 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
orderDescription: "Advance Payment", orderDescription: "Advance Payment",
orderAmount: projectViewModel.hisProjectOffers.first.amountWithTax, orderAmount: paymentAmount,
merchantReference: transID, merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
@ -442,14 +442,7 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called"); print("onBrowserExit Called");
if (selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") { if (selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
var res = { var res = {"Amount": paymentAmount, "ErrorMessage": null, "Fort_id": tamaraOrderID, "Merchant_Reference": "5058637919318707883366", "PaymentMethod": "TAMARA", "Response_Message": "Success"};
"Amount": projectViewModel.hisProjectOffers.first.amountWithTax!,
"ErrorMessage": null,
"Fort_id": tamaraOrderID,
"Merchant_Reference": "5058637919318707883366",
"PaymentMethod": "TAMARA",
"Response_Message": "Success"
};
purchaseOfferAPICall(res); purchaseOfferAPICall(res);
} else { } else {
checkPaymentStatus(appo); checkPaymentStatus(appo);
@ -473,7 +466,7 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
} else { } else {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
amount = projectViewModel.hisProjectOffers.first.amountWithTax!.toString(); amount = paymentAmount.toString();
payment_method = selectedPaymentMethod; payment_method = selectedPaymentMethod;
} }
}).catchError((err) { }).catchError((err) {
@ -518,11 +511,7 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
List<HospitalsModel> projectsListLocal = []; List<HospitalsModel> projectsListLocal = [];
projectViewModel.hisProjectOffers.forEach((project) { projectViewModel.hisProjectOffers.forEach((project) {
projectsListLocal.add(new HospitalsModel( projectsListLocal.add(new HospitalsModel(iD: project.projectId, name: project.projectEnglish, nameN: project.projectArabic, amountWithTax: project.amountWithTax));
iD: project.projectId,
name: project.projectEnglish,
nameN: project.projectArabic,
));
}); });
showDialog( showDialog(
@ -536,6 +525,8 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
_selectedHospitalIndex = index; _selectedHospitalIndex = index;
setState(() { setState(() {
selectedHospital = projectsListLocal[index]; selectedHospital = projectsListLocal[index];
paymentAmount = projectsListLocal[index].amountWithTax ?? 295.0;
print(paymentAmount);
}); });
}, },
), ),

@ -722,7 +722,7 @@ class _clinic_listState extends State<ClinicList> {
setState(() { setState(() {
liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res as Map<String, dynamic>); liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res as Map<String, dynamic>);
selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].serviceID!; selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].serviceID!;
selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].clinicDesc!; selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].clinicDesc ?? "LiveCare Clinic";
isDataLoaded = true; isDataLoaded = true;
}); });
} else { } else {
@ -979,7 +979,7 @@ class _clinic_listState extends State<ClinicList> {
updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) { updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) {
setState(() { setState(() {
selectedClinicID = patientERGetClinicsList.serviceID!; selectedClinicID = patientERGetClinicsList.serviceID!;
selectedClinicName = patientERGetClinicsList.clinicDesc!; selectedClinicName = patientERGetClinicsList.clinicDesc ?? "LiveCare Clinic";
}); });
} }
} }

@ -1,14 +1,17 @@
import 'package:hmg_patient_app/core/enum/viewstate.dart'; import 'package:hmg_patient_app/core/enum/viewstate.dart';
import 'package:hmg_patient_app/core/model/prescriptions/Prescriptions.dart'; import 'package:hmg_patient_app/core/model/prescriptions/Prescriptions.dart';
import 'package:hmg_patient_app/core/model/prescriptions/prescription_report.dart'; import 'package:hmg_patient_app/core/model/prescriptions/prescription_report.dart';
import 'package:hmg_patient_app/core/service/medical/prescriptions_service.dart';
import 'package:hmg_patient_app/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:hmg_patient_app/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
import 'package:hmg_patient_app/extensions/string_extensions.dart'; import 'package:hmg_patient_app/extensions/string_extensions.dart';
import 'package:hmg_patient_app/locator.dart';
import 'package:hmg_patient_app/main.dart'; import 'package:hmg_patient_app/main.dart';
import 'package:hmg_patient_app/models/header_model.dart'; import 'package:hmg_patient_app/models/header_model.dart';
import 'package:hmg_patient_app/pages/base/base_view.dart'; import 'package:hmg_patient_app/pages/base/base_view.dart';
import 'package:hmg_patient_app/pages/medical/prescriptions/prescription_details_inp.dart'; import 'package:hmg_patient_app/pages/medical/prescriptions/prescription_details_inp.dart';
import 'package:hmg_patient_app/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:hmg_patient_app/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart'; import 'package:hmg_patient_app/uitl/app_toast.dart';
import 'package:hmg_patient_app/uitl/date_uitl.dart'; import 'package:hmg_patient_app/uitl/date_uitl.dart';
import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart'; import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
@ -23,6 +26,7 @@ import 'package:hmg_patient_app/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart'; import 'PrescriptionIDeliveryAddressPage.dart';
@ -33,6 +37,8 @@ class PrescriptionItemsPage extends StatelessWidget {
PrescriptionItemsPage({Key? key, required this.prescriptions}); PrescriptionItemsPage({Key? key, required this.prescriptions});
PrescriptionsService _prescriptionsService = locator<PrescriptionsService>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -409,26 +415,56 @@ class PrescriptionItemsPage extends StatelessWidget {
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: Row(
TranslationBase.of(context).resendOrder, mainAxisSize: MainAxisSize.min,
() { children: [
if (model.isMedDeliveryAllowed == false) { Expanded(
AppToast.showErrorToast(message: TranslationBase.of(context).prescriptionDeliveryError); child: DefaultButton(
} else { TranslationBase.of(context).resendOrder,
Navigator.push( () {
context, if (model.isMedDeliveryAllowed == false) {
FadePage( AppToast.showErrorToast(message: TranslationBase.of(context).prescriptionDeliveryError);
page: PrescriptionDeliveryAddressPage( } else {
prescriptions: prescriptions, Navigator.push(
prescriptionReportList: model.prescriptionReportList, context,
prescriptionReportEnhList: model.prescriptionReportEnhList, FadePage(
), page: PrescriptionDeliveryAddressPage(
), prescriptions: prescriptions,
); prescriptionReportList: model.prescriptionReportList,
} prescriptionReportEnhList: model.prescriptionReportEnhList,
}, ),
color: model.isMedDeliveryAllowed == false ? Color(0xff575757) : Color(0xff359846), ),
disabledColor: Color(0xff575757), );
}
},
color: model.isMedDeliveryAllowed == false ? Color(0xff575757) : Color(0xff359846),
disabledColor: Color(0xff575757),
),
),
SizedBox(width: 10),
Expanded(
child: DefaultButton(
TranslationBase.of(context).medicationInstructions,
() async {
GifLoaderDialogUtils.showMyDialog(context);
await _prescriptionsService
.getMedicationsInstructionsPDF(setupID: prescriptions.setupID!, projectID: prescriptions.projectID!, appointmentNo: prescriptions.appointmentNo.toString())
.then((val) {
if (_prescriptionsService.hasError) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: _prescriptionsService.error ?? "Unable to get PDF.");
} else {
GifLoaderDialogUtils.hideDialog(context);
print(_prescriptionsService.prescriptionInstructionsPDFLink);
launchUrl(Uri.parse(_prescriptionsService.prescriptionInstructionsPDFLink));
}
});
},
color: CustomColors.darkOrange,
fontSize: 14.0,
),
),
],
), ),
), ),
], ],

@ -3530,6 +3530,7 @@ class TranslationBase {
String get normal => localizedValues["normal"][locale.languageCode]; String get normal => localizedValues["normal"][locale.languageCode];
String get low => localizedValues["low"][locale.languageCode]; String get low => localizedValues["low"][locale.languageCode];
String get verifyWithBiometric => localizedValues["verify-with-biometric"][locale.languageCode]; String get verifyWithBiometric => localizedValues["verify-with-biometric"][locale.languageCode];
String get medicationInstructions => localizedValues["medicationInstructions"][locale.languageCode];
String getTranslation(String label) { String getTranslation(String label) {
switch (label) { switch (label) {

@ -116,7 +116,11 @@ class Utils {
static Future<bool> checkConnection({bool bypassConnectionCheck = false}) async { static Future<bool> checkConnection({bool bypassConnectionCheck = false}) async {
if (bypassConnectionCheck) return true; if (bypassConnectionCheck) return true;
List<ConnectivityResult> connectivityResult = await (Connectivity().checkConnectivity()); List<ConnectivityResult> connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult.contains(ConnectivityResult.mobile) || connectivityResult.contains(ConnectivityResult.wifi)) { if (connectivityResult.contains(ConnectivityResult.mobile) ||
connectivityResult.contains(ConnectivityResult.wifi) ||
connectivityResult.contains(ConnectivityResult.ethernet) ||
connectivityResult.contains(ConnectivityResult.bluetooth) ||
connectivityResult.contains(ConnectivityResult.vpn)) {
return true; return true;
} else { } else {
return false; return false;
@ -145,7 +149,7 @@ class Utils {
title: TranslationBase.of(context).covidConsentHeader, title: TranslationBase.of(context).covidConsentHeader,
message: message, message: message,
onTap: onTap!, onTap: onTap!,
onConsentDeclined: onConsentDeclined!, onConsentDeclined: onConsentDeclined ?? () {},
)); ));
} }

@ -1,3 +1,4 @@
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:hmg_patient_app/core/model/labs/patient_lab_orders.dart'; import 'package:hmg_patient_app/core/model/labs/patient_lab_orders.dart';
import 'package:hmg_patient_app/core/viewModels/medical/labs_view_model.dart'; import 'package:hmg_patient_app/core/viewModels/medical/labs_view_model.dart';
import 'package:hmg_patient_app/core/viewModels/project_view_model.dart'; import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
@ -22,7 +23,8 @@ class LaboratoryResultWidget extends StatefulWidget {
final bool showConfirmMessageDialog; final bool showConfirmMessageDialog;
final LabsViewModel labmodel; final LabsViewModel labmodel;
const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.projectName, this.patientLabOrder, this.showConfirmMessageDialog = true,required this.labmodel}) : super(key: key); const LaboratoryResultWidget({Key? key, this.onTap, this.billNo, this.details, this.orderNo, this.projectName, this.patientLabOrder, this.showConfirmMessageDialog = true, required this.labmodel})
: super(key: key);
@override @override
_LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState(); _LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState();
@ -41,18 +43,16 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
this.model = widget.labmodel; this.model = widget.labmodel;
} }
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
var oldStateTablateScreenState = isTabletScreen; var oldStateTablateScreenState = isTabletScreen;
isTabletScreen = isTablet(context); isTabletScreen = isTablet(context);
if(isTabletScreen != oldStateTablateScreenState); if (isTabletScreen != oldStateTablateScreenState) ;
{ {
model?.recalculatePercentage(isTabletScreen); model?.recalculatePercentage(isTabletScreen);
} }
} }
bool isTablet(BuildContext context) { bool isTablet(BuildContext context) {
@ -70,7 +70,8 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
onModelReady: (_) { onModelReady: (_) {
print("the length of in on model Ready ${model?.patientLabSpecialResult.length}"); print("the length of in on model Ready ${model?.patientLabSpecialResult.length}");
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
model?.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!, isTablet: isTabletScreen); model?.getPatientLabResult(
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!, isTablet: isTabletScreen);
}); });
labSpecialResult = widget.details ?? "No Data Available"; labSpecialResult = widget.details ?? "No Data Available";
}, },
@ -190,8 +191,8 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
if (_isShowMore) if (_isShowMore)
Container( Container(
width: double.infinity, width: double.infinity,
child: Html( child: HtmlWidget(
data: labSpecialResult ?? TranslationBase.of(context).noDataAvailable, labSpecialResult ?? TranslationBase.of(context).noDataAvailable,
), ),
), ),
], ],

@ -390,7 +390,7 @@ class ItemResultCardWidgetWithParams extends StatelessWidget {
// child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), // child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
// ), // ),
Visibility( Visibility(
visible: true, visible: shouldShowResultBarAndGraph,
child: GestureDetector( child: GestureDetector(
onTap: onButtonPressed, onTap: onButtonPressed,
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),

@ -38,9 +38,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 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

@ -1,8 +1,8 @@
name: hmg_patient_app name: hmg_patient_app
description: A new Flutter application. description: A new Flutter application.
version: 4.6.017+1 version: 4.6.017+4
#version: 4.6.0972+40500972 #version: 4.6.0976+40500976
environment: environment:
# sdk: ">=3.0.0 <3.13.0" # sdk: ">=3.0.0 <3.13.0"
@ -41,7 +41,7 @@ dependencies:
url_launcher: ^6.3.1 url_launcher: ^6.3.1
url_launcher_ios: ^6.3.2 url_launcher_ios: ^6.3.2
shared_preferences: ^2.5.3 shared_preferences: ^2.5.3
# fluttertoast: ^8.0.8 # fluttertoast: ^8.0.8
fluttertoast: ^8.2.12 fluttertoast: ^8.2.12
flutter_progress_hud: ^2.0.2 flutter_progress_hud: ^2.0.2
@ -142,8 +142,8 @@ dependencies:
google_fonts: ^6.2.1 google_fonts: ^6.2.1
google_maps_place_picker_mb_v2: ^1.0.1 google_maps_place_picker_mb_v2: ^1.0.1
# vital_sign_camera: # vital_sign_camera:
# path: ./packages/vital_sign_camera # path: ./packages/vital_sign_camera
readmore: ^3.0.0 readmore: ^3.0.0
dependency_overrides: dependency_overrides:

Loading…
Cancel
Save