updates & fixes

merge-requests/603/merge
haroon amjad 4 years ago
parent f50bfda330
commit 27c6837f25

@ -318,6 +318,12 @@ var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
var HIS_CREATE_ADVANCE_PAYMENT = var HIS_CREATE_ADVANCE_PAYMENT =
"Services/Patients.svc/REST/HIS_CreateAdvancePayment"; "Services/Patients.svc/REST/HIS_CreateAdvancePayment";
var ER_CREATE_ADVANCE_PAYMENT =
"services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic";
var ER_INSERT_ADVANCE_PAYMENT =
"services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails";
var ADD_ADVANCE_NUMBER_REQUEST = var ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';

@ -88,7 +88,7 @@ const Map localizedValues = {
'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'},
'agreeTo': {'en': 'I agree the', 'ar': 'أوافق على'}, 'agreeTo': {'en': 'I agree to the', 'ar': 'أوافق على'},
'termsConditoins': {'en': 'Terms and Conditions', 'ar': 'الأحكام والشروط'}, 'termsConditoins': {'en': 'Terms and Conditions', 'ar': 'الأحكام والشروط'},
'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, 'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'},
'changePayment': {'en': 'Change Payment Method', 'ar': 'تغيير آلية الدفع'}, 'changePayment': {'en': 'Change Payment Method', 'ar': 'تغيير آلية الدفع'},
@ -1385,9 +1385,9 @@ const Map localizedValues = {
"ancillary-orders": {"en": "Ancillary Orders", "ar": "الطلبات الاضافية"}, "ancillary-orders": {"en": "Ancillary Orders", "ar": "الطلبات الاضافية"},
"onlineCheckInAgreement": { "onlineCheckInAgreement": {
"en": "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", "The online check-in is for non-life threatening situation. Call the red crescent (number) or go to the nearest emergency department if there are: \n\nsigns of stroke or heart attack \nhistory of seizure or syncope \nthere is limb or life threatening injury \npicture of severe injuries",
"ar": "ar":
"تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة" "تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة"
}, },
"MRN": {"en": "MRN", "ar": "رقم الملف الطبي"}, "MRN": {"en": "MRN", "ar": "رقم الملف الطبي"},
"appointment-date": {"en": "Appointment Date", "ar": "تاريخ الموعد"}, "appointment-date": {"en": "Appointment Date", "ar": "تاريخ الموعد"},
@ -1803,17 +1803,45 @@ const Map localizedValues = {
"تتيح لك ميزة اختبار كوفيد19 حجز موعد في احد فروع مجموعة الحبيب الطبية ، حيث سيتم اخذ عينة المسحة ومعالجتها. بمجرد معالجة النتيجة ، سنخطرك عبر رسالة نصية قصيرة على رقم هاتفك المحمول المسجل وستكون نتيجة الاختبار متاحة أيضًا على التطبيق في قسم نتائج المختبر. يرجى ملاحظة أن هذه النتيجة متاحة لك فقط وليست متاحة للجمهور او اي شخص آخر. الرجاء الموافقة للتأكيد والمتابعة." "تتيح لك ميزة اختبار كوفيد19 حجز موعد في احد فروع مجموعة الحبيب الطبية ، حيث سيتم اخذ عينة المسحة ومعالجتها. بمجرد معالجة النتيجة ، سنخطرك عبر رسالة نصية قصيرة على رقم هاتفك المحمول المسجل وستكون نتيجة الاختبار متاحة أيضًا على التطبيق في قسم نتائج المختبر. يرجى ملاحظة أن هذه النتيجة متاحة لك فقط وليست متاحة للجمهور او اي شخص آخر. الرجاء الموافقة للتأكيد والمتابعة."
}, },
"covidConsentHeader": {"en": "User Consent", "ar": "موافقة المستخدم"}, "covidConsentHeader": {"en": "User Consent", "ar": "موافقة المستخدم"},
"drawOverAppsPermission": {"en": "Please allow the Al-Habib Medical Group application to appear on the top of the screen when receiving the call from the doctor for LiveCare service.", "ar": "الرجاء السماح لتطبيق مجموعة الحبيب الطبية للظهورعلى سطح الشاشة عند استلام الاتصال من الطبيب لخدمة اللايف كير"}, "drawOverAppsPermission": {
"cameraPermissionDialog": { "en": "Dr. Al Habib app needs to access Camera to enable virtual consultation between patient & doctor, attach images and scan QR for parking service.", "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المريض والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات." }, "en": "Please allow the Al-Habib Medical Group application to appear on the top of the screen when receiving the call from the doctor for LiveCare service.",
"galleryPermission": { "en": "Dr. Al Habib app needs to access Read & write external storage to upload images & documents in the E-Referral module and renew and update the insurance cards.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول إلى معرض الصور وذلك لتحميل الصور والمستندات لخدمة الإحالة الإلكترونية وكذلك لخدمة تجديد بطاقات التأمين وتحديثها." }, "ar": "الرجاء السماح لتطبيق مجموعة الحبيب الطبية للظهورعلى سطح الشاشة عند استلام الاتصال من الطبيب لخدمة اللايف كير"
"locationPermissionDialog": { "en": "Dr. Al Habib app collects location data to show the nearest HMG hospitals and ER Locations and provides health care services to your location and Health weather indicators service and the medication delivery.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الموقع لإظهار أقرب مستشفيات المجموعة، مواقع الطوارئ، تقديم خدمات الرعاية الصحية إلى موقعك، خدمة مؤشرات الطقس الصحية وكذلك خدمة توصيل الأدوية." }, },
"calendarPermission": { "en": "Dr. Al Habib app collects calendar data to modify and set reminders for Appointments", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى التقويم وذلك لاضافة تذكيرات بالمواعيد في التقويم." }, "cameraPermissionDialog": {
"recordAudioPermission": { "en": "Dr. Al Habib app needs audio permission to enable voice command features.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الصوت لتفعيل خدمة الأوامر الصوتية." }, "en": "Dr. Al Habib app needs to access Camera to enable virtual consultation between patient & doctor, attach images and scan QR for parking service.",
"wifiPermission": { "en": "Dr. Al Habib app needs to access WiFi state permission to connect to the HMG WiFi network from within the app when you visit the hospital.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى الواي فاي للاتصال بشبكة الواي فاي في المجموعة عند زيارة المستشفى." }, "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المريض والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات."
"physicalActivityPermission": { "en": "Dr. Al Habib app collects physical activity data to read heart rate, steps & distance from your smartwatch & send it to your doctor.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى بيانات النشاط البدني لقراءة معدل ضربات القلب والخطوات والمسافة من ساعتك الذكية وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }, },
"bluetoothPermission": { "en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }, "galleryPermission": {
"en": "Dr. Al Habib app needs to access Read & write external storage to upload images & documents in the E-Referral module and renew and update the insurance cards.",
"ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول إلى معرض الصور وذلك لتحميل الصور والمستندات لخدمة الإحالة الإلكترونية وكذلك لخدمة تجديد بطاقات التأمين وتحديثها."
},
"locationPermissionDialog": {
"en":
"Dr. Al Habib app collects location data to show the nearest HMG hospitals and ER Locations and provides health care services to your location and Health weather indicators service and the medication delivery.",
"ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الموقع لإظهار أقرب مستشفيات المجموعة، مواقع الطوارئ، تقديم خدمات الرعاية الصحية إلى موقعك، خدمة مؤشرات الطقس الصحية وكذلك خدمة توصيل الأدوية."
},
"calendarPermission": {
"en": "Dr. Al Habib app collects calendar data to modify and set reminders for Appointments",
"ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى التقويم وذلك لاضافة تذكيرات بالمواعيد في التقويم."
},
"recordAudioPermission": {
"en": "Dr. Al Habib app needs audio permission to enable voice command features.",
"ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الصوت لتفعيل خدمة الأوامر الصوتية."
},
"wifiPermission": {
"en": "Dr. Al Habib app needs to access WiFi state permission to connect to the HMG WiFi network from within the app when you visit the hospital.",
"ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى الواي فاي للاتصال بشبكة الواي فاي في المجموعة عند زيارة المستشفى."
},
"physicalActivityPermission": {
"en": "Dr. Al Habib app collects physical activity data to read heart rate, steps & distance from your smartwatch & send it to your doctor.",
"ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى بيانات النشاط البدني لقراءة معدل ضربات القلب والخطوات والمسافة من ساعتك الذكية وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها."
},
"bluetoothPermission": {
"en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data",
"ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها."
},
"privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"}, "privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"},
"termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"},
"prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."},
"liveCarePermissions": {"en": "LiveCare required Camera & Microphone permissions, Please allow these to proceed.", "ar": "هذه العيادة لا تدعم خدمة إعادة التعبئة والتسليم."}, "liveCarePermissions": {"en": "LiveCare requires Camera & Microphone permissions, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون ، يرجى السماح لها بالمتابعة."},
}; };

