Merge branch 'pharmacy-Fatima' into 'development'
Pharmacy fatima See merge request Cloud_Solution/diplomatic-quarter!249merge-requests/250/merge
commit
405f67be1e
@ -0,0 +1,157 @@
|
||||
|
||||
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
|
||||
class Prescriptions {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int patientID;
|
||||
int appointmentNo;
|
||||
String appointmentDate;
|
||||
String doctorName;
|
||||
String clinicDescription;
|
||||
String name;
|
||||
int episodeID;
|
||||
int actualDoctorRate;
|
||||
int admission;
|
||||
int clinicID;
|
||||
String companyName;
|
||||
String despensedStatus;
|
||||
DateTime dischargeDate;
|
||||
int dischargeNo;
|
||||
int doctorID;
|
||||
String doctorImageURL;
|
||||
int doctorRate;
|
||||
String doctorTitle;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
bool isActiveDoctorProfile;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isExecludeDoctor;
|
||||
bool isInOutPatient;
|
||||
String isInOutPatientDescription;
|
||||
String isInOutPatientDescriptionN;
|
||||
bool isInsurancePatient;
|
||||
String nationalityFlagURL;
|
||||
int noOfPatientsRate;
|
||||
String qR;
|
||||
List<String> speciality;
|
||||
|
||||
Prescriptions(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.patientID,
|
||||
this.appointmentNo,
|
||||
this.appointmentDate,
|
||||
this.doctorName,
|
||||
this.clinicDescription,
|
||||
this.name,
|
||||
this.episodeID,
|
||||
this.actualDoctorRate,
|
||||
this.admission,
|
||||
this.clinicID,
|
||||
this.companyName,
|
||||
this.despensedStatus,
|
||||
this.dischargeDate,
|
||||
this.dischargeNo,
|
||||
this.doctorID,
|
||||
this.doctorImageURL,
|
||||
this.doctorRate,
|
||||
this.doctorTitle,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.isActiveDoctorProfile,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isExecludeDoctor,
|
||||
this.isInOutPatient,
|
||||
this.isInOutPatientDescription,
|
||||
this.isInOutPatientDescriptionN,
|
||||
this.isInsurancePatient,
|
||||
this.nationalityFlagURL,
|
||||
this.noOfPatientsRate,
|
||||
this.qR,
|
||||
this.speciality});
|
||||
|
||||
Prescriptions.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
patientID = json['PatientID'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
appointmentDate = json['AppointmentDate'];
|
||||
doctorName = json['DoctorName'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
name = json['Name'];
|
||||
episodeID = json['EpisodeID'];
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
admission = json['Admission'];
|
||||
clinicID = json['ClinicID'];
|
||||
companyName = json['CompanyName'];
|
||||
despensedStatus = json['Despensed_Status'];
|
||||
dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']);
|
||||
dischargeNo = json['DischargeNo'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||
isInOutPatient = json['IsInOutPatient'];
|
||||
isInOutPatientDescription = json['IsInOutPatientDescription'];
|
||||
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
|
||||
isInsurancePatient = json['IsInsurancePatient'];
|
||||
nationalityFlagURL = json['NationalityFlagURL'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
qR = json['QR'];
|
||||
// speciality = json['Speciality'].cast<String>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['AppointmentDate'] = this.appointmentDate;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['ClinicDescription'] = this.clinicDescription;
|
||||
data['Name'] = this.name;
|
||||
data['EpisodeID'] = this.episodeID;
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['Admission'] = this.admission;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['CompanyName'] = this.companyName;
|
||||
data['Despensed_Status'] = this.despensedStatus;
|
||||
data['DischargeDate'] = this.dischargeDate;
|
||||
data['DischargeNo'] = this.dischargeNo;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||
data['IsInOutPatient'] = this.isInOutPatient;
|
||||
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
|
||||
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
|
||||
data['IsInsurancePatient'] = this.isInsurancePatient;
|
||||
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['QR'] = this.qR;
|
||||
data['Speciality'] = this.speciality;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//class PrescriptionsList {
|
||||
// String filterName = "";
|
||||
// List<Prescriptions> prescriptionsList = List();
|
||||
//
|
||||
// PrescriptionsList({this.filterName, Prescriptions prescriptions}) {
|
||||
// prescriptionsList.add(prescriptions);
|
||||
// }
|
||||
//}
|
@ -0,0 +1,77 @@
|
||||
class OrdersModel {
|
||||
List<Orders> orders;
|
||||
|
||||
OrdersModel({this.orders});
|
||||
|
||||
OrdersModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['orders'] != null) {
|
||||
orders = new List<Orders>();
|
||||
json['orders'].forEach((v) {
|
||||
orders.add(new Orders.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.orders != null) {
|
||||
data['orders'] = this.orders.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Orders {
|
||||
String id;
|
||||
int productCount;
|
||||
double orderTotal;
|
||||
String createdOnUtc;
|
||||
int orderStatusId;
|
||||
String orderStatus;
|
||||
String orderStatusn;
|
||||
bool canCancel;
|
||||
bool canRefund;
|
||||
dynamic customerId;
|
||||
|
||||
Orders(
|
||||
{this.id,
|
||||
this.productCount,
|
||||
this.orderTotal,
|
||||
this.createdOnUtc,
|
||||
this.orderStatusId,
|
||||
this.orderStatus,
|
||||
this.orderStatusn,
|
||||
this.canCancel,
|
||||
this.canRefund,
|
||||
this.customerId,});
|
||||
|
||||
Orders.fromJson(Map<String, dynamic> json) {
|
||||
try {
|
||||
id = json['id'];
|
||||
productCount = json['product_count'];
|
||||
orderTotal = json['order_total'];
|
||||
createdOnUtc = json['created_on_utc'];
|
||||
orderStatusId = json['order_status_id'];
|
||||
orderStatus = json['order_status'];
|
||||
orderStatusn = json['order_statusn'];
|
||||
canCancel = json['can_cancel'];
|
||||
canRefund = json['can_refund'];
|
||||
customerId = json['customer_id'];
|
||||
}catch(e){
|
||||
print(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['product_count'] = this.productCount;
|
||||
data['order_total'] = this.orderTotal;
|
||||
data['created_on_utc'] = this.createdOnUtc;
|
||||
data['order_status_id'] = this.orderStatusId;
|
||||
data['order_status'] = this.orderStatus;
|
||||
data['order_statusn'] = this.orderStatusn;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
|
||||
|
||||
|
||||
class PrescriptionService extends BaseService {
|
||||
final AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
bool isFinished = true;
|
||||
bool hasError = false;
|
||||
String errorMsg = '';
|
||||
String url = "";
|
||||
|
||||
List<Prescriptions> _prescriptionsList = List();
|
||||
List<Prescriptions> get prescriptionsList => _prescriptionsList;
|
||||
|
||||
|
||||
Future getPrescription() async {
|
||||
hasError = false;
|
||||
url = PRESCRIPTION;
|
||||
print("Print PRESCRIPTION url" + url);
|
||||
await baseAppClient.get(url,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_prescriptionsList.clear();
|
||||
response['PatientPrescriptionList'].forEach((item) {
|
||||
_prescriptionsList.add(Prescriptions.fromJson(item));
|
||||
});
|
||||
print(_prescriptionsList.length);
|
||||
print(response);
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
});
|
||||
}
|
||||
// Future getPrescription() async {
|
||||
// hasError = false;
|
||||
// Map<String, dynamic> body = Map();
|
||||
// body['isDentalAllowedBackend'] = false;
|
||||
// await baseAppClient.post(PRESCRIPTION,
|
||||
// onSuccess: (dynamic response, int statusCode) {
|
||||
// prescriptionsList.clear();
|
||||
// response['PatientPrescriptionList'].forEach((prescriptions) {
|
||||
// prescriptionsList.add(Prescriptions.fromJson(prescriptions));
|
||||
// });
|
||||
// }, onFailure: (String error, int statusCode) {
|
||||
// hasError = true;
|
||||
// super.error = error;
|
||||
// }, body: body);
|
||||
// }
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue