diff --git a/GoogleService-Info_DQ.plist b/GoogleService-Info_DQ.plist
new file mode 100644
index 00000000..0c093a2a
--- /dev/null
+++ b/GoogleService-Info_DQ.plist
@@ -0,0 +1,36 @@
+
+
+
+
+ CLIENT_ID
+ 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com
+ REVERSED_CLIENT_ID
+ com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r
+ API_KEY
+ AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs
+ GCM_SENDER_ID
+ 864393916058
+ PLIST_VERSION
+ 1
+ BUNDLE_ID
+ com.cloud.diplomaticquarterapp
+ PROJECT_ID
+ diplomaticquarter-d2385
+ STORAGE_BUCKET
+ diplomaticquarter-d2385.appspot.com
+ IS_ADS_ENABLED
+
+ IS_ANALYTICS_ENABLED
+
+ IS_APPINVITE_ENABLED
+
+ IS_GCM_ENABLED
+
+ IS_SIGNIN_ENABLED
+
+ GOOGLE_APP_ID
+ 1:864393916058:ios:13f787bbfe6051f8b97923
+ DATABASE_URL
+ https://diplomaticquarter-d2385.firebaseio.com
+
+
\ No newline at end of file
diff --git a/GoogleService-Info_HMG.plist b/GoogleService-Info_HMG.plist
new file mode 100644
index 00000000..153aa2c6
--- /dev/null
+++ b/GoogleService-Info_HMG.plist
@@ -0,0 +1,38 @@
+
+
+
+
+ CLIENT_ID
+ 815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com
+ REVERSED_CLIENT_ID
+ com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt
+ ANDROID_CLIENT_ID
+ 815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com
+ API_KEY
+ AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA
+ GCM_SENDER_ID
+ 815750722565
+ PLIST_VERSION
+ 1
+ BUNDLE_ID
+ com.HMG.Smartphone
+ PROJECT_ID
+ api-project-815750722565
+ STORAGE_BUCKET
+ api-project-815750722565.appspot.com
+ IS_ADS_ENABLED
+
+ IS_ANALYTICS_ENABLED
+
+ IS_APPINVITE_ENABLED
+
+ IS_GCM_ENABLED
+
+ IS_SIGNIN_ENABLED
+
+ GOOGLE_APP_ID
+ 1:815750722565:ios:328ec247a81a2ca23c186c
+ DATABASE_URL
+ https://api-project-815750722565.firebaseio.com
+
+
\ No newline at end of file
diff --git a/assets/images/logo_HMG.png b/assets/images/logo_HMG.png
new file mode 100644
index 00000000..0d9e4a56
Binary files /dev/null and b/assets/images/logo_HMG.png differ
diff --git a/ios/GoogleService-Info.plist b/ios/Runner/WifiConnect/GoogleService-Info.plist
similarity index 100%
rename from ios/GoogleService-Info.plist
rename to ios/Runner/WifiConnect/GoogleService-Info.plist
diff --git a/key b/key
new file mode 100644
index 00000000..15b9f5d1
Binary files /dev/null and b/key differ
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 7fdae99d..0f8df420 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -1,9 +1,7 @@
import 'dart:io';
-import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
-import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660;
@@ -13,11 +11,16 @@ const PACKAGES_CATEGORIES = '/api/categories';
const PACKAGES_PRODUCTS = '/api/products';
const BASE_URL = 'https://uat.hmgwebservices.com/';
-//const BASE_URL = 'https://hmgwebservices.com/';
+// const BASE_URL = 'https://hmgwebservices.com/';
+
+// Pharmacy UAT URLs
+// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
+// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
+
+// Pharmacy Production URLs
+const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
+const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
-//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/';
-const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
-const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@@ -91,6 +94,11 @@ const GET_PATIENT_VITAL_SIGN =
const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
+///ED Online
+const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
+const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation";
+const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
+
///Er Nearest
const GET_AMBULANCE_REQUEST =
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
@@ -435,11 +443,19 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
+// Encillary Orders
+
+const GET_ANCILLARY_ORDERS =
+ 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
+
+const GET_ANCILLARY_ORDERS_DETAILS =
+ 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
+
//Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
// pharmacy
-const PHARMACY_AUTORZIE_CUSTOMER = "epharmacy/api/AutorizeCustomer";
+const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
@@ -460,9 +476,9 @@ const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";
const GET_SHOPPING_CART = "shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "get_shipping_option/";
-const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/";
+const DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
-const ORDER_SHOPPING_CART = "epharmacy/api/orders";
+const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION =
@@ -519,11 +535,11 @@ const GET_BRAND_ITEMS = "products";
// External API
const ADD_ADDRESS_INFO =
- "https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
+ "addcustomeraddress";
const GET_CUSTOMER_ADDRESSES =
- "https://mdlaboratories.com/exacartapi/api/Customers/";
+ "Customers/";
const GET_CUSTOMER_INFO =
- "https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
+ "VerifyCustomer";
//Pharmacy
@@ -555,6 +571,8 @@ const GET_SEARCH_PRODUCTS =
const SCAN_QR_CODE = 'productbysku/';
+const FILTERED_PRODUCTS = 'products?categoryids=';
+
class AppGlobal {
static var context;
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index f6257ae8..4cababb4 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -1159,7 +1159,7 @@ const Map localizedValues = {
"ar": "Connected with HMG Network,\n\nBut failed to access HMG services"
},
"offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"},
- "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"},
+ "InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"},
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
"GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"},
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},
@@ -1652,7 +1652,10 @@ const Map localizedValues = {
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"},
- "bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"},
+ "bloodSugarConversion": {
+ "en": "Blood Sugar Conversion",
+ "ar": "السكر في الدم"
+ },
"convertBloodSugarStatement": {
"en":
"Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.",
@@ -1954,4 +1957,24 @@ const Map localizedValues = {
},
"order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"},
"shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"},
+ "pharmacy-relogin": {
+ "en": "Your session has timed out, Please try again",
+ "ar": "انتهت مهلة جلسة الخاص بها. يرجى المحاولة مرة أخرى"
+ },
+ "ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"},
+
+ "onlineCheckInAgreement": {"en": "The online check-in is for non-life threatening situationCall the red crescent (number) or go to the nearest emergency department if there are:signs of stroke or heart attack history of seizure or syncope there is limb or life threatening injury picture of severe injuries",
+ "ar": "تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة"},
+ "MRN": {"en": "MRN", "ar": "ایم آر این"},
+ "appointment-date": {"en": "Appointment Date", "ar": "تقرری کی تاریخ"},
+ "appointment-no": {"en": "Appointment No", "ar": "تقرری نمبر"},
+ "insurance-id": {"en": "Insurance ID", "ar": "انشورنس ID"},
+ "chiefComplaints": {"en": "Chief Complaints", "ar": "الشكوى الرئيسة"},
+ "errorChiefComplaints": {"en": "Please Chief Complaints", "ar": "يرجى ادخال الشكوى الرئيسة"},
+ "errorExpectedArrivalTimes": {"en": "Please Expected arrival time", "ar": "يرجى ادخال الوقت المتوقع للوصول"},
+ "expectedArrivalTime": {"en": "Expected arrival time", "ar": "الوقت المتوقع للوصول"},
+ "add-address": {
+ "en": "Add new address",
+ "ar": "اضف عنوان جديد"
+ }
};
diff --git a/lib/core/model/er/ErPatientShareModel.dart b/lib/core/model/er/ErPatientShareModel.dart
new file mode 100644
index 00000000..4c6a4165
--- /dev/null
+++ b/lib/core/model/er/ErPatientShareModel.dart
@@ -0,0 +1,92 @@
+class ErPatientShareModel {
+ int cashPrice;
+ int cashPriceTax;
+ int cashPriceWithTax;
+ int companyId;
+ String companyName;
+ int companyShareWithTax;
+ dynamic errCode;
+ int groupID;
+ dynamic insurancePolicyNo;
+ String message;
+ dynamic patientCardID;
+ double patientShare;
+ double patientShareWithTax;
+ double patientTaxAmount;
+ int policyId;
+ String policyName;
+ String procedureName;
+ dynamic setupID;
+ int statusCode;
+ dynamic subPolicyNo;
+
+ ErPatientShareModel(
+ {this.cashPrice,
+ this.cashPriceTax,
+ this.cashPriceWithTax,
+ this.companyId,
+ this.companyName,
+ this.companyShareWithTax,
+ this.errCode,
+ this.groupID,
+ this.insurancePolicyNo,
+ this.message,
+ this.patientCardID,
+ this.patientShare,
+ this.patientShareWithTax,
+ this.patientTaxAmount,
+ this.policyId,
+ this.policyName,
+ this.procedureName,
+ this.setupID,
+ this.statusCode,
+ this.subPolicyNo});
+
+ ErPatientShareModel.fromJson(Map json) {
+ cashPrice = json['CashPrice'];
+ cashPriceTax = json['CashPriceTax'];
+ cashPriceWithTax = json['CashPriceWithTax'];
+ companyId = json['CompanyId'];
+ companyName = json['CompanyName'];
+ companyShareWithTax = json['CompanyShareWithTax'];
+ errCode = json['ErrCode'];
+ groupID = json['GroupID'];
+ insurancePolicyNo = json['InsurancePolicyNo'];
+ message = json['Message'];
+ patientCardID = json['PatientCardID'];
+ patientShare = json['PatientShare'];
+ patientShareWithTax = json['PatientShareWithTax'];
+ patientTaxAmount = json['PatientTaxAmount'];
+ policyId = json['PolicyId'];
+ policyName = json['PolicyName'];
+ procedureName = json['ProcedureName'];
+ setupID = json['SetupID'];
+ statusCode = json['StatusCode'];
+ subPolicyNo = json['SubPolicyNo'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['CashPrice'] = this.cashPrice;
+ data['CashPriceTax'] = this.cashPriceTax;
+ data['CashPriceWithTax'] = this.cashPriceWithTax;
+ data['CompanyId'] = this.companyId;
+ data['CompanyName'] = this.companyName;
+ data['CompanyShareWithTax'] = this.companyShareWithTax;
+ data['ErrCode'] = this.errCode;
+ data['GroupID'] = this.groupID;
+ data['InsurancePolicyNo'] = this.insurancePolicyNo;
+ data['Message'] = this.message;
+ data['PatientCardID'] = this.patientCardID;
+ data['PatientShare'] = this.patientShare;
+ data['PatientShareWithTax'] = this.patientShareWithTax;
+ data['PatientTaxAmount'] = this.patientTaxAmount;
+ data['PolicyId'] = this.policyId;
+ data['PolicyName'] = this.policyName;
+ data['ProcedureName'] = this.procedureName;
+ data['SetupID'] = this.setupID;
+ data['StatusCode'] = this.statusCode;
+ data['SubPolicyNo'] = this.subPolicyNo;
+ return data;
+ }
+}
diff --git a/lib/core/model/er/TriageInformationRequest.dart b/lib/core/model/er/TriageInformationRequest.dart
new file mode 100644
index 00000000..a9717d3d
--- /dev/null
+++ b/lib/core/model/er/TriageInformationRequest.dart
@@ -0,0 +1,147 @@
+import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
+
+class TriageInformationRequest {
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String sessionID;
+ int patientID;
+ String tokenID;
+ String generalid;
+ int patientOutSA;
+ int patientTypeID;
+ int patientType;
+ int projectID;
+ ERTriageInformation eRTriageInformation;
+ HospitalsModel selectedHospital;
+ TriageInformationRequest(
+ {this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.sessionID,
+ this.patientID,
+ this.tokenID,
+ this.generalid,
+ this.patientOutSA,
+ this.patientTypeID,
+ this.patientType,
+ this.projectID,
+ this.eRTriageInformation,this.selectedHospital});
+
+ TriageInformationRequest.fromJson(Map json) {
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ sessionID = json['SessionID'];
+ patientID = json['PatientID'];
+ tokenID = json['TokenID'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ patientTypeID = json['PatientTypeID'];
+ patientType = json['PatientType'];
+ projectID = json['ProjectID'];
+ eRTriageInformation = json['ERTriageInformation'] != null
+ ? new ERTriageInformation.fromJson(json['ERTriageInformation'])
+ : null;
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['SessionID'] = this.sessionID;
+ data['PatientID'] = this.patientID;
+ data['TokenID'] = this.tokenID;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['PatientTypeID'] = this.patientTypeID;
+ data['PatientType'] = this.patientType;
+ data['ProjectID'] = this.projectID;
+ if (this.eRTriageInformation != null) {
+ data['ERTriageInformation'] = this.eRTriageInformation.toJson();
+ }
+ return data;
+ }
+}
+
+class ERTriageInformation {
+ String notes;
+ String chiefComplaint;
+ int patientId;
+ int projectId;
+ int riskScore;
+ List checklist;
+
+ ERTriageInformation(
+ {this.notes,
+ this.chiefComplaint,
+ this.patientId,
+ this.projectId,
+ this.riskScore,
+ this.checklist});
+
+ ERTriageInformation.fromJson(Map json) {
+ notes = json['Notes'];
+ chiefComplaint = json['ChiefComplaint'];
+ patientId = json['PatientId'];
+ projectId = json['ProjectId'];
+ riskScore = json['RiskScore'];
+ if (json['checklist'] != null) {
+ checklist = new List();
+ json['checklist'].forEach((v) {
+ checklist.add(new Checklist.fromJson(v));
+ });
+ }
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['Notes'] = this.notes;
+ data['ChiefComplaint'] = this.chiefComplaint;
+ data['PatientId'] = this.patientId;
+ data['ProjectId'] = this.projectId;
+ data['RiskScore'] = this.riskScore;
+ if (this.checklist != null) {
+ data['checklist'] = this.checklist.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
+
+class Checklist {
+ int isSelected;
+ int parameterCode;
+ int parameterGroup;
+ int parameterType;
+ int score;
+
+ Checklist(
+ {this.isSelected,
+ this.parameterCode,
+ this.parameterGroup,
+ this.parameterType,
+ this.score});
+
+ Checklist.fromJson(Map json) {
+ isSelected = json['IsSelected'];
+ parameterCode = json['ParameterCode'];
+ parameterGroup = json['ParameterGroup'];
+ parameterType = json['ParameterType'];
+ score = json['Score'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['IsSelected'] = this.isSelected;
+ data['ParameterCode'] = this.parameterCode;
+ data['ParameterGroup'] = this.parameterGroup;
+ data['ParameterType'] = this.parameterType;
+ data['Score'] = this.score;
+ return data;
+ }
+}
diff --git a/lib/core/model/er/TriageQuestionsModel.dart b/lib/core/model/er/TriageQuestionsModel.dart
new file mode 100644
index 00000000..8960973e
--- /dev/null
+++ b/lib/core/model/er/TriageQuestionsModel.dart
@@ -0,0 +1,52 @@
+class TriageQuestionsModel {
+ String adultPoints;
+ String headerSequence;
+ int parameterCode;
+ int parameterGroup;
+ int parameterType;
+ String pediaPoints;
+ String question;
+ String questionN;
+ String scoreGroup;
+ String titles;
+
+ TriageQuestionsModel(
+ {this.adultPoints,
+ this.headerSequence,
+ this.parameterCode,
+ this.parameterGroup,
+ this.parameterType,
+ this.pediaPoints,
+ this.question,
+ this.questionN,
+ this.scoreGroup,
+ this.titles});
+
+ TriageQuestionsModel.fromJson(Map json) {
+ adultPoints = json['AdultPoints'];
+ headerSequence = json['HeaderSequence'];
+ parameterCode = json['ParameterCode'];
+ parameterGroup = json['ParameterGroup'];
+ parameterType = json['ParameterType'];
+ pediaPoints = json['PediaPoints'];
+ question = json['Question'];
+ questionN = json['QuestionN'];
+ scoreGroup = json['ScoreGroup'];
+ titles = json['Titles'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['AdultPoints'] = this.adultPoints;
+ data['HeaderSequence'] = this.headerSequence;
+ data['ParameterCode'] = this.parameterCode;
+ data['ParameterGroup'] = this.parameterGroup;
+ data['ParameterType'] = this.parameterType;
+ data['PediaPoints'] = this.pediaPoints;
+ data['Question'] = this.question;
+ data['QuestionN'] = this.questionN;
+ data['ScoreGroup'] = this.scoreGroup;
+ data['Titles'] = this.titles;
+ return data;
+ }
+}
diff --git a/lib/core/model/hospitals/hospitals_model.dart b/lib/core/model/hospitals/hospitals_model.dart
index 264528c7..246de0b1 100644
--- a/lib/core/model/hospitals/hospitals_model.dart
+++ b/lib/core/model/hospitals/hospitals_model.dart
@@ -1,11 +1,11 @@
class HospitalsModel {
String desciption;
- Null desciptionN;
+ dynamic desciptionN;
dynamic iD;
String legalName;
String legalNameN;
String name;
- Null nameN;
+ dynamic nameN;
String phoneNumber;
String setupID;
dynamic distanceInKilometers;
@@ -13,7 +13,7 @@ class HospitalsModel {
String latitude;
String longitude;
dynamic mainProjectID;
- Null projectOutSA;
+ dynamic projectOutSA;
bool usingInDoctorApp;
HospitalsModel(
diff --git a/lib/core/model/pharmacies/PharmacyProduct.dart b/lib/core/model/pharmacies/PharmacyProduct.dart
index c472cb4c..f69d035b 100644
--- a/lib/core/model/pharmacies/PharmacyProduct.dart
+++ b/lib/core/model/pharmacies/PharmacyProduct.dart
@@ -4,29 +4,29 @@ import 'PharmacyImageObject.dart';
import 'Reviews.dart';
class PharmacyProduct {
- String id;
+ dynamic id;
bool visibleIndividually;
- String name;
- String namen;
- String shortDescription;
- String shortDescriptionn;
- String fullDescription;
- String fullDescriptionn;
+ dynamic name;
+ dynamic namen;
+ dynamic shortDescription;
+ dynamic shortDescriptionn;
+ dynamic fullDescription;
+ dynamic fullDescriptionn;
bool markasNew;
bool showOnHomePage;
- String metaKeywords;
- String metaDescription;
- String metaTitle;
+ dynamic metaKeywords;
+ dynamic metaDescription;
+ dynamic metaTitle;
bool allowCustomerReviews;
int approvedRatingSum;
int notApprovedRatingSum;
int approvedTotalReviews;
int notApprovedTotalReviews;
- String sku;
+ dynamic sku;
bool isRx;
bool prescriptionRequired;
- String rxMessage;
- String rxMessagen;
+ dynamic rxMessage;
+ dynamic rxMessagen;
String manufacturerPartNumber;
String gtin;
bool isGiftCard;
@@ -115,118 +115,117 @@ class PharmacyProduct {
int vendorId;
String seName;
-
PharmacyProduct(
{this.id,
- this.visibleIndividually,
- this.name,
- this.namen,
- this.shortDescription,
- this.shortDescriptionn,
- this.fullDescription,
- this.fullDescriptionn,
- this.markasNew,
- this.showOnHomePage,
- this.metaKeywords,
- this.metaDescription,
- this.metaTitle,
- this.allowCustomerReviews,
- this.approvedRatingSum,
- this.notApprovedRatingSum,
- this.approvedTotalReviews,
- this.notApprovedTotalReviews,
- this.sku,
- this.isRx,
- this.prescriptionRequired,
- this.rxMessage,
- this.rxMessagen,
- this.manufacturerPartNumber,
- this.gtin,
- this.isGiftCard,
- this.requireOtherProducts,
- this.automaticallyAddRequiredProducts,
- this.isDownload,
- this.unlimitedDownloads,
- this.maxNumberOfDownloads,
- this.downloadExpirationDays,
- this.hasSampleDownload,
- this.hasUserAgreement,
- this.isRecurring,
- this.recurringCycleLength,
- this.recurringTotalCycles,
- this.isRental,
- this.rentalPriceLength,
- this.isShipEnabled,
- this.isFreeShipping,
- this.shipSeparately,
- this.additionalShippingCharge,
- this.isTaxExempt,
- this.isTelecommunicationsOrBroadcastingOrElectronicServices,
- this.useMultipleWarehouses,
- this.manageInventoryMethodId,
- this.stockQuantity,
- this.stockAvailability,
- this.stockAvailabilityn,
- this.displayStockAvailability,
- this.displayStockQuantity,
- this.minStockQuantity,
- this.notifyAdminForQuantityBelow,
- this.allowBackInStockSubscriptions,
- this.orderMinimumQuantity,
- this.orderMaximumQuantity,
- this.allowedQuantities,
- this.allowAddingOnlyExistingAttributeCombinations,
- this.disableBuyButton,
- this.disableWishlistButton,
- this.availableForPreOrder,
- this.preOrderAvailabilityStartDateTimeUtc,
- this.callForPrice,
- this.price,
- this.oldPrice,
- this.productCost,
- this.specialPrice,
- this.specialPriceStartDateTimeUtc,
- this.specialPriceEndDateTimeUtc,
- this.customerEntersPrice,
- this.minimumCustomerEnteredPrice,
- this.maximumCustomerEnteredPrice,
- this.basepriceEnabled,
- this.basepriceAmount,
- this.basepriceBaseAmount,
- this.hasTierPrices,
- this.hasDiscountsApplied,
- this.discountName,
- this.discountNamen,
- this.discountDescription,
- this.discountDescriptionn,
- this.discountPercentage,
- this.currency,
- this.currencyn,
- this.weight,
- this.length,
- this.width,
- this.height,
- this.availableStartDateTimeUtc,
- this.availableEndDateTimeUtc,
- this.displayOrder,
- this.published,
- this.deleted,
- this.createdOnUtc,
- this.updatedOnUtc,
- this.productType,
- this.parentGroupedProductId,
- this.roleIds,
- this.discountIds,
- this.storeIds,
- this.manufacturerIds,
- this.reviews,
- this.images,
- this.attributes,
- this.specifications,
- this.associatedProductIds,
- this.tags,
- this.vendorId,
- this.seName});
+ this.visibleIndividually,
+ this.name,
+ this.namen,
+ this.shortDescription,
+ this.shortDescriptionn,
+ this.fullDescription,
+ this.fullDescriptionn,
+ this.markasNew,
+ this.showOnHomePage,
+ this.metaKeywords,
+ this.metaDescription,
+ this.metaTitle,
+ this.allowCustomerReviews,
+ this.approvedRatingSum,
+ this.notApprovedRatingSum,
+ this.approvedTotalReviews,
+ this.notApprovedTotalReviews,
+ this.sku,
+ this.isRx,
+ this.prescriptionRequired,
+ this.rxMessage,
+ this.rxMessagen,
+ this.manufacturerPartNumber,
+ this.gtin,
+ this.isGiftCard,
+ this.requireOtherProducts,
+ this.automaticallyAddRequiredProducts,
+ this.isDownload,
+ this.unlimitedDownloads,
+ this.maxNumberOfDownloads,
+ this.downloadExpirationDays,
+ this.hasSampleDownload,
+ this.hasUserAgreement,
+ this.isRecurring,
+ this.recurringCycleLength,
+ this.recurringTotalCycles,
+ this.isRental,
+ this.rentalPriceLength,
+ this.isShipEnabled,
+ this.isFreeShipping,
+ this.shipSeparately,
+ this.additionalShippingCharge,
+ this.isTaxExempt,
+ this.isTelecommunicationsOrBroadcastingOrElectronicServices,
+ this.useMultipleWarehouses,
+ this.manageInventoryMethodId,
+ this.stockQuantity,
+ this.stockAvailability,
+ this.stockAvailabilityn,
+ this.displayStockAvailability,
+ this.displayStockQuantity,
+ this.minStockQuantity,
+ this.notifyAdminForQuantityBelow,
+ this.allowBackInStockSubscriptions,
+ this.orderMinimumQuantity,
+ this.orderMaximumQuantity,
+ this.allowedQuantities,
+ this.allowAddingOnlyExistingAttributeCombinations,
+ this.disableBuyButton,
+ this.disableWishlistButton,
+ this.availableForPreOrder,
+ this.preOrderAvailabilityStartDateTimeUtc,
+ this.callForPrice,
+ this.price,
+ this.oldPrice,
+ this.productCost,
+ this.specialPrice,
+ this.specialPriceStartDateTimeUtc,
+ this.specialPriceEndDateTimeUtc,
+ this.customerEntersPrice,
+ this.minimumCustomerEnteredPrice,
+ this.maximumCustomerEnteredPrice,
+ this.basepriceEnabled,
+ this.basepriceAmount,
+ this.basepriceBaseAmount,
+ this.hasTierPrices,
+ this.hasDiscountsApplied,
+ this.discountName,
+ this.discountNamen,
+ this.discountDescription,
+ this.discountDescriptionn,
+ this.discountPercentage,
+ this.currency,
+ this.currencyn,
+ this.weight,
+ this.length,
+ this.width,
+ this.height,
+ this.availableStartDateTimeUtc,
+ this.availableEndDateTimeUtc,
+ this.displayOrder,
+ this.published,
+ this.deleted,
+ this.createdOnUtc,
+ this.updatedOnUtc,
+ this.productType,
+ this.parentGroupedProductId,
+ this.roleIds,
+ this.discountIds,
+ this.storeIds,
+ this.manufacturerIds,
+ this.reviews,
+ this.images,
+ this.attributes,
+ this.specifications,
+ this.associatedProductIds,
+ this.tags,
+ this.vendorId,
+ this.seName});
PharmacyProduct.fromJson(Map json) {
id = json['id'];
@@ -257,7 +256,7 @@ class PharmacyProduct {
isGiftCard = json['is_gift_card'];
requireOtherProducts = json['require_other_products'];
automaticallyAddRequiredProducts =
- json['automatically_add_required_products'];
+ json['automatically_add_required_products'];
isDownload = json['is_download'];
unlimitedDownloads = json['unlimited_downloads'];
maxNumberOfDownloads = json['max_number_of_downloads'];
@@ -275,7 +274,7 @@ class PharmacyProduct {
additionalShippingCharge = json['additional_shipping_charge'];
isTaxExempt = json['is_tax_exempt'];
isTelecommunicationsOrBroadcastingOrElectronicServices =
- json['is_telecommunications_or_broadcasting_or_electronic_services'];
+ json['is_telecommunications_or_broadcasting_or_electronic_services'];
useMultipleWarehouses = json['use_multiple_warehouses'];
manageInventoryMethodId = json['manage_inventory_method_id'];
stockQuantity = json['stock_quantity'];
@@ -290,12 +289,12 @@ class PharmacyProduct {
orderMaximumQuantity = json['order_maximum_quantity'];
allowedQuantities = json['allowed_quantities'];
allowAddingOnlyExistingAttributeCombinations =
- json['allow_adding_only_existing_attribute_combinations'];
+ json['allow_adding_only_existing_attribute_combinations'];
disableBuyButton = json['disable_buy_button'];
disableWishlistButton = json['disable_wishlist_button'];
availableForPreOrder = json['available_for_pre_order'];
preOrderAvailabilityStartDateTimeUtc =
- json['pre_order_availability_start_date_time_utc'];
+ json['pre_order_availability_start_date_time_utc'];
callForPrice = json['call_for_price'];
price = json['price'];
oldPrice = json['old_price'];
diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart
new file mode 100644
index 00000000..b9d14a06
--- /dev/null
+++ b/lib/core/service/ancillary_orders_service.dart
@@ -0,0 +1,204 @@
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/core/service/base_service.dart';
+import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
+import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
+
+class AncillaryOrdersService extends BaseService {
+ List _ancillaryLists = List();
+ List get ancillaryLists => _ancillaryLists;
+ List _ancillaryProcLists = List();
+ List get ancillaryProcLists =>
+ _ancillaryProcLists;
+
+ Future getOrders() async {
+ Map body = Map();
+
+ hasError = false;
+
+ await baseAppClient.post(GET_ANCILLARY_ORDERS,
+ onSuccess: (dynamic response, int statusCode) {
+ _ancillaryLists = [];
+ response['AncillaryOrderList'].forEach((item) {
+ ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
+ });
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: body);
+ }
+
+ Future getOrdersDetails(appointmentNo, orderNo) async {
+ Map body = Map();
+
+ hasError = false;
+
+ await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS,
+ onSuccess: (dynamic response, int statusCode) {
+ _ancillaryProcLists = [];
+ response['AncillaryOrderProcList'] = [
+ {
+ "AncillaryOrderProcList": [
+ {
+ "ApprovalLineItemNo": 0,
+ "ApprovalNo": 0,
+ "ApprovalStatus": "",
+ "ApprovalStatusID": 0,
+ "CompanyShare": 501.3,
+ "CompanyShareWithTax": 576.5,
+ "CompanyTaxAmount": 75.19,
+ "DiscountAmount": 55.7,
+ "DiscountCategory": 1,
+ "DiscountType": "P",
+ "DiscountTypeValue": 10,
+ "IsApprovalCreated": false,
+ "IsApprovalRequired": false,
+ "IsCovered": false,
+ "OrderDate": "/Date(1601758800000+0300)/",
+ "OrderLineItemNo": 1,
+ "OrderNo": 2020000001,
+ "PartnerID": 0,
+ "PartnerShare": 0,
+ "PartnerShareType": "P",
+ "PatientShare": 0,
+ "PatientShareWithTax": 0,
+ "PatientTaxAmount": 0,
+ "ProcPrice": 557,
+ "ProcedureCategoryID": 2,
+ "ProcedureCategoryName": "LABORATORY",
+ "ProcedureID": "02013001",
+ "ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O",
+ "TaxAmount": 75.19,
+ "TaxPct": 15
+ },
+ {
+ "ApprovalLineItemNo": 0,
+ "ApprovalNo": 0,
+ "ApprovalStatus": "",
+ "ApprovalStatusID": 0,
+ "CompanyShare": 90,
+ "CompanyShareWithTax": 103.5,
+ "CompanyTaxAmount": 13.5,
+ "DiscountAmount": 10,
+ "DiscountCategory": 1,
+ "DiscountType": "P",
+ "DiscountTypeValue": 10,
+ "IsApprovalCreated": false,
+ "IsApprovalRequired": true,
+ "IsCovered": false,
+ "OrderDate": "/Date(1601758800000+0300)/",
+ "OrderLineItemNo": 4,
+ "OrderNo": 2020000001,
+ "PartnerID": 0,
+ "PartnerShare": 0,
+ "PartnerShareType": "P",
+ "PatientShare": 0,
+ "PatientShareWithTax": 0,
+ "PatientTaxAmount": 0,
+ "ProcPrice": 100,
+ "ProcedureCategoryID": 2,
+ "ProcedureCategoryName": "LABORATORY",
+ "ProcedureID": "02014011",
+ "ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)",
+ "TaxAmount": 13.5,
+ "TaxPct": 15
+ },
+ {
+ "ApprovalLineItemNo": 0,
+ "ApprovalNo": 0,
+ "ApprovalStatus": "",
+ "ApprovalStatusID": 0,
+ "CompanyShare": 347.76,
+ "CompanyShareWithTax": 399.92,
+ "CompanyTaxAmount": 52.16,
+ "DiscountAmount": 38.64,
+ "DiscountCategory": 1,
+ "DiscountType": "P",
+ "DiscountTypeValue": 10,
+ "IsApprovalCreated": false,
+ "IsApprovalRequired": false,
+ "IsCovered": false,
+ "OrderDate": "/Date(1601758800000+0300)/",
+ "OrderLineItemNo": 3,
+ "OrderNo": 2020000001,
+ "PartnerID": 0,
+ "PartnerShare": 0,
+ "PartnerShareType": "P",
+ "PatientShare": 0,
+ "PatientShareWithTax": 0,
+ "PatientTaxAmount": 0,
+ "ProcPrice": 386.4,
+ "ProcedureCategoryID": 2,
+ "ProcedureCategoryName": "LABORATORY",
+ "ProcedureID": "02019302",
+ "ProcedureName": "21-HYDROXYLASE ABS - S.O",
+ "TaxAmount": 52.16,
+ "TaxPct": 15
+ },
+ {
+ "ApprovalLineItemNo": 0,
+ "ApprovalNo": 0,
+ "ApprovalStatus": "",
+ "ApprovalStatusID": 0,
+ "CompanyShare": 1323,
+ "CompanyShareWithTax": 1521.45,
+ "CompanyTaxAmount": 198.45,
+ "DiscountAmount": 147,
+ "DiscountCategory": 1,
+ "DiscountType": "P",
+ "DiscountTypeValue": 10,
+ "IsApprovalCreated": false,
+ "IsApprovalRequired": true,
+ "IsCovered": false,
+ "OrderDate": "/Date(1601758800000+0300)/",
+ "OrderLineItemNo": 5,
+ "OrderNo": 2020000001,
+ "PartnerID": 0,
+ "PartnerShare": 0,
+ "PartnerShareType": "P",
+ "PatientShare": 0,
+ "PatientShareWithTax": 0,
+ "PatientTaxAmount": 0,
+ "ProcPrice": 1470,
+ "ProcedureCategoryID": 3,
+ "ProcedureCategoryName": "RADIOLOGY",
+ "ProcedureID": "03033065",
+ "ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)",
+ "TaxAmount": 198.45,
+ "TaxPct": 15
+ }
+ ],
+ "AppointmentDate": "/Date(1601499600000+0300)/",
+ "AppointmentNo": 2016053756,
+ "ClinicID": 1,
+ "ClinicName": "INTERNAL MEDICINE CLINIC",
+ "CompanyID": 0,
+ "CompanyName": "Blood Donation Investigation",
+ "DoctorID": 1485,
+ "DoctorName": "ANAS ABDULLAH",
+ "ErrCode": null,
+ "GroupID": 2,
+ "InsurancePolicyNo": "45976500",
+ "Message": "Success",
+ "PatientCardID": "232332323",
+ "PatientID": 3072055,
+ "PatientName": "MAYA KHALED SADDIQ",
+ "PatientType": 1,
+ "PolicyID": 2,
+ "PolicyName": "Test",
+ "ProjectID": 15,
+ "SetupID": "010266",
+ "StatusCode": 1,
+ "SubCategoryID": 2,
+ "SubPolicyNo": "234234"
+ }
+ ];
+
+ response['AncillaryOrderProcList'].forEach((item) {
+ ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
+ });
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: body);
+ }
+}
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index abfa7594..1d5b55aa 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/uitl/app_toast.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@@ -132,7 +134,198 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
- var parsed = json.decode(response.body.toString());
+ // var parsed = json.decode(response.body.toString());
+ var parsed = json.decode(utf8.decode(response.bodyBytes));
+ if (parsed['Response_Message'] != null) {
+ onSuccess(parsed, statusCode);
+ } else {
+ if (parsed['ErrorType'] == 4) {
+ navigateToAppUpdate(
+ AppGlobal.context, parsed['ErrorEndUserMessage']);
+ }
+ if (isAllowAny) {
+ onSuccess(parsed, statusCode);
+ } else if (parsed['IsAuthenticated'] == null) {
+ if (parsed['isSMSSent'] == true) {
+ onSuccess(parsed, statusCode);
+ } else if (parsed['MessageStatus'] == 1) {
+ onSuccess(parsed, statusCode);
+ } else if (parsed['Result'] == 'OK') {
+ onSuccess(parsed, statusCode);
+ } else {
+ if (parsed != null) {
+ onSuccess(parsed, statusCode);
+ } else {
+ onFailure(
+ parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
+ statusCode);
+ logout();
+ }
+ }
+ } else if (parsed['MessageStatus'] == 1 ||
+ parsed['SMSLoginRequired'] == true) {
+ onSuccess(parsed, statusCode);
+ } else if (parsed['MessageStatus'] == 2 &&
+ parsed['IsAuthenticated']) {
+ if (parsed['SameClinicApptList'] != null) {
+ onSuccess(parsed, statusCode);
+ } else {
+ if (parsed['message'] == null &&
+ parsed['ErrorEndUserMessage'] == null) {
+ if (parsed['ErrorSearchMsg'] == null) {
+ onFailure("Server Error found with no available message",
+ statusCode);
+ } else {
+ onFailure(parsed['ErrorSearchMsg'], statusCode);
+ }
+ } else {
+ onFailure(
+ parsed['message'] ??
+ parsed['ErrorEndUserMessage'] ??
+ parsed['ErrorMessage'],
+ statusCode);
+ }
+ }
+ } else if (!parsed['IsAuthenticated']) {
+ await logout();
+
+ //helpers.showErrorToast('Your session expired Please login agian');
+ } else {
+ if (parsed['SameClinicApptList'] != null) {
+ onSuccess(parsed, statusCode);
+ } else {
+ if (parsed['message'] != null) {
+ onFailure(parsed['message'] ?? parsed['message'], statusCode);
+ } else {
+ onFailure(
+ parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
+ statusCode);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ onFailure('Please Check The Internet Connection', -1);
+ }
+ } catch (e) {
+ print(e);
+ onFailure(e.toString(), -1);
+ }
+ }
+
+ postPharmacy(String endPoint,
+ {Map body,
+ Function(dynamic response, int statusCode) onSuccess,
+ Function(String error, int statusCode) onFailure,
+ bool isAllowAny = false,
+ bool isExternal = false}) async {
+
+ var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
+ var user = await sharedPref.getObject(USER_PROFILE);
+ String url;
+ if (isExternal) {
+ url = endPoint;
+ } else {
+ url = PHARMACY_BASE_URL + endPoint;
+ }
+ try {
+ //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
+ var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
+ var user = await sharedPref.getObject(USER_PROFILE);
+ Map headers = {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json',
+ 'Authorization': token ?? '',
+ 'Mobilenumber': user != null
+ ? getPhoneNumberWithoutZero(user['MobileNumber'].toString())
+ : "",
+ 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
+ 'Username': user != null ? user['PatientID'].toString() : "",
+ };
+ if (!isExternal) {
+ String token = await sharedPref.getString(TOKEN);
+ var languageID =
+ await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
+ if (body.containsKey('SetupID')) {
+ body['SetupID'] = body.containsKey('SetupID')
+ ? body['SetupID'] != null
+ ? body['SetupID']
+ : SETUP_ID
+ : SETUP_ID;
+ }
+
+ body['VersionID'] = VERSION_ID;
+ body['Channel'] = CHANNEL;
+ body['LanguageID'] = languageID == 'ar' ? 1 : 2;
+
+ body['IPAdress'] = IP_ADDRESS;
+ body['generalid'] = GENERAL_ID;
+ body['PatientOutSA'] = body.containsKey('PatientOutSA')
+ ? body['PatientOutSA'] != null
+ ? body['PatientOutSA']
+ : PATIENT_OUT_SA
+ : PATIENT_OUT_SA;
+
+ if (body.containsKey('isDentalAllowedBackend')) {
+ body['isDentalAllowedBackend'] =
+ body.containsKey('isDentalAllowedBackend')
+ ? body['isDentalAllowedBackend'] != null
+ ? body['isDentalAllowedBackend']
+ : IS_DENTAL_ALLOWED_BACKEND
+ : IS_DENTAL_ALLOWED_BACKEND;
+ }
+
+ body['DeviceTypeID'] = DeviceTypeID;
+
+ if (!body.containsKey('IsPublicRequest')) {
+ body['PatientType'] = body.containsKey('PatientType')
+ ? body['PatientType'] != null
+ ? body['PatientType']
+ : user['PatientType'] != null
+ ? user['PatientType']
+ : PATIENT_TYPE
+ : PATIENT_TYPE;
+
+ body['PatientTypeID'] = body.containsKey('PatientTypeID')
+ ? body['PatientTypeID'] != null
+ ? body['PatientTypeID']
+ : user['PatientType'] != null
+ ? user['PatientType']
+ : PATIENT_TYPE_ID
+ : PATIENT_TYPE_ID;
+ if (user != null) {
+ body['TokenID'] = token;
+ body['PatientID'] = body['PatientID'] != null
+ ? body['PatientID']
+ : user['PatientID'];
+ body['PatientOutSA'] = user['OutSA'];
+ body['SessionID'] = SESSION_ID; //getSe
+ headers = {
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json',
+ 'Authorization': pharmacyToken,
+ 'Mobilenumber': user['MobileNumber'].toString(),
+ 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
+ 'Username': user['PatientID'].toString(),
+ };
+ }
+ }
+ }
+
+ print("URL : $url");
+ print("Body : ${json.encode(body)}");
+
+ if (await Utils.checkConnection()) {
+ final response = await http.post(url.trim(),
+ body: json.encode(body), headers: headers);
+ final int statusCode = response.statusCode;
+ print("statusCode :$statusCode");
+ if (statusCode < 200 || statusCode >= 400 || json == null) {
+ onFailure('Error While Fetching data', statusCode);
+ } else {
+ // var parsed = json.decode(response.body.toString());
+ var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
@@ -248,7 +441,8 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
- var parsed = json.decode(response.body.toString());
+ // var parsed = json.decode(response.body.toString());
+ var parsed = json.decode(utf8.decode(response.bodyBytes));
onSuccess(parsed, statusCode);
}
} else {
@@ -280,7 +474,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
- 'Content-Type': 'application/json',
+ 'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
@@ -293,10 +487,17 @@ class BaseAppClient {
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
- onFailure('Error While Fetching data', statusCode);
+ if (statusCode == 401) {
+ AppToast.showErrorToast(
+ message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
+ Navigator.of(AppGlobal.context).pushNamed(HOME);
+ } else {
+ onFailure('Error While Fetching data', statusCode);
+ }
} else {
- var parsed = json.decode(response.body.toString());
- onSuccess(parsed, statusCode);
+ // var parsed = json.decode(response.body.toString());
+ var bodyUtf = json.decode(utf8.decode(response.bodyBytes));
+ onSuccess(bodyUtf, statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
@@ -389,10 +590,12 @@ class BaseAppClient {
pharmacyPost(String endPoint,
{Map body,
- Function(dynamic response, int statusCode) onSuccess,
- Function(String error, int statusCode) onFailure,
- bool isAllowAny = false,
- bool isExternal = false}) async {
+ Function(dynamic response, int statusCode) onSuccess,
+ Function(String error, int statusCode) onFailure,
+ bool isAllowAny = false,
+ bool isExternal = false}) async {
+ var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
+ var user = await sharedPref.getObject(USER_PROFILE);
String url;
if (isExternal) {
url = endPoint;
@@ -400,17 +603,16 @@ class BaseAppClient {
url = BASE_PHARMACY_URL + endPoint;
}
try {
- //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
- if (!isExternal) {
+ if (isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
- await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
+ await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
- ? body['SetupID']
- : SETUP_ID
+ ? body['SetupID']
+ : SETUP_ID
: SETUP_ID;
}
@@ -422,17 +624,17 @@ class BaseAppClient {
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
- ? body['PatientOutSA']
- : PATIENT_OUT_SA
+ ? body['PatientOutSA']
+ : PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
- body.containsKey('isDentalAllowedBackend')
- ? body['isDentalAllowedBackend'] != null
- ? body['isDentalAllowedBackend']
- : IS_DENTAL_ALLOWED_BACKEND
- : IS_DENTAL_ALLOWED_BACKEND;
+ body.containsKey('isDentalAllowedBackend')
+ ? body['isDentalAllowedBackend'] != null
+ ? body['isDentalAllowedBackend']
+ : IS_DENTAL_ALLOWED_BACKEND
+ : IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
@@ -440,18 +642,18 @@ class BaseAppClient {
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
- ? body['PatientType']
- : user['PatientType'] != null
- ? user['PatientType']
- : PATIENT_TYPE
+ ? body['PatientType']
+ : user['PatientType'] != null
+ ? user['PatientType']
+ : PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
- ? body['PatientTypeID']
- : user['PatientType'] != null
- ? user['PatientType']
- : PATIENT_TYPE_ID
+ ? body['PatientTypeID']
+ : user['PatientType'] != null
+ ? user['PatientType']
+ : PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
@@ -469,19 +671,27 @@ class BaseAppClient {
var ss = json.encode(body);
if (await Utils.checkConnection()) {
- final response = await http.post(url.trim(),
- body: json.encode(body),
- headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json',
- 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
- });
+ final response =
+ await http.post(url.trim(), body: json.encode(body), headers: {
+ // 'Content-Type': 'application/json',
+ // 'Accept': 'application/json',
+ // 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
+ 'Content-Type': 'application/json',
+ 'Accept': 'application/json',
+ 'Authorization': token ?? '',
+ 'Mobilenumber': user != null
+ ? getPhoneNumberWithoutZero(user['MobileNumber'].toString())
+ : "",
+ 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
+ 'Username': user != null ? user['PatientID'].toString() : "",
+ });
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
- var parsed = json.decode(response.body.toString());
+ // var parsed = json.decode(response.body.toString());
+ var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
@@ -515,12 +725,11 @@ class BaseAppClient {
parsed['IsAuthenticated']) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
- if(parsed['ErrorSearchMsg'] == null ){
+ if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message",
statusCode);
- }else {
- onFailure(parsed['ErrorSearchMsg'],
- statusCode);
+ } else {
+ onFailure(parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(
diff --git a/lib/core/service/er/EdOnlineServices.dart b/lib/core/service/er/EdOnlineServices.dart
new file mode 100644
index 00000000..2df92d8a
--- /dev/null
+++ b/lib/core/service/er/EdOnlineServices.dart
@@ -0,0 +1,96 @@
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/core/model/er/ErPatientShareModel.dart';
+import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
+import 'package:diplomaticquarterapp/core/service/base_service.dart';
+
+class EdOnlineServices extends BaseService {
+ List triageQuestionsModelList = List();
+ ErPatientShareModel erPatientShareModel;
+
+ Future getQuestions() async {
+ hasError =false;
+ triageQuestionsModelList.clear();
+ Map body = Map();
+ body['ProjectID'] = 15;
+ await baseAppClient.post(ER_GET_VISUAL_TRIAGE_QUESTIONS,
+ onSuccess: (dynamic response, int statusCode) {
+ triageQuestionsModelList.clear();
+ response['ER_TriageQuestionsList'].forEach((questions) {
+ triageQuestionsModelList.add(TriageQuestionsModel.fromJson(questions));
+ });
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: body);
+ }
+
+
+ Future getPatientPaymentInformation({var id}) async {
+ hasError =false;
+ await baseAppClient.post(ER_GetPatientPaymentInformationForERClinic,
+ onSuccess: (dynamic response, int statusCode) {
+ erPatientShareModel =
+ ErPatientShareModel.fromJson(response['ER_PatientShare']);
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: Map.from({"ProjectID":15,"ClinicID":10}));
+ }
+
+ Future saveQuestionsInformation(
+ {String notes,
+ String chiefComplaint,
+ int projectId,
+ DateTime selectedTime,
+ List selectedQuestions}) async {
+ hasError =false;
+ Map body = Map();
+ List