@ -7,6 +7,7 @@ const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register';
const LOGIN_TOKEN_ID = 'register-data-for-register'; const LOGIN_TOKEN_ID = 'register-data-for-register';
const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login'; const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login';
const LAST_LOGIN = 'last-login'; const LAST_LOGIN = 'last-login';
const ER_CHECKIN_RISK_SCORE = 'er-checkin-risk-score';
const ONLY_SMS = 'only-sms'; const ONLY_SMS = 'only-sms';
const AUTH_DATA = 'auth-data'; const AUTH_DATA = 'auth-data';
const IMEI_USER_DATA = 'imei-user-data'; const IMEI_USER_DATA = 'imei-user-data';

@ -10,9 +10,9 @@ class ErPatientShareModel {
dynamic insurancePolicyNo; dynamic insurancePolicyNo;
String message; String message;
dynamic patientCardID; dynamic patientCardID;
double patientShare; num patientShare;
double patientShareWithTax; num patientShareWithTax;
double patientTaxAmount; num patientTaxAmount;
int policyId; int policyId;
String policyName; String policyName;
String procedureName; String procedureName;

@ -7,7 +7,7 @@ class PrescriptionReport {
String companyName; String companyName;
int days; int days;
String doctorName; String doctorName;
var doseDailyQuantity; num doseDailyQuantity;
String frequency; String frequency;
int frequencyNumber; int frequencyNumber;
String image; String image;

@ -5,7 +5,7 @@ class PrescriptionReportEnh {
Null companyName; Null companyName;
int days; int days;
String doctorName; String doctorName;
int doseDailyQuantity; num doseDailyQuantity;
String frequency; String frequency;
int frequencyNumber; int frequencyNumber;
Null image; Null image;

@ -10,6 +10,11 @@ class AncillaryOrdersService extends BaseService {
List<AncillaryOrdersListProcListModel> get ancillaryProcLists => List<AncillaryOrdersListProcListModel> get ancillaryProcLists =>
_ancillaryProcLists; _ancillaryProcLists;
String _insuranceCompanyName = "";
String get insuranceCompanyName => _insuranceCompanyName;
String _insurancePolicyNumber = "";
String get insurancePolicyNumber => _insurancePolicyNumber;
Future getOrders() async { Future getOrders() async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();

@ -132,7 +132,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 2076117163; // body['IdentificationNo'] = 2076117163;
// body['MobileNo'] = "966503109207"; // body['MobileNo'] = "966503109207";
// body['PatientID'] = 50121262; //3844083 // body['PatientID'] = 1018977; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -141,11 +141,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
if (BASE_URL == "https://uat.hmgwebservices.com/") { // if (BASE_URL == "https://uat.hmgwebservices.com/") {
print("URL : $url"); print("URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
print(jsonBody); print(jsonBody);
} // }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -1,19 +1,21 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/er/ErPatientShareModel.dart'; import 'package:diplomaticquarterapp/core/model/er/ErPatientShareModel.dart';
import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
class EdOnlineServices extends BaseService { class EdOnlineServices extends BaseService {
List<TriageQuestionsModel> triageQuestionsModelList = List(); List<TriageQuestionsModel> triageQuestionsModelList = List();
ErPatientShareModel erPatientShareModel; ErPatientShareModel erPatientShareModel;
Future getQuestions() async { Future getQuestions() async {
hasError =false; hasError = false;
triageQuestionsModelList.clear(); triageQuestionsModelList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['ProjectID'] = 15; body['ProjectID'] = 15;
await baseAppClient.post(ER_GET_VISUAL_TRIAGE_QUESTIONS, await baseAppClient.post(ER_GET_VISUAL_TRIAGE_QUESTIONS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
triageQuestionsModelList.clear(); triageQuestionsModelList.clear();
response['ER_TriageQuestionsList'].forEach((questions) { response['ER_TriageQuestionsList'].forEach((questions) {
triageQuestionsModelList.add(TriageQuestionsModel.fromJson(questions)); triageQuestionsModelList.add(TriageQuestionsModel.fromJson(questions));
@ -24,26 +26,19 @@ class EdOnlineServices extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientPaymentInformation({var id}) async { Future getPatientPaymentInformation({var id}) async {
hasError =false; hasError = false;
await baseAppClient.post(ER_GetPatientPaymentInformationForERClinic, await baseAppClient.post(ER_GetPatientPaymentInformationForERClinic, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { erPatientShareModel = ErPatientShareModel.fromJson(response['ER_PatientShare']);
erPatientShareModel =
ErPatientShareModel.fromJson(response['ER_PatientShare']);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: Map.from({"ProjectID":15,"ClinicID":10})); }, body: Map.from({"ProjectID": 15, "ClinicID": 10}));
} }
Future saveQuestionsInformation( Future saveQuestionsInformation({String notes, String chiefComplaint, int projectId, DateTime selectedTime, List<TriageQuestionsModel> selectedQuestions}) async {
{String notes, AppSharedPreferences sharedPref = AppSharedPreferences();
String chiefComplaint, hasError = false;
int projectId,
DateTime selectedTime,
List<TriageQuestionsModel> selectedQuestions}) async {
hasError =false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
List<Map> checklist = List(); List<Map> checklist = List();
@ -53,27 +48,15 @@ class EdOnlineServices extends BaseService {
if (user.age > 14) { if (user.age > 14) {
selectedQuestions.forEach((element) { selectedQuestions.forEach((element) {
int score = int.parse(element.adultPoints); int score = int.parse((element.adultPoints != "" ? element.adultPoints : "0"));
riskScore += score; riskScore += score;
checklist.add(Map.from({ checklist.add(Map.from({"IsSelected": 1, "ParameterCode": element.parameterCode, "ParameterGroup": element.parameterGroup, "ParameterType": element.parameterType, "Score": score}));
"IsSelected": 1,
"ParameterCode": element.parameterCode,
"ParameterGroup": element.parameterGroup,
"ParameterType": element.parameterType,
"Score": score
}));
}); });
} else { } else {
selectedQuestions.forEach((element) { selectedQuestions.forEach((element) {
int score = int.parse(element.pediaPoints); int score = int.parse(element.pediaPoints);
riskScore += score; riskScore += score;
checklist.add(Map.from({ checklist.add(Map.from({"IsSelected": 1, "ParameterCode": element.parameterCode, "ParameterGroup": element.parameterGroup, "ParameterType": element.parameterType, "Score": score}));
"IsSelected": 1,
"ParameterCode": element.parameterCode,
"ParameterGroup": element.parameterGroup,
"ParameterType": element.parameterType,
"Score": score
}));
}); });
} }
@ -81,14 +64,14 @@ class EdOnlineServices extends BaseService {
"Notes": notes, "Notes": notes,
"ChiefComplaint": chiefComplaint, "ChiefComplaint": chiefComplaint,
"PatientId": user.patientID, "PatientId": user.patientID,
"ProjectId": 15, "ProjectId": projectId,
"RiskScore": riskScore, "RiskScore": riskScore,
"checklist": checklist.map((e) => e).toList() "checklist": checklist.map((e) => e).toList()
}; };
await baseAppClient.post(ER_SAVE_TRIAGE_INFORMATION, sharedPref.setInt(ER_CHECKIN_RISK_SCORE, riskScore);
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) { await baseAppClient.post(ER_SAVE_TRIAGE_INFORMATION, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);

@ -24,6 +24,8 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList; List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList;
List<PrescriptionReportINP> get prescriptionReportListINP => _prescriptionsService.prescriptionReportListINP; List<PrescriptionReportINP> get prescriptionReportListINP => _prescriptionsService.prescriptionReportListINP;
List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList;

@ -280,6 +280,52 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
), ),
], ],
), ),
mWidth(3),
Row(
children: [
Text(
TranslationBase.of(context).insuranceCompany + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].companyName.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
mWidth(3),
Row(
children: [
Text(
TranslationBase.of(context).policyNo + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].insurancePolicyNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
], ],
), ),
), ),
@ -504,7 +550,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, AppGlobal.context).then((res) { service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo']); showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -512,7 +558,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
}); });
} }
showAlertDialog(dynamic invoiceNo) { showAlertDialog(dynamic invoiceNo, dynamic projectID) {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
confirmMessage: TranslationBase.of(context).ancillaryOrderPaymentSuccess + invoiceNo.toString(), confirmMessage: TranslationBase.of(context).ancillaryOrderPaymentSuccess + invoiceNo.toString(),

@ -32,11 +32,7 @@ class ConfirmPaymentPage extends StatelessWidget {
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ConfirmPaymentPage( ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
{this.advanceModel,
this.patientInfoAndMobileNumber,
this.selectedPaymentMethod,
this.authenticatedUser});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -51,11 +47,9 @@ class ConfirmPaymentPage extends StatelessWidget {
print("dialog dismissed"); print("dialog dismissed");
print(value); print(value);
if (value != null && value) { if (value != null && value) {
AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
new AppoitmentAllHistoryResultList();
appo.projectID = patientInfoAndMobileNumber.projectID; appo.projectID = patientInfoAndMobileNumber.projectID;
openPayment(selectedPaymentMethod, authenticatedUser, openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), appo);
double.parse(advanceModel.amount), appo);
} }
}); });
} }
@ -161,14 +155,9 @@ class ConfirmPaymentPage extends StatelessWidget {
disabled: model.state == ViewState.Busy, disabled: model.state == ViewState.Busy,
onTap: () { onTap: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) {
.sendActivationCodeForAdvancePayment(
patientID: int.parse(advanceModel.fileNumber),
projectID: advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal && if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog();
model.state != ViewState.Error) showSMSDialog();
}); });
}, },
), ),
@ -202,29 +191,11 @@ class ConfirmPaymentPage extends StatelessWidget {
return 'assets/images/new-design/mada.png'; return 'assets/images/new-design/mada.png';
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
double amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
browser = new MyInAppBrowser(
onExitCallback: onBrowserExit,
appo: appo,
onLoadStartCallback: onBrowserLoadStart);
browser.openPaymentBrowser( browser.openPaymentBrowser(amount, "Advance Payment", Utils.getAdvancePaymentTransID(authenticatedUser.projectID, authenticatedUser.patientID), appo.projectID.toString(),
amount, authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "");
"Advance Payment",
Utils.getAdvancePaymentTransID(
authenticatedUser.projectID, authenticatedUser.patientID),
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser,
false,
"3",
"");
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -256,12 +227,7 @@ class ConfirmPaymentPage extends StatelessWidget {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), AppGlobal.context).then((res) {
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print("Printing Payment Status Reponse!!!!"); print("Printing Payment Status Reponse!!!!");
print(res); print(res);
@ -282,17 +248,10 @@ class ConfirmPaymentPage extends StatelessWidget {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo);
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -300,14 +259,10 @@ class ConfirmPaymentPage extends StatelessWidget {
}); });
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) {
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res); print(res);
navigateToHome(AppGlobal.context); navigateToHome(AppGlobal.context);

