diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 5d6bb39c..ee04df20 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -96,7 +96,6 @@
-
diff --git a/lib/config/config.dart b/lib/config/config.dart
index abe2ca0d..c697f9f9 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -19,8 +19,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:3334/';
-// var BASE_URL = 'https://uat.hmgwebservices.com/';
-var BASE_URL = 'https://hmgwebservices.com/';
+ var BASE_URL = 'https://uat.hmgwebservices.com/';
+// var BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@@ -272,6 +272,9 @@ var GET_OBGYNE_DOCTORS_LIST =
var OBGYNE_PROCEDURE_UPDATE =
"services/Patients.svc/REST/HIS_OBGYNEProcedure_Update";
+var GET_RRT_PROCEDURE_LIST =
+ "Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida";
+
var DOCTOR_SCHEDULE_URL =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
@@ -392,7 +395,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
-var VERSION_ID = 7.6;
+var VERSION_ID = 7.7;
var SETUP_ID = '91877';
var LANGUAGE = 2;
var PATIENT_OUT_SA = 0;
diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart
index 3a5846da..c63649cb 100644
--- a/lib/core/viewModels/er/rrt-view-model.dart
+++ b/lib/core/viewModels/er/rrt-view-model.dart
@@ -9,7 +9,9 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
+import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
+import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@@ -21,6 +23,8 @@ class _RRTServiceData {
List pendingOrders = [];
List completedOrders = [];
ServicePrice servicePrice;
+
+ // RRTProcedureList rrtProcedureList;
}
class RRTViewModel extends BaseViewModel {
@@ -28,15 +32,18 @@ class RRTViewModel extends BaseViewModel {
var _pharmacy_service = locator();
var _pharmacy_address_service = locator();
CustomerAddressesService _customerAddressesService = locator();
+ List rrtProcedureList = [];
List get addressesList => _customerAddressesService.addressesList;
_RRTServiceData rrtServiceData = _RRTServiceData();
Future<_RRTServiceData> loadRequiredData() async {
- await getServicePrice();
+ // await getServicePrice();
// await getAllOrders();
+ await getProcedureDetails();
await getAllOrdersRC();
+ // getProcedureDetails();
return rrtServiceData;
}
@@ -94,7 +101,7 @@ class RRTViewModel extends BaseViewModel {
}
Future<_RRTServiceData> getAllOrdersRC() async {
- await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, isRCService: true, body: {}, onSuccess: (response, statusCode) {
+ await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, isRCService: true, body: {}, onSuccess: (response, statusCode) {
var data = response["response"];
rrtServiceData.completedOrders.clear();
rrtServiceData.pendingOrders.clear();
@@ -113,6 +120,22 @@ class RRTViewModel extends BaseViewModel {
return rrtServiceData;
}
+ Future<_RRTServiceData> getProcedureDetails() async {
+ DoctorsListService service = new DoctorsListService();
+ await service.getRRTProcedures(15).then((res) {
+ rrtProcedureList.clear();
+ var data = res["Vida_ProcedureList"];
+ data.forEach((json) {
+ rrtProcedureList.add(VidaProcedureList.fromJson(json));
+ });
+ print(rrtProcedureList.length);
+ }).catchError((err) {
+ AppToast.showErrorToast(message: err);
+ print(err);
+ });
+ return rrtServiceData;
+ }
+
Future getOrderDetails() async {
return null;
}
diff --git a/lib/models/rrt/RRTProcedureList.dart b/lib/models/rrt/RRTProcedureList.dart
new file mode 100644
index 00000000..12b74ecf
--- /dev/null
+++ b/lib/models/rrt/RRTProcedureList.dart
@@ -0,0 +1,56 @@
+class RRTProcedureList {
+ List vidaProcedureList;
+
+ RRTProcedureList({this.vidaProcedureList});
+
+ RRTProcedureList.fromJson(Map json) {
+ if (json['Vida_ProcedureList'] != null) {
+ vidaProcedureList = [];
+ json['Vida_ProcedureList'].forEach((v) {
+ vidaProcedureList.add(new VidaProcedureList.fromJson(v));
+ });
+ }
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ if (this.vidaProcedureList != null) {
+ data['Vida_ProcedureList'] =
+ this.vidaProcedureList.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
+
+class VidaProcedureList {
+ num patientShare;
+ num patientShareWithTax;
+ num patientTaxAmount;
+ String procedureID;
+ String procedureName;
+
+ VidaProcedureList(
+ {this.patientShare,
+ this.patientShareWithTax,
+ this.patientTaxAmount,
+ this.procedureID,
+ this.procedureName});
+
+ VidaProcedureList.fromJson(Map json) {
+ patientShare = json['PatientShare'];
+ patientShareWithTax = json['PatientShareWithTax'];
+ patientTaxAmount = json['PatientTaxAmount'];
+ procedureID = json['ProcedureID'];
+ procedureName = json['ProcedureName'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['PatientShare'] = this.patientShare;
+ data['PatientShareWithTax'] = this.patientShareWithTax;
+ data['PatientTaxAmount'] = this.patientTaxAmount;
+ data['ProcedureID'] = this.procedureID;
+ data['ProcedureName'] = this.procedureName;
+ return data;
+ }
+}
diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart
index 62fa4745..b56e28d5 100644
--- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart
+++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart
@@ -67,7 +67,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS
return Center(child: CircularProgressIndicator());
// else if(viewModel.state == ViewState.Error)
- } else if (viewModel.rrtServiceData != null && viewModel.rrtServiceData.servicePrice != null) {
+ } else if (viewModel.rrtServiceData != null && viewModel.rrtProcedureList != null) {
return Column(
children: [tabBar(), Expanded(child: contentPager())],
);
@@ -127,7 +127,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS
onPageChanged: onPageChanged,
controller: pageController,
children: [
- RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders),
+ RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders, viewModel: viewModel),
RRTLogPage(orders: viewModel.rrtServiceData.completedOrders),
],
);
diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart
index b64c0fbf..40e8dce2 100644
--- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart
+++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart
@@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
+import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
@@ -28,8 +29,9 @@ import 'rrt-place-order.dart';
class RRTRequestPickupAddressPage extends StatefulWidget {
final ServicePrice servicePrice;
+ final VidaProcedureList selectedProcedure;
- RRTRequestPickupAddressPage({@required this.servicePrice});
+ RRTRequestPickupAddressPage({@required this.servicePrice, @required this.selectedProcedure});
@override
State createState() => RRTRequestPickupAddressPageState();
@@ -145,7 +147,6 @@ class RRTRequestPickupAddressPageState extends State confirmSelectLocationDialog(myAddresses),
@@ -259,6 +260,7 @@ class RRTRequestPickupAddressPageState extends State pendingOrders;
final ServicePrice servicePrice;
+ RRTViewModel viewModel;
- RRTRequestPage({this.pendingOrders, this.servicePrice});
+ RRTRequestPage({this.pendingOrders, this.servicePrice, this.viewModel});
@override
State createState() => RRTRequestPageState();
@@ -27,13 +30,20 @@ class RRTRequestPage extends StatefulWidget {
class RRTRequestPageState extends State {
bool acceptTerms = false;
- RRTViewModel viewModel;
+ VidaProcedureList selectedProcedure;
+
+ @override
+ void initState() {
+ // getProcedureDetails();
+ super.initState();
+ }
@override
Widget build(BuildContext context) {
return BaseView(
onModelReady: (vm) {
- viewModel = vm;
+ // viewModel = vm;
+ selectedProcedure = widget.viewModel.rrtProcedureList[0];
},
builder: (ctx, vm, widgetState) {
if (widget.pendingOrders.isNotEmpty)
@@ -53,10 +63,69 @@ class RRTRequestPageState extends State {
children: [
serviceDescription(context),
SizedBox(height: 20),
+ Container(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ ...List.generate(
+ widget.viewModel.rrtProcedureList.length,
+ (index) => Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SizedBox(
+ height: 1,
+ ),
+ Row(
+ children: [
+ Expanded(
+ flex: 1,
+ child: InkWell(
+ onTap: () {
+ setState(() {
+ selectedProcedure = widget.viewModel.rrtProcedureList[index];
+ // getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
+ });
+ },
+ child: Row(
+ children: [
+ Radio(
+ value: widget.viewModel.rrtProcedureList[index],
+ groupValue: selectedProcedure,
+ activeColor: Colors.red[800],
+ toggleable: true,
+ onChanged: (value) {
+ setState(() {
+ selectedProcedure = value;
+ print(selectedProcedure.procedureName);
+ // getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
+ });
+ },
+ ),
+ Expanded(
+ child: Text(
+ // projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
+ widget.viewModel.rrtProcedureList[index].procedureName,
+ style: TextStyle(
+ fontSize: 12.0,
+ letterSpacing: -0.48,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ )
+ ],
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
priceTable(context),
-
acceptPolicy(),
-
Container(height: 0.5, color: Theme.of(context).appBarTheme.color), // Seperator
Container(
@@ -90,15 +159,15 @@ class RRTRequestPageState extends State {
child: Text(
TranslationBase.of(context).rrtDDetails,
textAlign: TextAlign.justify,
- style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300),
+ style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w300),
),
);
Widget priceTable(BuildContext context) {
var radius = Radius.circular(8);
- String amount = widget.servicePrice.price.toString();
- String vat = widget.servicePrice.vat.toString();
- String total = widget.servicePrice.totalPrice.toString();
+ String amount = selectedProcedure.patientShare.toString();
+ String vat = selectedProcedure.patientTaxAmount.toString();
+ String total = selectedProcedure.patientShareWithTax.toString();
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
@@ -119,21 +188,21 @@ class RRTRequestPageState extends State {
Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}) {
return Container(
- height: 40,
+ height: 35,
margin: EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
- Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)),
+ Text(label, style: TextStyle(fontSize: 12, color: CustomColors.textColor, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)),
Spacer(),
Container(
- height: 40,
+ height: 35,
color: Theme.of(context).appBarTheme.color,
width: 0.5,
),
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25,
- child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal))),
+ child: Text(value, style: TextStyle(fontSize: 12, color: CustomColors.textColor, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal))),
],
),
);
@@ -150,7 +219,7 @@ class RRTRequestPageState extends State {
setState(() => acceptTerms = v);
}),
SizedBox(width: 10),
- Expanded(child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2)),
+ Expanded(child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 12, color: CustomColors.textColor), maxLines: 2)),
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width * 0.25,
@@ -187,7 +256,7 @@ class RRTRequestPageState extends State {
child: DefaultButton(
TranslationBase.of(context).next,
() {
- if (acceptTerms)
+ if (acceptTerms && selectedProcedure != null)
goToPickupAddress();
else
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
@@ -200,23 +269,37 @@ class RRTRequestPageState extends State {
);
}
+ getProcedureDetails() {
+ GifLoaderDialogUtils.showMyDialog(context);
+ DoctorsListService service = new DoctorsListService();
+ service.getRRTProcedures(15).then((res) {
+ GifLoaderDialogUtils.hideDialog(context);
+ print(res['Vida_ProcedureList']);
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ AppToast.showErrorToast(message: err);
+ print(err);
+ });
+ }
+
goToPickupAddress() async {
Navigator.push(
context,
FadePage(
page: RRTRequestPickupAddressPage(
servicePrice: widget.servicePrice,
+ selectedProcedure: selectedProcedure,
)));
}
deleteOrder(GetCMCAllOrdersResponseModel order) async {
GifLoaderDialogUtils.showMyDialog(context);
- var success = await viewModel.cancelOrderRC(order);
+ var success = await widget.viewModel.cancelOrderRC(order);
GifLoaderDialogUtils.hideDialog(context);
if (success)
setState(() {
widget.pendingOrders.remove(order);
});
- await viewModel.getAllOrdersRC();
+ await widget.viewModel.getAllOrdersRC();
}
}
diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart
index 63483490..606d9486 100644
--- a/lib/services/appointment_services/GetDoctorsList.dart
+++ b/lib/services/appointment_services/GetDoctorsList.dart
@@ -1545,4 +1545,18 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
+ Future