Merge branch 'haroon-new-design' into 'development_new_design_2.0'

Haroon new design

See merge request Cloud_Solution/diplomatic-quarter!485
merge-requests/486/merge
haroon amjad 4 years ago
commit 96684d77e0

@ -19,12 +19,15 @@ const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// // Pharmacy Production URLs // // Pharmacy Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -462,6 +465,7 @@ const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
// PRESCRIPTION RC SERVICES // PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add"; const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list"; const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update'; const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';

@ -1,26 +1,27 @@
class AmbulanceRequestOrdersModel { class AmbulanceRequestOrdersModel {
String statusText; String statusText;
int paymentStatus; num paymentStatus;
dynamic clientRequestid; dynamic clientRequestid;
dynamic paymentStatusText; dynamic paymentStatusText;
dynamic projectName; dynamic projectName;
String nearestProjectName; String nearestProjectName;
double paymentAmount; num paymentAmount;
WFOrder wFOrder; WFOrder wFOrder;
String serviceText; String serviceText;
bool isSentForApproval; bool isSentForApproval;
int exaCartOrderId; num exaCartOrderId;
String exaCartGUID;
bool isTimer; bool isTimer;
int timeSeconds; num timeSeconds;
int totalPendingSeconds; num totalPendingSeconds;
int timeMinute; num timeMinute;
int timeHour; num timeHour;
int timeTotalSeconds; num timeTotalSeconds;
int timeTotalMinute; num timeTotalMinute;
int timeTotalHour; num timeTotalHour;
dynamic approvalStatus; dynamic approvalStatus;
bool isActive; bool isActive;
int clickButton; num clickButton;
dynamic orderHistory; dynamic orderHistory;
String pickupLocation; String pickupLocation;
String dropOffLocation; String dropOffLocation;
@ -28,22 +29,21 @@ class AmbulanceRequestOrdersModel {
String doctorName; String doctorName;
String branch; String branch;
String time; String time;
dynamic notes; String notes;
int id; num iD;
String patientId; num patientId;
int patientOutSa; num patientOutSa;
bool isOutPatient; bool isOutPatient;
int projectId; num projectId;
int nearestProjectId; num nearestProjectId;
dynamic longitude; dynamic longitude;
dynamic latitude; dynamic latitude;
dynamic appointmentNo; dynamic appointmentNo;
dynamic dischargeId; dynamic dischargeId;
int statusId; num statusId;
int serviceId; num serviceId;
int channel; num channel;
Orderpayment orderpayment; Orderpayment orderpayment;
dynamic orderselectedservice;
dynamic wforder; dynamic wforder;
dynamic orderapprovalobj; dynamic orderapprovalobj;
String created; String created;
@ -54,266 +54,293 @@ class AmbulanceRequestOrdersModel {
AmbulanceRequestOrdersModel( AmbulanceRequestOrdersModel(
{this.statusText, {this.statusText,
this.paymentStatus, this.paymentStatus,
this.clientRequestid, this.clientRequestid,
this.paymentStatusText, this.paymentStatusText,
this.projectName, this.projectName,
this.nearestProjectName, this.nearestProjectName,
this.paymentAmount, this.paymentAmount,
this.wFOrder, this.wFOrder,
this.serviceText, this.serviceText,
this.isSentForApproval, this.isSentForApproval,
this.exaCartOrderId, this.exaCartOrderId,
this.isTimer, this.exaCartGUID,
this.timeSeconds, this.isTimer,
this.totalPendingSeconds, this.timeSeconds,
this.timeMinute, this.totalPendingSeconds,
this.timeHour, this.timeMinute,
this.timeTotalSeconds, this.timeHour,
this.timeTotalMinute, this.timeTotalSeconds,
this.timeTotalHour, this.timeTotalMinute,
this.approvalStatus, this.timeTotalHour,
this.isActive, this.approvalStatus,
this.clickButton, this.isActive,
this.orderHistory, this.clickButton,
this.pickupLocation, this.orderHistory,
this.dropOffLocation, this.pickupLocation,
this.clinicName, this.dropOffLocation,
this.doctorName, this.clinicName,
this.branch, this.doctorName,
this.time, this.branch,
this.notes, this.time,
this.id, this.notes,
this.patientId, this.iD,
this.patientOutSa, this.patientId,
this.isOutPatient, this.patientOutSa,
this.projectId, this.isOutPatient,
this.nearestProjectId, this.projectId,
this.longitude, this.nearestProjectId,
this.latitude, this.longitude,
this.appointmentNo, this.latitude,
this.dischargeId, this.appointmentNo,
this.statusId, this.dischargeId,
this.serviceId, this.statusId,
this.channel, this.serviceId,
this.orderpayment, this.channel,
this.orderselectedservice, this.orderpayment,
this.wforder, this.wforder,
this.orderapprovalobj, this.orderapprovalobj,
this.created, this.created,
this.createdBy, this.createdBy,
this.modified, this.modified,
this.modifiedBy, this.modifiedBy,
this.isDeleted}); this.isDeleted});
AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) { AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) {
statusText = json['statusText']; statusText = json['StatusText'];
paymentStatus = json['paymentStatus']; paymentStatus = json['PaymentStatus'];
clientRequestid = json['clientRequestid']; clientRequestid = json['ClientRequestid'];
paymentStatusText = json['paymentStatusText']; paymentStatusText = json['PaymentStatusText'];
projectName = json['projectName']; projectName = json['ProjectName'];
nearestProjectName = json['nearestProjectName']; nearestProjectName = json['NearestProjectName'];
paymentAmount = json['paymentAmount']; paymentAmount = json['PaymentAmount'];
wFOrder = json['wF_order'] != null ? new WFOrder.fromJson(json['wF_order']) : null; wFOrder = json['WF_order'] != null
serviceText = json['serviceText']; ? new WFOrder.fromJson(json['WF_order'])
: null;
serviceText = json['ServiceText'];
isSentForApproval = json['isSentForApproval']; isSentForApproval = json['isSentForApproval'];
exaCartOrderId = json['exaCart_OrderId']; exaCartOrderId = json['ExaCart_OrderId'];
exaCartGUID = json['ExaCart_GUID'];
isTimer = json['isTimer']; isTimer = json['isTimer'];
timeSeconds = json['timeSeconds']; timeSeconds = json['TimeSeconds'];
totalPendingSeconds = json['totalPendingSeconds']; totalPendingSeconds = json['TotalPendingSeconds'];
timeMinute = json['timeMinute']; timeMinute = json['TimeMinute'];
timeHour = json['timeHour']; timeHour = json['TimeHour'];
timeTotalSeconds = json['timeTotalSeconds']; timeTotalSeconds = json['TimeTotalSeconds'];
timeTotalMinute = json['timeTotalMinute']; timeTotalMinute = json['TimeTotalMinute'];
timeTotalHour = json['timeTotalHour']; timeTotalHour = json['TimeTotalHour'];
approvalStatus = json['approvalStatus']; approvalStatus = json['ApprovalStatus'];
isActive = json['isActive']; isActive = json['isActive'];
clickButton = json['clickButton']; clickButton = json['ClickButton'];
orderHistory = json['orderHistory']; orderHistory = json['OrderHistory'];
pickupLocation = json['pickupLocation']; pickupLocation = json['PickupLocation'];
dropOffLocation = json['dropOffLocation']; dropOffLocation = json['DropOffLocation'];
clinicName = json['clinicName']; clinicName = json['clinicName'];
doctorName = json['doctorName']; doctorName = json['DoctorName'];
branch = json['branch']; branch = json['Branch'];
time = json['time']; time = json['Time'];
notes = json['notes']; notes = json['Notes'];
id = json['id']; iD = json['ID'];
patientId = json['patientId']; patientId = json['PatientId'];
patientOutSa = json['patientOutSa']; patientOutSa = json['PatientOutSa'];
isOutPatient = json['isOutPatient']; isOutPatient = json['IsOutPatient'];
projectId = json['projectId']; projectId = json['ProjectId'];
nearestProjectId = json['nearestProjectId']; nearestProjectId = json['NearestProjectId'];
longitude = json['longitude']; longitude = json['Longitude'];
latitude = json['latitude']; latitude = json['Latitude'];
appointmentNo = json['appointmentNo']; appointmentNo = json['AppointmentNo'];
dischargeId = json['dischargeId']; dischargeId = json['DischargeId'];
statusId = json['statusId']; statusId = json['StatusId'];
serviceId = json['serviceId']; serviceId = json['ServiceId'];
channel = json['channel']; channel = json['Channel'];
orderpayment = json['orderpayment'] != null ? new Orderpayment.fromJson(json['orderpayment']) : null; orderpayment = json['orderpayment'] != null
orderselectedservice = json['orderselectedservice']; ? new Orderpayment.fromJson(json['orderpayment'])
: null;
wforder = json['wforder']; wforder = json['wforder'];
orderapprovalobj = json['orderapprovalobj']; orderapprovalobj = json['orderapprovalobj'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
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['statusText'] = this.statusText; data['StatusText'] = this.statusText;
data['paymentStatus'] = this.paymentStatus; data['PaymentStatus'] = this.paymentStatus;
data['clientRequestid'] = this.clientRequestid; data['ClientRequestid'] = this.clientRequestid;
data['paymentStatusText'] = this.paymentStatusText; data['PaymentStatusText'] = this.paymentStatusText;
data['projectName'] = this.projectName; data['ProjectName'] = this.projectName;
data['nearestProjectName'] = this.nearestProjectName; data['NearestProjectName'] = this.nearestProjectName;
data['paymentAmount'] = this.paymentAmount; data['PaymentAmount'] = this.paymentAmount;
if (this.wFOrder != null) { if (this.wFOrder != null) {
data['wF_order'] = this.wFOrder.toJson(); data['WF_order'] = this.wFOrder.toJson();
} }
data['serviceText'] = this.serviceText; data['ServiceText'] = this.serviceText;
data['isSentForApproval'] = this.isSentForApproval; data['isSentForApproval'] = this.isSentForApproval;
data['exaCart_OrderId'] = this.exaCartOrderId; data['ExaCart_OrderId'] = this.exaCartOrderId;
data['ExaCart_GUID'] = this.exaCartGUID;
data['isTimer'] = this.isTimer; data['isTimer'] = this.isTimer;
data['timeSeconds'] = this.timeSeconds; data['TimeSeconds'] = this.timeSeconds;
data['totalPendingSeconds'] = this.totalPendingSeconds; data['TotalPendingSeconds'] = this.totalPendingSeconds;
data['timeMinute'] = this.timeMinute; data['TimeMinute'] = this.timeMinute;
data['timeHour'] = this.timeHour; data['TimeHour'] = this.timeHour;
data['timeTotalSeconds'] = this.timeTotalSeconds; data['TimeTotalSeconds'] = this.timeTotalSeconds;
data['timeTotalMinute'] = this.timeTotalMinute; data['TimeTotalMinute'] = this.timeTotalMinute;
data['timeTotalHour'] = this.timeTotalHour; data['TimeTotalHour'] = this.timeTotalHour;
data['approvalStatus'] = this.approvalStatus; data['ApprovalStatus'] = this.approvalStatus;
data['isActive'] = this.isActive; data['isActive'] = this.isActive;
data['clickButton'] = this.clickButton; data['ClickButton'] = this.clickButton;
data['orderHistory'] = this.orderHistory; data['OrderHistory'] = this.orderHistory;
data['pickupLocation'] = this.pickupLocation; data['PickupLocation'] = this.pickupLocation;
data['dropOffLocation'] = this.dropOffLocation; data['DropOffLocation'] = this.dropOffLocation;
data['clinicName'] = this.clinicName; data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['branch'] = this.branch; data['Branch'] = this.branch;
data['time'] = this.time; data['Time'] = this.time;
data['notes'] = this.notes; data['Notes'] = this.notes;
data['id'] = this.id; data['ID'] = this.iD;
data['patientId'] = this.patientId; data['PatientId'] = this.patientId;
data['patientOutSa'] = this.patientOutSa; data['PatientOutSa'] = this.patientOutSa;
data['isOutPatient'] = this.isOutPatient; data['IsOutPatient'] = this.isOutPatient;
data['projectId'] = this.projectId; data['ProjectId'] = this.projectId;
data['nearestProjectId'] = this.nearestProjectId; data['NearestProjectId'] = this.nearestProjectId;
data['longitude'] = this.longitude; data['Longitude'] = this.longitude;
data['latitude'] = this.latitude; data['Latitude'] = this.latitude;
data['appointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['dischargeId'] = this.dischargeId; data['DischargeId'] = this.dischargeId;
data['statusId'] = this.statusId; data['StatusId'] = this.statusId;
data['serviceId'] = this.serviceId; data['ServiceId'] = this.serviceId;
data['channel'] = this.channel; data['Channel'] = this.channel;
if (this.orderpayment != null) { if (this.orderpayment != null) {
data['orderpayment'] = this.orderpayment.toJson(); data['orderpayment'] = this.orderpayment.toJson();
} }
data['orderselectedservice'] = this.orderselectedservice;
data['wforder'] = this.wforder; data['wforder'] = this.wforder;
data['orderapprovalobj'] = this.orderapprovalobj; data['orderapprovalobj'] = this.orderapprovalobj;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }
class WFOrder { class WFOrder {
dynamic wfButtonsDTO; Null wfButtonsDTO;
int id; num iD;
int orderId; num orderId;
int previousStep; num previousStep;
int nextStep; num nextStep;
int serviceId; num serviceId;
dynamic order; Null order;
String created; String created;
dynamic createdBy; Null createdBy;
dynamic modified; Null modified;
dynamic modifiedBy; Null modifiedBy;
bool isDeleted; bool isDeleted;
WFOrder({this.wfButtonsDTO, this.id, this.orderId, this.previousStep, this.nextStep, this.serviceId, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted}); WFOrder(
{this.wfButtonsDTO,
this.iD,
this.orderId,
this.previousStep,
this.nextStep,
this.serviceId,
this.order,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
WFOrder.fromJson(Map<String, dynamic> json) { WFOrder.fromJson(Map<String, dynamic> json) {
wfButtonsDTO = json['wf_ButtonsDTO']; wfButtonsDTO = json['wf_ButtonsDTO'];
id = json['id']; iD = json['ID'];
orderId = json['orderId']; orderId = json['OrderId'];
previousStep = json['previousStep']; previousStep = json['PreviousStep'];
nextStep = json['nextStep']; nextStep = json['NextStep'];
serviceId = json['serviceId']; serviceId = json['ServiceId'];
order = json['order']; order = json['Order'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
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['wf_ButtonsDTO'] = this.wfButtonsDTO; data['wf_ButtonsDTO'] = this.wfButtonsDTO;
data['id'] = this.id; data['ID'] = this.iD;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['previousStep'] = this.previousStep; data['PreviousStep'] = this.previousStep;
data['nextStep'] = this.nextStep; data['NextStep'] = this.nextStep;
data['serviceId'] = this.serviceId; data['ServiceId'] = this.serviceId;
data['order'] = this.order; data['Order'] = this.order;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }
class Orderpayment { class Orderpayment {
int id; num iD;
int orderId; num orderId;
dynamic clientRequestId; Null clientRequestId;
double totalAmount; num totalAmount;
int paymentStatus; num paymentStatus;
dynamic order; Null order;
String created; String created;
dynamic createdBy; Null createdBy;
dynamic modified; Null modified;
dynamic modifiedBy; Null modifiedBy;
bool isDeleted; bool isDeleted;
Orderpayment({this.id, this.orderId, this.clientRequestId, this.totalAmount, this.paymentStatus, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted}); Orderpayment(
{this.iD,
this.orderId,
this.clientRequestId,
this.totalAmount,
this.paymentStatus,
this.order,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
Orderpayment.fromJson(Map<String, dynamic> json) { Orderpayment.fromJson(Map<String, dynamic> json) {
id = json['id']; iD = json['ID'];
orderId = json['orderId']; orderId = json['OrderId'];
clientRequestId = json['clientRequestId']; clientRequestId = json['ClientRequestId'];
totalAmount = json['totalAmount']; totalAmount = json['TotalAmount'];
paymentStatus = json['paymentStatus']; paymentStatus = json['PaymentStatus'];
order = json['order']; order = json['Order'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
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['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['clientRequestId'] = this.clientRequestId; data['ClientRequestId'] = this.clientRequestId;
data['totalAmount'] = this.totalAmount; data['TotalAmount'] = this.totalAmount;
data['paymentStatus'] = this.paymentStatus; data['PaymentStatus'] = this.paymentStatus;
data['order'] = this.order; data['Order'] = this.order;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }

@ -10,7 +10,7 @@ class PatientER_RC {
String sessionID; String sessionID;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int deviceTypeID; int deviceTypeID;
String patientID; int patientID;
String tokenID; String tokenID;
int patientTypeID; int patientTypeID;
int patientType; int patientType;

@ -1,5 +1,5 @@
class PatientERTransportationMethod { class PatientERTransportationMethod {
int id; int iD;
String serviceID; String serviceID;
int orderServiceID; int orderServiceID;
String text; String text;
@ -12,7 +12,7 @@ class PatientERTransportationMethod {
int quantity; int quantity;
PatientERTransportationMethod( PatientERTransportationMethod(
{this.id, {this.iD,
this.serviceID, this.serviceID,
this.orderServiceID, this.orderServiceID,
this.text, this.text,
@ -25,32 +25,32 @@ class PatientERTransportationMethod {
this.quantity}); this.quantity});
PatientERTransportationMethod.fromJson(Map<String, dynamic> json) { PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
id = json['id']; iD = json['ID'];
serviceID = json['serviceID']; serviceID = json['ServiceID'];
orderServiceID = json['orderServiceID']; orderServiceID = json['OrderServiceID'];
text = json['text']; text = json['Text'];
textN = json['textN']; textN = json['TextN'];
price = json['price']; price = json['Price'];
priceVAT = json['priceVAT']; priceVAT = json['PriceVAT'];
priceTotal = json['priceTotal']; priceTotal = json['PriceTotal'];
isEnabled = json['isEnabled']; isEnabled = json['IsEnabled'];
orderId = json['orderId']; orderId = json['OrderId'];
quantity = json['quantity']; quantity = json['Quantity'];
} }
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['serviceID'] = this.serviceID; data['ServiceID'] = this.serviceID;
data['orderServiceID'] = this.orderServiceID; data['OrderServiceID'] = this.orderServiceID;
data['text'] = this.text; data['Text'] = this.text;
data['textN'] = this.textN; data['TextN'] = this.textN;
data['price'] = this.price; data['Price'] = this.price;
data['priceVAT'] = this.priceVAT; data['PriceVAT'] = this.priceVAT;
data['priceTotal'] = this.priceTotal; data['PriceTotal'] = this.priceTotal;
data['isEnabled'] = this.isEnabled; data['IsEnabled'] = this.isEnabled;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['quantity'] = this.quantity; data['Quantity'] = this.quantity;
return data; return data;
} }
} }

@ -0,0 +1,52 @@
class PrescriptionInfoRCModel {
String itemDescription;
String image;
String sKU;
dynamic productId;
dynamic productName;
int quantity;
int orderId;
int totalPrice;
int dispenseQuantity;
dynamic itemhand;
PrescriptionInfoRCModel(
{this.itemDescription,
this.image,
this.sKU,
this.productId,
this.productName,
this.quantity,
this.orderId,
this.totalPrice,
this.dispenseQuantity,
this.itemhand});
PrescriptionInfoRCModel.fromJson(Map<String, dynamic> json) {
itemDescription = json['ItemDescription'];
image = json['image'];
sKU = json['SKU'];
productId = json['ProductId'];
productName = json['ProductName'];
quantity = json['Quantity'];
orderId = json['OrderId'];
totalPrice = json['TotalPrice'];
dispenseQuantity = json['DispenseQuantity'];
itemhand = json['itemhand'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemDescription'] = this.itemDescription;
data['image'] = this.image;
data['SKU'] = this.sKU;
data['ProductId'] = this.productId;
data['ProductName'] = this.productName;
data['Quantity'] = this.quantity;
data['OrderId'] = this.orderId;
data['TotalPrice'] = this.totalPrice;
data['DispenseQuantity'] = this.dispenseQuantity;
data['itemhand'] = this.itemhand;
return data;
}
}

@ -28,7 +28,7 @@ class CMCService extends BaseService {
hasError = false; hasError = false;
// RC IMPLEMENTATION // RC IMPLEMENTATION
await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear(); cmcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
@ -67,7 +67,7 @@ class CMCService extends BaseService {
Future getCmcAllPresOrdersRC() async { Future getCmcAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_ALL_CMC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear(); cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear(); cmcAllOrderDetail.clear();
@ -122,7 +122,7 @@ class CMCService extends BaseService {
Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(UPDATE_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -133,7 +133,7 @@ class CMCService extends BaseService {
Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async { Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
String reqId = ""; String reqId = "";
await baseAppClient.post(ADD_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
reqId = response['response'].toString(); reqId = response['response'].toString();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -38,7 +38,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(HHC_GET_ALL_SERVICES_RC + "?PatientID=" + user.patientID.toString(), onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(HHC_GET_ALL_SERVICES_RC + "?PatientID=" + user.patientID.toString(), isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcAllServicesList.clear(); hhcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data)); hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data));
@ -52,7 +52,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllPresOrdersRC() async { Future getHHCAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear(); hhcAllPresOrdersList.clear();
hhcAllOrderDetail.clear(); hhcAllOrderDetail.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
@ -106,7 +106,7 @@ class HomeHealthCareService extends BaseService {
Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(UPDATE_HHC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -127,7 +127,7 @@ class HomeHealthCareService extends BaseService {
Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async { Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
await baseAppClient.post(ADD_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_HHC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcResponse = response; hhcResponse = response;
requestNo = response["response"]; requestNo = response["response"];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -35,12 +35,20 @@ VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
{Map<String, dynamic> body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isExternal = false}) async { {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false}) async {
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
} else { } else {
url = BASE_URL + endPoint; if (isRCService)
url = RC_BASE_URL + endPoint;
else
url = BASE_URL + endPoint;
} }
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -376,12 +384,20 @@ class BaseAppClient {
Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text))); Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text)));
} }
get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, dynamic> queryParams, bool isExternal = false}) async { get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, dynamic> queryParams,
bool isExternal = false,
bool isRCService = false}) async {
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
} else { } else {
url = BASE_URL + endPoint; if (isRCService)
url = RC_BASE_URL + endPoint;
else
url = BASE_URL + endPoint;
} }
if (queryParams != null) { if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query; String queryString = Uri(queryParameters: queryParams).query;

@ -28,9 +28,9 @@ 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.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isExternal: false, onSuccess: (dynamic response, int statusCode) { await baseAppClient.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isExternal: false, onSuccess: (dynamic response, int statusCode) {
amModelList.clear(); amModelList.clear();
response['data']['transportationservices'].forEach((item) { response['response']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item)); amModelList.add(PatientERTransportationMethod.fromJson(item));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -69,18 +69,18 @@ class AmService extends BaseService {
pickUpRequestPresOrder = null; pickUpRequestPresOrder = null;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['patientId'] = patientID.toString(); body['patientId'] = patientID;
body['PatientID'] = patientID.toString(); body['PatientID'] = patientID;
await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, isRCService: true, onSuccess: (dynamic response, int statusCode) {
patientAmbulanceRequestOrdersList.clear(); patientAmbulanceRequestOrdersList.clear();
hasPendingOrder = false; hasPendingOrder = false;
pendingOrderID = 0; pendingOrderID = 0;
pendingAmbulanceRequestOrder = null; pendingAmbulanceRequestOrder = null;
response['data'].forEach((item) { response['response'].forEach((item) {
patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item)); patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item));
if (item['statusId'] == 1) { if (item['StatusId'] == 1) {
hasPendingOrder = true; hasPendingOrder = true;
pendingOrderID = item['orderpayment']['id']; pendingOrderID = item['orderpayment']['id'];
pendingOrderStatus = item['statusText']; pendingOrderStatus = item['statusText'];
@ -127,14 +127,14 @@ class AmService extends BaseService {
}, body: body); }, body: body);
} }
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async { Future updatePressOrderRC({@required int presOrderID, @required int patientID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Id'] = presOrderID; body['Id'] = presOrderID;
body['StatusId'] = 6; body['StatusId'] = 6;
body['ClickButton'] = 14; body['ClickButton'] = 14;
body['PatientID'] = patientID; body['PatientID'] = patientID;
await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -146,7 +146,7 @@ class AmService extends BaseService {
var body = patientER.toJson(); var body = patientER.toJson();
print(body); print(body);
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_info_rc_model.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -18,6 +19,7 @@ class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List(); List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List(); List<PrescriptionReportINP> prescriptionReportListINP = List();
List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List(); List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List();
List<PrescriptionInfoRCModel> prescriptionsOrderListRC = List();
var isMedDeliveryAllowed; var isMedDeliveryAllowed;
Future getPrescriptions() async { Future getPrescriptions() async {
@ -49,6 +51,20 @@ class PrescriptionsService extends BaseService {
}, body: body); }, body: body);
} }
Future getPrescriptionsInfoRC(int orderID, dynamic patientID) async {
prescriptionsOrderListRC.clear();
Map<String, dynamic> body = Map();
body['ID'] = orderID;
await baseAppClient.post(GET_ALL_PRESCRIPTION_INFO_RC + "?PatientId=" + patientID.toString(), onSuccess: (dynamic response, int statusCode) {
response['response']['report'].forEach((prescriptionsOrder) {
prescriptionsOrderListRC.add(PrescriptionInfoRCModel.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPrescriptionsOrdersRC() async { Future getPrescriptionsOrdersRC() async {
prescriptionsOrderList.clear(); prescriptionsOrderList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -162,7 +178,6 @@ class PrescriptionsService extends BaseService {
List<PrescriptionReportEnh> prescriptionReportEnhList = List(); List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false; bool isInPatient = false;
prescriptionsList.forEach((element) { prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") { if (prescriptionsOrder.appointmentNo == "0") {
@ -184,8 +199,6 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient; isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
} }
} }
}); });
@ -212,6 +225,19 @@ class PrescriptionsService extends BaseService {
}, body: _requestPrescriptionReportEnh.toJson()); }, body: _requestPrescriptionReportEnh.toJson());
} }
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['Id'] = presOrderID;
body['StatusId'] = 6;
body['ClickButton'] = 14;
body['PatientID'] = patientID;
await baseAppClient.post(UPDATE_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();

@ -106,7 +106,7 @@ class AmRequestViewModel extends BaseViewModel {
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
// await _amService.updatePressOrder(presOrderID: presOrderID); // await _amService.updatePressOrder(presOrderID: presOrderID);
await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID.toString()); await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID);
if (_amService.hasError) { if (_amService.hasError) {
error = _amService.error; error = _amService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -62,7 +62,7 @@ class RRTViewModel extends BaseViewModel {
// body['OrderServiceID'] = 5; // body['OrderServiceID'] = 5;
var localRes; var localRes;
int requestNo; int requestNo;
await _service.baseAppClient.post(ADD_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(ADD_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
requestNo = response['response']; requestNo = response['response'];
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
@ -94,7 +94,7 @@ class RRTViewModel extends BaseViewModel {
} }
Future<_RRTServiceData> getAllOrdersRC() async { Future<_RRTServiceData> getAllOrdersRC() async {
await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, body: {}, onSuccess: (response, statusCode) { await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, isRCService: true, body: {}, onSuccess: (response, statusCode) {
var data = response["response"]; var data = response["response"];
rrtServiceData.completedOrders.clear(); rrtServiceData.completedOrders.clear();
rrtServiceData.pendingOrders.clear(); rrtServiceData.pendingOrders.clear();
@ -161,7 +161,7 @@ class RRTViewModel extends BaseViewModel {
Future<bool> cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async { Future<bool> cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async {
Map<String, dynamic> body = {"Id": order.iD, "ClickButton": 16}; Map<String, dynamic> body = {"Id": order.iD, "ClickButton": 16};
var success = false; var success = false;
await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
success = true; success = true;
rrtServiceData.pendingOrders.remove(order); rrtServiceData.pendingOrders.remove(order);
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_info_rc_model.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -31,6 +32,10 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PrescriptionInfoRCModel> get prescriptionsOrderListRC => _prescriptionsService.prescriptionsOrderListRC;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) { List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) {
@ -131,8 +136,6 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder);
@ -144,9 +147,21 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
getPrescriptionReportDetailsRC() async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionsInfoRC(4, 2001273);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.updatePressOrder(presOrderID: presOrderID); // await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
await _prescriptionsService.updatePressOrderRC(presOrderID: presOrderID);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -56,7 +56,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: ListView.separated( body: model.cmcAllPresOrders.length > 0 ? ListView.separated(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -178,7 +178,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 12), separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.cmcAllPresOrders.length), itemCount: model.cmcAllPresOrders.length) : getNoDataWidget(context),
); );
} }
} }

@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -34,8 +33,6 @@ class BloodDonationPage extends StatefulWidget {
} }
class _BloodDonationPageState extends State<BloodDonationPage> { class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
@ -43,10 +40,10 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
int _selectedHospitalIndex = 0; int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1; int _selectedGenderIndex = 1;
int _selectedBloodTypeIndex = 0; int _selectedBloodTypeIndex = 0;
String _selectedBloodType = "O+";
String amount = ""; String amount = "";
String email; String email;
PatientInfo _selectedPatientInfo;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
@ -71,7 +68,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
int getSelectedCityID(MyBalanceViewModel model) { int getSelectedCityID(MyBalanceViewModel model) {
int cityID = 1; int cityID = 1;
model.CitiesModelList.forEach((element) { model.CitiesModelList.forEach((element) {
if (element.description == model.bloodModelList[0].city) { if (element.description == model.bloodModelList[0].city) {
cityID = element.iD; cityID = element.iD;
@ -96,6 +92,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
_selectedHospital = citiesModel; _selectedHospital = citiesModel;
_selectedBloodType = model.bloodModelList[0].bloodGroup;
_selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
} else { } else {
_selectedHospital = model.CitiesModelList[0]; _selectedHospital = model.CitiesModelList[0];
} }
@ -168,7 +166,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
); );
}).withBorderedContainer, }).withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).bloodType, model.bloodModelList.isNotEmpty ? model.bloodModelList[0].bloodGroup : getBlood(_selectedBloodTypeIndex), () { CommonDropDownView(TranslationBase.of(context).bloodType, _selectedBloodType, () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("O+", 0), RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1), RadioSelectionDialogModel("O-", 1),
@ -188,6 +186,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
isScrollable: true, isScrollable: true,
onValueSelected: (index) { onValueSelected: (index) {
_selectedBloodTypeIndex = index; _selectedBloodTypeIndex = index;
_selectedBloodType = getBlood(index);
setState(() {}); setState(() {});
}, },
), ),
@ -321,6 +320,41 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
} }
} }
int getBloodIndex(String type) {
switch (type) {
case "O+":
return 0;
break;
case "O-":
return 1;
break;
case "AB+":
return 2;
break;
case "AB-":
return 3;
break;
case "A+":
return 4;
break;
case "A-":
return 5;
break;
case "B-":
return 6;
break;
case "B-":
return 7;
break;
case "B+":
return 8;
break;
default:
return 0;
}
}
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null) if (_selectedHospital != null)
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;

@ -168,7 +168,10 @@ class _AddMember extends State<AddMember> {
request.regionID = 1; request.regionID = 1;
} }
loading(true); loading(true);
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)); familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err){
loading(false);
AppToast.showErrorToast(message: err);
});
} }
sendActivationCode(result) { sendActivationCode(result) {

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart';
@ -20,8 +21,7 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override @override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
_AmbulanceRequestIndexPageState();
} }
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> { class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@ -37,8 +37,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
setState(() { setState(() {
currentIndex = tab; currentIndex = tab;
}); });
pageController.animateToPage(tab, pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
} }
@override @override
@ -53,7 +52,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
return AppScaffold( return AppScaffold(
body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
@ -69,9 +68,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
children: [ children: [
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).reqId, title: TranslationBase.of(context).reqId,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.iD.toString(),
.id
.toString(),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).status, title: TranslationBase.of(context).status,
@ -79,22 +76,19 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).pickupDate, title: TranslationBase.of(context).pickupDate,
value: getDate(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created), value: DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created)),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).pickupLocation, title: TranslationBase.of(context).pickupLocation,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.pickupLocation,
.pickupLocation,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).dropoffLocation, title: TranslationBase.of(context).dropoffLocation,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.dropOffLocation,
.dropOffLocation,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).transportMethod, title: TranslationBase.of(context).transportMethod,
value: widget value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText,
.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText,
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -111,9 +105,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).cancel, label: TranslationBase.of(context).cancel,
onTap: () { onTap: () {
widget.amRequestViewModel.updatePressOrder( widget.amRequestViewModel.updatePressOrder(presOrderID: widget.amRequestViewModel.pendingAmbulanceRequestOrder.iD);
presOrderID: widget.amRequestViewModel
.pendingAmbulanceRequestOrder.id);
}, },
), ),
) )
@ -122,7 +114,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
), ),
], ],
), ),
) )
: Column( : Column(
children: [ children: [
SizedBox( SizedBox(
@ -172,9 +164,4 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
), ),
); );
} }
String getDate(String date) {
return date.split("T")[0];
}
} }