@ -86,12 +86,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
margin: EdgeInsets.only(top: 6.0), margin: EdgeInsets.only(top: 6.0),
child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)), child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)),
), ),
InkWell( Container(
onTap: () {
// dropdownKey.currentState;
// openDropdown(clinicDropdownKey);
},
child: Container(
width: double.infinity, width: double.infinity,
decoration: containerRadius(Colors.white, 12), decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(top: 12), margin: EdgeInsets.only(top: 12),
@ -150,7 +145,6 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
], ],
), ),
), ),
),
], ],
), ),
), ),

@ -42,37 +42,10 @@ class _DdServicesPageState extends State<DdServicesPage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: 'ED Online', appBarTitle: 'ED Online',
showNewAppBarTitle: true,
isShowDecPage: true, isShowDecPage: true,
isShowAppBar: true, isShowAppBar: true,
// appBarTitle: AppBar( showNewAppBar: true,
// elevation: 0,
// textTheme: TextTheme(
// headline6: TextStyle(
// color: Theme.of(context).textTheme.headline1.color,
// fontWeight: FontWeight.bold),
// ),
// title: Text(
// 'ED Online',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// color: Theme.of(context).textTheme.headline1.color,
// fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
// // bold: true,
// // color: Colors.white,
// ),
// leading: Builder(
// builder: (BuildContext context) {
// return IconButton(
// icon: Icon(Icons.arrow_back),
// color: Theme.of(context).textTheme.headline1.color,
// onPressed: () {
// showConfirmMessage(context);
// },
// );
// },
// ),
// centerTitle: true,
// ),
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,

