|
|
|
@ -4,6 +4,7 @@ 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/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 '../base_service.dart';
|
|
|
|
import '../base_service.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class AmService extends BaseService {
|
|
|
|
class AmService extends BaseService {
|
|
|
|
@ -35,6 +36,7 @@ class AmService extends BaseService {
|
|
|
|
Future getPatientAllPresOrdersList() async {
|
|
|
|
Future getPatientAllPresOrdersList() async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
hasPendingOrder = false;
|
|
|
|
hasPendingOrder = false;
|
|
|
|
|
|
|
|
pickUpRequestPresOrder = null;
|
|
|
|
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
|
|
|
|
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
patientAllPresOrdersList.clear();
|
|
|
|
patientAllPresOrdersList.clear();
|
|
|
|
@ -58,12 +60,11 @@ class AmService extends BaseService {
|
|
|
|
|
|
|
|
|
|
|
|
Future getOrderDetails() async {
|
|
|
|
Future getOrderDetails() async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
hasPendingOrder = false;
|
|
|
|
|
|
|
|
Map<String, dynamic> body = Map();
|
|
|
|
Map<String, dynamic> body = Map();
|
|
|
|
body['PresOrderID'] = pendingOrderID;
|
|
|
|
body['PresOrderID'] = pendingOrderID;
|
|
|
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID,
|
|
|
|
await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID,
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
patientAllPresOrdersList.clear();
|
|
|
|
|
|
|
|
response['PatientER_RRT_GetPickUpRequestByPresOrderIDList']
|
|
|
|
response['PatientER_RRT_GetPickUpRequestByPresOrderIDList']
|
|
|
|
.forEach((item) {
|
|
|
|
.forEach((item) {
|
|
|
|
pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item);
|
|
|
|
pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item);
|
|
|
|
@ -71,6 +72,23 @@ class AmService extends BaseService {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
hasError = true;
|
|
|
|
hasError = true;
|
|
|
|
super.error = error;
|
|
|
|
super.error = error;
|
|
|
|
}, body: Map());
|
|
|
|
}, body: body);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future updatePressOrder({@required int presOrderID}) async {
|
|
|
|
|
|
|
|
hasError = false;
|
|
|
|
|
|
|
|
Map<String, dynamic> body = Map();
|
|
|
|
|
|
|
|
body['PresOrderID'] = presOrderID;
|
|
|
|
|
|
|
|
body['EditedBy'] = 3;
|
|
|
|
|
|
|
|
body['RejectionReason'] = '';
|
|
|
|
|
|
|
|
body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService();
|
|
|
|
|
|
|
|
body['isDentalAllowedBackend'] = false;
|
|
|
|
|
|
|
|
await baseAppClient.post(UPDATE_PRESS_ORDER,
|
|
|
|
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
|
|
|
hasError = true;
|
|
|
|
|
|
|
|
super.error = error;
|
|
|
|
|
|
|
|
}, body: body);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|