@ -411,7 +411,7 @@ class _PickupLocationState extends State<PickupLocation> {
widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress; widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress;
widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID;
widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID.toString(); widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID;
widget.patientER_RC.transportationDetails.requesterIsOutSA = false; widget.patientER_RC.transportationDetails.requesterIsOutSA = false;
// widget.patientER.lineItemNo = 0; // widget.patientER.lineItemNo = 0;
widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;

@ -302,7 +302,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0; widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1; widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.id.toString(); widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.iD.toString();
widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod;
widget.patientER_RC.transportationDetails.pickupUrgency = 1; widget.patientER_RC.transportationDetails.pickupUrgency = 1;
// widget.patientER.orderServiceID = _orderService.getIdOrderService(); // widget.patientER.orderServiceID = _orderService.getIdOrderService();

@ -28,7 +28,7 @@ class OrderLogPage extends StatelessWidget {
children: [ children: [
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).reqId, title: TranslationBase.of(context).reqId,
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].id.toString(), value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].iD.toString(),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).orderStatus, title: TranslationBase.of(context).orderStatus,
@ -62,7 +62,7 @@ class OrderLogPage extends StatelessWidget {
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).cancel, label: TranslationBase.of(context).cancel,
onTap: () { onTap: () {
amRequestViewModel.updatePressOrder(presOrderID: amRequestViewModel.pendingAmbulanceRequestOrder.id); amRequestViewModel.updatePressOrder(presOrderID: amRequestViewModel.pendingAmbulanceRequestOrder.iD);
}, },
), ),
) )

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/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:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class RRTLogPage extends StatefulWidget { class RRTLogPage extends StatefulWidget {
final List<GetCMCAllOrdersResponseModel> orders; final List<GetCMCAllOrdersResponseModel> orders;
@ -36,13 +36,15 @@ class RRTLogPageState extends State<RRTLogPage> {
viewModel = vm, viewModel = vm,
}, },
builder: (ctx, vm, widgetState) { builder: (ctx, vm, widgetState) {
return ListView.builder( return widget.orders.length > 0
itemCount: widget.orders.length, ? ListView.builder(
padding: EdgeInsets.all(21), itemCount: widget.orders.length,
itemBuilder: (ctx, idx) { padding: EdgeInsets.all(21),
var order = widget.orders[idx]; itemBuilder: (ctx, idx) {
return RRTLogListItem(order, onCancel: deleteOrder); var order = widget.orders[idx];
}); return RRTLogListItem(order, onCancel: deleteOrder);
})
: getNoDataWidget(context);
}); });
} }