@ -20,17 +20,15 @@ class EdOnlineNotesPage extends StatefulWidget {
final List<TriageQuestionsModel> selectedQuestions; final List<TriageQuestionsModel> selectedQuestions;
final Function changePageViewIndex; final Function changePageViewIndex;
TriageInformationRequest triageInformationRequest; TriageInformationRequest triageInformationRequest;
EdOnlineNotesPage(
{Key key, this.selectedQuestions, this.changePageViewIndex,this.triageInformationRequest}) EdOnlineNotesPage({Key key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest});
;
@override @override
_EdOnlineNotesPageState createState() => _EdOnlineNotesPageState(); _EdOnlineNotesPageState createState() => _EdOnlineNotesPageState();
} }
class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> { class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
TextEditingController _chiefComplaintsTextController = TextEditingController _chiefComplaintsTextController = TextEditingController();
TextEditingController();
TextEditingController _noteTextController = TextEditingController(); TextEditingController _noteTextController = TextEditingController();
DateTime selectedTime; DateTime selectedTime;
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
@ -83,13 +81,11 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
// height: 65, // height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(selectedTime == null ?TranslationBase.of(context).errorExpectedArrivalTime:TranslationBase.of(context).expectedArrivalTime), Texts(selectedTime == null ? TranslationBase.of(context).errorExpectedArrivalTime : TranslationBase.of(context).expectedArrivalTime),
Texts(getDate(context)), Texts(getDate(context)),
], ],
), ),
@ -116,7 +112,7 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(left: 5,right: 5), margin: EdgeInsets.only(left: 5, right: 5),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
@ -125,10 +121,12 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
), ),
), ),
), ),
SizedBox(width: 10,), SizedBox(
width: 10,
),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(left: 5,right: 5), margin: EdgeInsets.only(left: 5, right: 5),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
@ -137,21 +135,21 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
onTap: () async { onTap: () async {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.saveQuestionsInformation( model
chiefComplaint: .saveQuestionsInformation(
_chiefComplaintsTextController.text.toString(), chiefComplaint: _chiefComplaintsTextController.text.toString(),
notes: _noteTextController.text.toString(), notes: _noteTextController.text.toString(),
selectedQuestions: widget.selectedQuestions, selectedQuestions: widget.selectedQuestions,
projectId: widget.triageInformationRequest.projectID,selectedTime: selectedTime).then((value) { projectId: widget.triageInformationRequest.projectID,
selectedTime: selectedTime)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal) if (model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
else else {
{
widget.changePageViewIndex(4); widget.changePageViewIndex(4);
} }
}).catchError((onError) {
}).catchError((onError){
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: onError.toString()); AppToast.showErrorToast(message: onError.toString());
}); });

