Updates in Ambulance Request & Covid test

merge-requests/367/head
haroon amjad 3 years ago
parent db128e5091
commit 5009e48f64

@ -160,11 +160,11 @@ class PatientER {
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA == 0 ? false : true;
data['SessionID'] = this.sessionID; data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID; data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID.toString();
data['TokenID'] = this.tokenID; data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID; data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;

@ -1,79 +1,56 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PatientERTransportationMethod { class PatientERTransportationMethod {
dynamic id; int id;
DateTime createDate; String serviceID;
DateTime lastEditDate; int orderServiceID;
dynamic createdBy; String text;
dynamic lastEditBy; String textN;
bool isActive;
String title;
String titleAR;
dynamic price; dynamic price;
dynamic isDefault; dynamic priceVAT;
dynamic visibility; dynamic priceTotal;
dynamic durationId; bool isEnabled;
String description; int orderId;
String descriptionAR; int quantity;
dynamic totalPrice;
dynamic vAT;
PatientERTransportationMethod( PatientERTransportationMethod(
{ {this.id,
this.id, this.serviceID,
this.createDate, this.orderServiceID,
this.lastEditDate, this.text,
this.createdBy, this.textN,
this.lastEditBy,
this.isActive,
this.title,
this.titleAR,
this.price, this.price,
this.isDefault, this.priceVAT,
this.visibility, this.priceTotal,
this.durationId, this.isEnabled,
this.description, this.orderId,
this.descriptionAR, this.quantity});
this.totalPrice,
this.vAT});
PatientERTransportationMethod.fromJson( PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
Map<String, dynamic> json) { id = json['id'];
id = json['Id']; serviceID = json['serviceID'];
createDate = DateUtil.convertStringToDate(json['CreateDate']); orderServiceID = json['orderServiceID'];
lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']); text = json['text'];
createdBy = json['CreatedBy']; textN = json['textN'];
lastEditBy = json['LastEditBy']; price = json['price'];
isActive = json['IsActive']; priceVAT = json['priceVAT'];
title = json['Title']; priceTotal = json['priceTotal'];
titleAR = json['TitleAR']; isEnabled = json['isEnabled'];
price = json['Price']; orderId = json['orderId'];
isDefault = json['isDefault']; quantity = json['quantity'];
visibility = json['Visibility'];
durationId = json['DurationId'];
description = json['Description'];
descriptionAR = json['DescriptionAR'];
totalPrice = json['TotalPrice'];
vAT = json['VAT'];
} }
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['Id'] = this.id; data['id'] = this.id;
data['CreateDate'] = this.createDate; data['serviceID'] = this.serviceID;
data['LastEditDate'] = this.lastEditDate; data['orderServiceID'] = this.orderServiceID;
data['CreatedBy'] = this.createdBy; data['text'] = this.text;
data['LastEditBy'] = this.lastEditBy; data['textN'] = this.textN;
data['IsActive'] = this.isActive; data['price'] = this.price;
data['Title'] = this.title; data['priceVAT'] = this.priceVAT;
data['TitleAR'] = this.titleAR; data['priceTotal'] = this.priceTotal;
data['Price'] = this.price; data['isEnabled'] = this.isEnabled;
data['isDefault'] = this.isDefault; data['orderId'] = this.orderId;
data['Visibility'] = this.visibility; data['quantity'] = this.quantity;
data['DurationId'] = this.durationId;
data['Description'] = this.description;
data['DescriptionAR'] = this.descriptionAR;
data['TotalPrice'] = this.totalPrice;
data['VAT'] = this.vAT;
return data; return data;
} }
} }

@ -118,7 +118,8 @@ class BaseAppClient {
} }
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); final jsonBody = json.encode(body);
print(jsonBody);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), body: json.encode(body), headers: headers); final response = await http.post(url.trim(), body: json.encode(body), headers: headers);

@ -1,11 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart'; import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../base_service.dart'; import '../base_service.dart';
class AmService extends BaseService { class AmService extends BaseService {
@ -22,16 +22,27 @@ class AmService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.post(GET_AMBULANCE_REQUEST, await baseAppClient.get(
onSuccess: (dynamic response, int statusCode) { GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(),
isExternal: false, onSuccess: (dynamic response, int statusCode) {
amModelList.clear(); amModelList.clear();
response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) { response['data']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item)); amModelList.add(PatientERTransportationMethod.fromJson(item));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); });
// await baseAppClient.post(GET_AMBULANCE_REQUEST,
// onSuccess: (dynamic response, int statusCode) {
// amModelList.clear();
// response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) {
// amModelList.add(PatientERTransportationMethod.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
} }
Future getPatientAllPresOrdersList() async { Future getPatientAllPresOrdersList() async {
@ -85,9 +96,8 @@ class AmService extends BaseService {
body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService(); body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER, await baseAppClient.post(UPDATE_PRESS_ORDER,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -96,10 +106,9 @@ class AmService extends BaseService {
Future insertERPressOrder({@required PatientER patientER}) async { Future insertERPressOrder({@required PatientER patientER}) async {
hasError = false; hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patientER.toJson()); }, body: patientER.toJson());

@ -36,9 +36,6 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance
.addPostFrameCallback((_) => getProjectsList(context));
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
@ -353,6 +350,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidProjectsList(context).then((res) { service.getCovidProjectsList(context).then((res) {
projectsList.clear();
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) {

@ -126,7 +126,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}', TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceVAT}',
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -167,7 +167,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceTotal}',
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,

@ -97,9 +97,9 @@ class _SelectTransportationMethodState
child: ListTile( child: ListTile(
title: Texts(projectViewModel.isArabic title: Texts(projectViewModel.isArabic
? widget.amRequestViewModel ? widget.amRequestViewModel
.amRequestModeList[index].titleAR .amRequestModeList[index].textN
: widget.amRequestViewModel : widget.amRequestViewModel
.amRequestModeList[index].title), .amRequestModeList[index].text),
leading: Radio( leading: Radio(
value: widget value: widget
.amRequestViewModel.amRequestModeList[index], .amRequestViewModel.amRequestModeList[index],
@ -317,10 +317,10 @@ class _SelectTransportationMethodState
_orderService.getIdOrderService(); _orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1; widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1; widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price; widget.patientER.cost = _erTransportationMethod.price.toDouble();
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0;
widget.patientER.totalPrice = widget.patientER.totalPrice =
_erTransportationMethod.totalPrice; _erTransportationMethod.priceTotal.toDouble();
widget.changeCurrentTab(1); widget.changeCurrentTab(1);
}); });
}, },

@ -44,7 +44,7 @@ class _SummaryState extends State<Summary> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), Texts('${widget.patientER.patientERTransportationMethod.text}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts(TranslationBase.of(context).directions,color: Colors.grey,),
@ -84,7 +84,7 @@ class _SummaryState extends State<Summary> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(TranslationBase.of(context).patientShareTotal+':'), Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}') Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceTotal}')
], ],
), ),
), ),

Loading…
Cancel
Save