@ -1,12 +1,11 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -14,7 +13,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PrescriptionsHistoryDetailsPage extends StatelessWidget { class PrescriptionsHistoryDetailsPage extends StatelessWidget {
final PrescriptionsOrder prescriptionsOrder; final GetCMCAllOrdersResponseModel prescriptionsOrder;
PrescriptionsHistoryDetailsPage({Key key, this.prescriptionsOrder}); PrescriptionsHistoryDetailsPage({Key key, this.prescriptionsOrder});
@ -22,10 +21,10 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder), onModelReady: (model) => model.getPrescriptionReportDetailsRC(),
builder: (_, model, widget) { builder: (_, model, widget) {
int status = prescriptionsOrder.status; int status = prescriptionsOrder.statusId;
String _statusDisp = projectViewModel.isArabic ? prescriptionsOrder.descriptionN : prescriptionsOrder.description; String _statusDisp = prescriptionsOrder.statusText;
Color _color; Color _color;
if (status == 1) { if (status == 1) {
//pending //pending
@ -36,7 +35,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
} else if (status == 3) { } else if (status == 3) {
//completed //completed
_color = Color(0xff359846); _color = Color(0xff359846);
} else if (status == 4) { } else if (status == 4 || status == 6 || status == 7) {
//cancel // Rejected //cancel // Rejected
_color = Color(0xffD02127); _color = Color(0xffD02127);
} }
@ -109,13 +108,9 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(prescriptionsOrder.createdOn), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsOrder.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
Text(
DateUtil.formatDateToTimeLang(prescriptionsOrder.createdOn, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
], ],
) )
], ],
@ -134,7 +129,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)), borderRadius: BorderRadius.all(Radius.circular(30)),
child: Image.network( child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl, model.prescriptionsOrderListRC[index].image,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 48, width: 48,
height: 48, height: 48,
@ -144,9 +139,9 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
SizedBox(width: 14), SizedBox(width: 14),
Expanded( Expanded(
child: Text( child: Text(
(model.prescriptionReportEnhList[index].itemDescription.isNotEmpty (model.prescriptionsOrderListRC[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription ? model.prescriptionsOrderListRC[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '') : model.prescriptionsOrderListRC[index].itemDescription ?? '')
.toLowerCase() .toLowerCase()
.capitalizeFirstofEach, .capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
@ -155,7 +150,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
], ],
), ),
separatorBuilder: (context, index) => SizedBox(height: 12), separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.prescriptionReportEnhList.length) itemCount: model.prescriptionsOrderListRC.length)
], ],
), ),
), ),
@ -168,9 +163,10 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
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: DefaultButton(
TranslationBase.of(context).cancelOrder, TranslationBase.of(context).cancelOrder,
prescriptionsOrder.status != 1 // prescriptionsOrder.statusId != 1
? null // ? null
: () { // :
() {
showCDialog(model, context); showCDialog(model, context);
}, },
disabledColor: Color(0xff575757), disabledColor: Color(0xff575757),

@ -2,10 +2,12 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/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';
@ -52,17 +54,17 @@ class PrescriptionsHistoryPage extends StatelessWidget {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
// final result = await Navigator.push( final result = await Navigator.push(
// context, context,
// FadePage( FadePage(
// page: PrescriptionsHistoryDetailsPage( page: PrescriptionsHistoryDetailsPage(
// prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index], prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
// ), ),
// ), ),
// ); );
// if (result != null) { if (result != null) {
// showOrderLog(); showOrderLog();
// } }
}, },
child: Container( child: Container(
height: 65, height: 65,

@ -26,11 +26,21 @@ class LakumMainPage extends StatelessWidget {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) => model.getLacumData(), onModelReady: (model) async {
await model.getLacumData();
if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
navigateToLakumRegister(context);
} else {
if (model.lacumInformation.status == "Hold") {
Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
}
}
},
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).lakum, appBarTitle: TranslationBase.of(context).lakum,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,

Loading…
Cancel
Save