@ -1,32 +1,38 @@
import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart'; import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.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/theme/colors.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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../Constants.dart'; import 'package:url_launcher/url_launcher.dart';
class EdOnlineSelectedHospitalPage extends StatefulWidget { class EdOnlineSelectedHospitalPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
TriageInformationRequest triageInformationRequest; TriageInformationRequest triageInformationRequest;
EdOnlineSelectedHospitalPage( EdOnlineSelectedHospitalPage({Key key, this.changePageViewIndex, this.triageInformationRequest}) : super(key: key);
{Key key, this.changePageViewIndex,this.triageInformationRequest})
: super(key: key);
@override @override
_EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState();
_EdOnlineSelectedHospitalPageState();
} }
class _EdOnlineSelectedHospitalPageState class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalPage> {
extends State<EdOnlineSelectedHospitalPage> { HospitalsModel selectedProject;
final GlobalKey locationDropdownKey = GlobalKey();
ProjectViewModel projectViewModel;
int _selected = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<EdOnlineViewModel>( return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getHospitals(), onModelReady: (model) => model.getHospitals(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -35,67 +41,139 @@ class _EdOnlineSelectedHospitalPageState
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
children: [ children: [
...List.generate( Container(
model.hospitals.length, margin: EdgeInsets.all(12.0),
(index) => Column( child: Text(TranslationBase.of(context).onlineCheckInAgreement, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)),
),
Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.all(12.0),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( Text(
height: 2, TranslationBase.of(context).selectLocation,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
), ),
Row( ),
children: <Widget>[ Container(
Expanded( height: 20,
flex: 1, child: DropdownButtonHideUnderline(
child: InkWell( child: DropdownButton<HospitalsModel>(
onTap: () { onTap: () {
setState(() { print("Clicked");
widget.triageInformationRequest.selectedHospital = model.hospitals[index];
widget.triageInformationRequest.projectID = model.hospitals[index].iD;
});
}, },
child: ListTile( key: locationDropdownKey,
title: Text(model.hospitals[index].name + hint: new Text(
' ${model.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).selectHospital,
TranslationBase.of(context).km), ),
leading: Radio( value: selectedProject,
value: model.hospitals[index], iconSize: 0,
groupValue: widget.triageInformationRequest.selectedHospital, isExpanded: true,
activeColor: secondaryColor, style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
onChanged: (value) { items: model.hospitals.map((HospitalsModel item) {
return new DropdownMenuItem<HospitalsModel>(
value: item,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(item.name + " - " + item.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_)],
),
);
}).toList(),
onChanged: (newValue) {
setState(() { setState(() {
widget.triageInformationRequest.selectedHospital = model.hospitals[index]; selectedProject = newValue;
widget.triageInformationRequest.projectID = model.hospitals[index].iD; widget.triageInformationRequest.selectedHospital = selectedProject;
}); });
}, },
), ),
), ),
), ),
)
], ],
), ),
SizedBox(
height: 5.0,
), ),
Icon(Icons.keyboard_arrow_down),
], ],
), ),
) ),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: <Widget>[
Radio(
value: 1,
groupValue: _selected,
onChanged: onRadioChanged,
),
Text(
TranslationBase.of(context).agreeTo,
style: new TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: CustomColors.textColor,
),
),
mWidth(4),
InkWell(
onTap: () {
launch("https://hmg.com/en/Pages/Privacy.aspx");
},
child: Text(
TranslationBase.of(context).termsConditoins,
style: new TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: CustomColors.accentColor,
),
),
),
], ],
), ),
), ),
bottomSheet: Container( DefaultButton(
height: 76, TranslationBase.of(context).payNow.toUpperCase(),
child: Padding( (){},
padding: const EdgeInsets.all(8.0), // selectedProcList.length > 0 && getTotalValue() != "0.00"
child: SecondaryButton( // ? () {
// textColor: Colors.white, // makePayment();
color: Theme.of(context).primaryColor, // }
label: TranslationBase.of(context).next.toUpperCase(), // : null,
disabled: widget.triageInformationRequest.selectedHospital==null, color: CustomColors.green,
onTap: () => widget.changePageViewIndex(1)), disabledColor: CustomColors.grey2,
),
],
), ),
), ),
// bottomSheet:
// Container(
// height: 76,
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: SecondaryButton(
// // textColor: Colors.white,
// color: Theme.of(context).primaryColor,
// label: TranslationBase.of(context).next.toUpperCase(),
// disabled: (widget.triageInformationRequest.selectedHospital == null || _selected == 0),
// onTap: () => widget.changePageViewIndex(1)),
// ),
// ),
), ),
); );
} }
void onRadioChanged(int value) {
setState(() {
_selected = value;
});
}
} }

@ -1,27 +1,42 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.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: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';
class EdPaymentInformationPage extends StatefulWidget { class EdPaymentInformationPage extends StatefulWidget {
final HospitalsModel selectedHospital; final HospitalsModel selectedHospital;
const EdPaymentInformationPage({Key key, this.selectedHospital}) : super(key: key); const EdPaymentInformationPage({Key key, this.selectedHospital}) : super(key: key);
@override @override
_EdPaymentInformationPageState createState() => _EdPaymentInformationPageState createState() => _EdPaymentInformationPageState();
_EdPaymentInformationPageState();
} }
class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> { class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
MyInAppBrowser browser;
ProjectViewModel projectViewModel;
String transID = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<EdOnlineViewModel>( return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getPatientPaymentInformation(), onModelReady: (model) => model.getPatientPaymentInformation(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -31,52 +46,30 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: Column( child: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white),
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0),
EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).testFee,
style: TextStyle(
color: Colors.black,
fontSize: 22.0,
fontWeight: FontWeight.bold)),
), ),
if(model.erPatientShareModel!=null) if (model.erPatientShareModel != null)
Table( Table(
children: [ children: [
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: Texts(TranslationBase.of(context).testFee)),
child: TableCell(child: Texts(model.erPatientShareModel.patientShare.toStringAsFixed(2))),
Texts(TranslationBase.of(context).testFee)),
TableCell(
child: Texts(model
.erPatientShareModel.patientShare
.toStringAsFixed(2))),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: Texts(TranslationBase.of(context).patientTaxToDo)),
child: Texts( TableCell(child: Texts(model.erPatientShareModel.patientTaxAmount.toStringAsFixed(2))),
TranslationBase.of(context).patientTaxToDo)),
TableCell(
child: Texts(model
.erPatientShareModel.patientTaxAmount
.toStringAsFixed(2))),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: Texts(TranslationBase.of(context).patientShareTotalToDo)),
child: Texts(TranslationBase.of(context) TableCell(child: Texts(model.erPatientShareModel.patientShareWithTax.toStringAsFixed(2))),
.patientShareTotalToDo)),
TableCell(
child: Texts(model
.erPatientShareModel.patientShareWithTax
.toStringAsFixed(2))),
]), ]),
], ],
), ),
@ -94,9 +87,19 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).next.toUpperCase(), label: TranslationBase.of(context).next.toUpperCase(),
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: PaymentMethod())).then( Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
setState(() {});
},
))).then(
(value) { (value) {
//TODO Haroun call API here //TODO Haroun call API here
print(value);
if (value != null) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.selectedHospital.iD;
openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax, appo);
}
}, },
); );
}, },
@ -107,6 +110,82 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
); );
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID);
browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(),
authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "");
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (isPaymentMade) checkPaymentStatus(appo);
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
ER_createAdvancePayment(res, appo);
} else {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
ER_createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.ER_createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
ER_InsertEROnlinePaymentDetails(res, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
ER_InsertEROnlinePaymentDetails(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.ER_InsertEROnlinePaymentDetails(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
} }

@ -9,6 +9,7 @@ import 'package:provider/provider.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'AmbulanceReq.dart'; import 'AmbulanceReq.dart';
import 'EdOnline/DdServicesPage.dart';
import 'NearestEr.dart'; import 'NearestEr.dart';
class ErOptions extends StatefulWidget { class ErOptions extends StatefulWidget {
@ -86,14 +87,14 @@ class _ErOptionsState extends State<ErOptions> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.push(context, FadePage(page: DdServicesPage())); Navigator.push(context, FadePage(page: DdServicesPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: "ED", title: "ED",
imagePath: 'assets/images/new-design/AM.PNG', imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service, subTitle: TranslationBase.of(context).service,
isPngImage: true, isPngImage: true,
isEnable: false, isEnable: true,
), ),
), ),
], ],

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
@ -40,7 +41,7 @@ class PrescriptionItemsPage extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: Column( body: model.state != ViewState.Busy ? Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -56,7 +57,7 @@ class PrescriptionItemsPage extends StatelessWidget {
"", "",
prescriptions.name, prescriptions.name,
DateUtil.convertStringToDate(prescriptions.appointmentDate), DateUtil.convertStringToDate(prescriptions.appointmentDate),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)), DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList[0].orderDate)),
prescriptions.nationalityFlagURL, prescriptions.nationalityFlagURL,
prescriptions.doctorRate, prescriptions.doctorRate,
prescriptions.actualDoctorRate, prescriptions.actualDoctorRate,
@ -406,7 +407,7 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
], ],
), ) : Container(),
), ),
); );
} }

@ -364,7 +364,7 @@ class DoctorsListService extends BaseService {
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
if(clinicID == 253) { if (clinicID == 253) {
List<String> procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList(); List<String> procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList();
request["GeneralProcedureList"] = procedureID; request["GeneralProcedureList"] = procedureID;
request["InitialSlotDuration"] = projectViewModel.laserSelectionDuration; request["InitialSlotDuration"] = projectViewModel.laserSelectionDuration;
@ -480,10 +480,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
request = { request = {"ProjectID": projectID, "AppointmentNo": appoID};
"ProjectID": projectID,
"AppointmentNo": appoID
};
dynamic localRes; dynamic localRes;
@ -1378,6 +1375,92 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> ER_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"PatientTypeID": authUser.patientType,
"ERAdvanceAmount": {
"AppointmentID": paymentReference,
"ProjectId": projectID,
"PatientId": authUser.patientID,
"ClinicId": 10,
"DepositorName": authUser.firstName + " " + authUser.lastName,
"MemberId": authUser.patientID,
"NationalityID": authUser.nationalityID,
"PaymentAmount": payedAmount,
"PaymentDate": DateUtil.convertDateToString(DateTime.now()),
"PaymentMethodName": paymentMethodName,
"PaymentReferenceNumber": paymentReference,
"SourceType": 2
}
};
dynamic localRes;
await baseAppClient.post(ER_CREATE_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> ER_InsertEROnlinePaymentDetails(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"PatientTypeID": authUser.patientType,
"EROnlineCheckinPaymentDetails": {
"CheckinDate": DateUtil.convertDateToString(DateTime.now()),
"ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()),
"AppointmentID": paymentReference,
"ProjectId": projectID,
"PatientId": authUser.patientID,
"ClinicId": 10,
"FormId": 15,
"DepositorName": authUser.firstName + " " + authUser.lastName,
"MemberId": authUser.patientID,
"NationalityID": authUser.nationalityID,
"PaymentAmount": payedAmount,
"PaymentDate": DateUtil.convertDateToString(DateTime.now()),
"PaymentMethodName": paymentMethodName,
"PaymentReferenceNumber": paymentReference,
"TriageScore": await sharedPref.getInt(ER_CHECKIN_RISK_SCORE)
}
};
dynamic localRes;
await baseAppClient.post(ER_INSERT_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async {
localRes = response;
sharedPref.remove(ER_CHECKIN_RISK_SCORE);
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientHealthDataStats(int medCategoryId, int medCategoryStsId, BuildContext context) async { Future<Map> getPatientHealthDataStats(int medCategoryId, int medCategoryStsId, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -33,13 +33,13 @@ class MyInAppBrowser extends InAppBrowser {
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';

Loading…
Cancel
Save