Merge remote-tracking branch 'origin/Dev_3.3_InPatient_CR' into dev_v3.13.6

# Conflicts:
#	lib/config/config.dart
#	lib/config/localized_values.dart
#	lib/core/service/client/base_app_client.dart
#	lib/core/viewModels/project_view_model.dart
#	lib/pages/BookAppointment/BookSuccess.dart
#	lib/pages/MyAppointments/MyAppointments.dart
#	lib/pages/insurance/AttachInsuranceCardImageDialog.dart
#	lib/pages/login/confirm-login.dart
#	lib/pages/paymentService/payment_service.dart
#	lib/uitl/push-notification-handler.dart
#	lib/uitl/translations_delegate_base.dart
#	lib/uitl/utils.dart
#	lib/uitl/utils_new.dart
#	lib/widgets/avatar/large_avatar.dart
#	lib/widgets/bottom_navigation/bottom_navigation_item.dart
#	lib/widgets/bottom_options/BottomSheet.dart
#	lib/widgets/data_display/medical/medical_profile_item.dart
#	lib/widgets/drawer/app_drawer_widget.dart
#	pubspec.yaml
dev_v3.13.6_voipcall
Aamir Muhammad 11 months ago
commit 77651f9652

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -617,6 +617,40 @@ var GET_NATIONALITY = 'Services/Lists.svc/REST/GetNationality';
var PAYFORT_TEST_URL = 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi'; var PAYFORT_TEST_URL = 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi';
var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi'; var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi';
// Check If InPatient API
var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo';
var CHECK_IF_PATIENT_ADMITTED = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest';
// Get General Instructions API
var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions';
// Get Medical Instructions API
var GET_MEDICAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getPatientAdmissionRequest';
var GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS = 'Services/INPs.svc/REST/getInpatientAdvancePendingPayment';
var GET_INPATIENT_PAID_ADVANCE_PAYMENT = 'Services/INPs.svc/REST/getInpatientAdvanceHistory';
var GET_INPATIENT_ADVANCE_PAYMENT_LINK = 'Services/PayFort_Serv.svc/REST/InsertInPatientAdvanceDetails';
var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder';
var INPATIENT_DISCHARGE_MEDICATIONS = 'Services/INPs.svc/REST/chekPatientHasDischargeMedicine';
var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymothermrn';
var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification';
//Meal Plan APIs
var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients';
var GET_CURRENT_WEEKID_WEEKDAY = 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP';
var GET_MEALS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile';
var GET_MEAL_ITEMS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID';
var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder';
var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity';
var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany';

@ -175,7 +175,7 @@ const Map localizedValues = {
"reminderCancelSuccess": {"en": "The reminder has been cancelled successfully", "ar": "تم إلغاء التذكير بنجاح"}, "reminderCancelSuccess": {"en": "The reminder has been cancelled successfully", "ar": "تم إلغاء التذكير بنجاح"},
"patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, "patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"},
"patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"},
"patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"}, "patientShareTotalToDo": {"en": "Total amount due: ", "ar": "المبلغ الإجمالي المستحق:"},
'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'}, 'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'},
'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'}, 'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'},
'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'}, 'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'},
@ -1891,6 +1891,47 @@ const Map localizedValues = {
"updateInsuranceManuallyDialog": {"en": "Would you like to update your insurance manually?", "ar": "هل ترغب في تحديث التأمين الخاص بك يدويًا؟"}, "updateInsuranceManuallyDialog": {"en": "Would you like to update your insurance manually?", "ar": "هل ترغب في تحديث التأمين الخاص بك يدويًا؟"},
"viewReport": {"en": "View Report", "ar": "عرض التقرير"}, "viewReport": {"en": "View Report", "ar": "عرض التقرير"},
"sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."},
"InPatient": {"en": "InPatient", "ar": "خدمات"},
"InPatientServices": {"en": "Services", "ar": "تنويم"},
"InPatientServicesHeader": {"en": "InPatient Services", "ar": "خدمات التنويم"},
"admissionGeneral": {"en": "Admission General", "ar": "اقرار"},
"consent": {"en": "Consent", "ar": "التنويم"},
"generalInstructionsTitle": {"en": "General", "ar": "تعليمات"},
"generalInstructionsSubTitle": {"en": "Instructions", "ar": "التنويم العامة"},
"medicalInstructionsTitle": {"en": "Medical", "ar": "التعليمات الطبية"},
"medicalInstructionsSubTitle": {"en": "Instructions", "ar": "قبل التنويم"},
"mealPlanTitle": {"en": "Meal Plan", "ar": "خدمات"},
"mealPlanSubTitle": {"en": "Services", "ar": "الوجبات"},
"birthNotificationTitle": {"en": "Birth", "ar": "خدمات"},
"birthNotificationSubTitle": {"en": "Notification", "ar": "تبليغ الولادة"},
"admissionNoticeTitle": {"en": "Admission", "ar": "إشعار"},
"admissionNoticeSubTitle": {"en": "Notice", "ar": "تنويم"},
"mothersMRN": {"en": "Mother's MRN *", "ar": "رقم ملف الأم"},
"mothersName": {"en": "Mother's name *", "ar": "اسم الأم"},
"fathersNameEN": {"en": "Father's name english *", "ar": "اسم الاب انجليزي"},
"fathersNameAR": {"en": "Father's name arabic *", "ar": "اسم الاب عربي"},
"babysNameEN": {"en": "Baby's name english *", "ar": "اسم المولود انجليزي"},
"babysNameAR": {"en": "Baby's name arabic *", "ar": "اسم المولود عربي"},
"contactNumber": {"en": "Contact number *", "ar": "رقم الاتصال"},
"scanID": {"en": "Scan ID", "ar": "معرف المسح"},
"birthNotificationNotes1": {
"en": "For Saudis: Provide copy of the identification card for both couples. If the wife doesn't have identification card, The family card must be provided.",
"ar": "للسعوديين : إرفاق صورة من بطاقة الأحوال لكلا الزوجين وفي حال عدم توفر بطاقة الزوجة ترفق عنها بطاقة العائلة"
},
"birthNotificationNotes2": {"en": "Non Saudis: Provide copy of iqama or copy of the passport.", "ar": "لغير السعوديين : إرفاق صورة الإقامة آأو جواز السفر"},
"birthNotificationNotes3": {"en": "For Residents without identification card: Provide marriage contract.", "ar": "للمواطنين الغير حاملين لبطاقة الأحوال : إرفاق صورة من عقد الزواج برقم الحاسب"},
"placeOrder": {"en": "Place Order", "ar": "مكان الامر"},
"isFasting": {"en": "Are you fasting?", "ar": "هل أنت صائم؟"},
"noGeneralInstructions": {"en": "You do not have any general instructions right now.", "ar": "ليس لديك أي تعليمات عامة في الوقت الحالي."},
"noMedicalInstructions": {"en": "You do not have any medical instructions right now.", "ar": "ليس لديك أي تعليمات طبية في الوقت الحالي."},
"medicalInstructions": {"en": "Medical Instructions:", "ar": "تعليمات طبية:"},
"generalInstructions": {"en": "General Instructions:", "ar": "تعليمات عامة:"},
"copyLink": {"en": "COPY LINK", "ar": "نسخ الوصلة:"},
"paymentLinkCopied": {"en": "Payment link copied to your clipboard!'", "ar": "تم نسخ رابط الدفع إلى الحافظة الخاصة بك!"},
"copyLinkTxt": {"en": "Or you can copy the payment link from below & send it to someone who can pay on your behalf: ", "ar": "أو يمكنك نسخ رابط الدفع من الأسفل وإرساله إلى شخص يمكنه الدفع نيابة عنك:"},
"proErrorMessage": {"en": "Dear patient, Our staff is currently out of office, please note that our working hours are from 7:00 AM to 10:00 PM, and we'd love to help you during that time, or you can call <insert number here>", "ar": "عزيزي المريض ، طاقم العمل لدينا خارج المكتب حاليًا ، يرجى ملاحظة أن ساعات العمل لدينا من 7:00 صباحًا إلى 10:00 مساءً ، ويسعدنا مساعدتك خلال هذا الوقت ، أو يمكنك الاتصال بـ <أدخل الرقم هنا>"},
"admissionNo": {"en": "Admission No", "ar": "رقم القبول:"},
"admissionReqNo": {"en": "Admission Request No", "ar": "رقم طلب القبول:"},
"dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"},
"selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"},
"invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."}, "invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."},
@ -1903,4 +1944,11 @@ const Map localizedValues = {
"validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"},
"locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, "locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
"onlyAdmitted": {"en": "This service is only available for admitted patients", "ar": "هذه الخدمة متاحة فقط للمرضى المقبولين"},
"assistYou": {"en": "How we may assist you?", "ar": "كيف يمكننا مساعدتك؟"},
"receive": {"en": "Receive", "ar": "تجهيز"},
"PRO": {"en": "PRO", "ar": "علاقات المرضى"},
"patientRelationOffice": {"en": "Patient Relation Office", "ar": "علاقات المرضى"},
}; };

@ -150,8 +150,8 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body?['PatientID'] = 1231755; //3844083 // body['PatientID'] = 4767370; //3844083
// body?['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
// Mobile no.: 0502303285 // Mobile no.: 0502303285

@ -11,13 +11,14 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info_response_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_request_info_response_model.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart'; import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart';
bool isAppArabic = false; bool isAppArabic = false;
class ProjectViewModel extends BaseViewModel { class ProjectViewModel extends BaseViewModel {
GAnalytics get analytics => locator<GAnalytics>(); GAnalytics get analytics => locator<GAnalytics>();
@ -36,11 +37,19 @@ class ProjectViewModel extends BaseViewModel {
String error = ''; String error = '';
dynamic searchvalue; dynamic searchvalue;
bool isLogin = false; bool isLogin = false;
int laserSelectionDuration;
bool isPatientAdmitted = false;
bool patientHasAdmissionRequest = false;
int inPatientProjectID = 0;
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel;
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel;
double _latitude;
double _longitude;
RegisterInfoResponse _registerInfo = RegisterInfoResponse(); RegisterInfoResponse _registerInfo = RegisterInfoResponse();
RegisterInfoResponse get registerInfo => _registerInfo; RegisterInfoResponse get registerInfo => _registerInfo;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale; Locale get appLocal => _appLocale;
@ -63,7 +72,7 @@ class ProjectViewModel extends BaseViewModel {
List<ProjectDetailListModel> get projectDetailListModel => _projectDetailListModel; List<ProjectDetailListModel> get projectDetailListModel => _projectDetailListModel;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
late StreamSubscription subscription; late StreamSubscription subscription;
late double _latitude; late double _latitude;
@ -119,6 +128,31 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
setIsPatientAdmitted(bool isAdmitted) {
this.isPatientAdmitted = isAdmitted;
notifyListeners();
}
setPatientHasAdmissionRequest(bool hasAdmissionRequest) {
this.patientHasAdmissionRequest = hasAdmissionRequest;
notifyListeners();
}
setInPatientProjectID(int projectID) {
this.inPatientProjectID = projectID;
notifyListeners();
}
setInPatientAdmissionInfo(GetAdmissionInfoResponseModel _getAdmissionInfoResponseModel) {
this.getAdmissionInfoResponseModel = _getAdmissionInfoResponseModel;
notifyListeners();
}
setInPatientAdmissionRequest(GetAdmissionRequestInfoResponseModel _getAdmissionRequestInfoResponseModel) {
this.getAdmissionRequestInfoResponseModel = _getAdmissionRequestInfoResponseModel;
notifyListeners();
}
setPrivilegeModelList({List<PrivilegeModel>? privilege}) { setPrivilegeModelList({List<PrivilegeModel>? privilege}) {
this.isLoginChild = isLoginChild; this.isLoginChild = isLoginChild;
privilegeRootUser = privilege!; privilegeRootUser = privilege!;
@ -162,7 +196,7 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
bool havePrivilege(int id) { bool havePrivilege(int id) {
bool isHavePrivilege = false; bool isHavePrivilege = false;
@ -192,7 +226,7 @@ class ProjectViewModel extends BaseViewModel {
searchvalue = data; searchvalue = data;
notifyListeners(); notifyListeners();
} }
void setLatitudeLongitude(double lat, double long) { void setLatitudeLongitude(double lat, double long) {
_latitude = lat; _latitude = lat;
_longitude = long; _longitude = long;

@ -0,0 +1,92 @@
class GetAdmissionInfoResponseModel {
String setupID;
int projectID;
int admissionNo;
String admissionDate;
int admissionRequestNo;
int admissionType;
int patientType;
int patientID;
int clinicID;
int doctorID;
int admittingClinicID;
int admittingDoctorID;
int categoryID;
String roomID;
String bedID;
dynamic dischargeDate;
int approvalNo;
int status;
String statusDesc;
String statusDescN;
GetAdmissionInfoResponseModel(
{this.setupID,
this.projectID,
this.admissionNo,
this.admissionDate,
this.admissionRequestNo,
this.admissionType,
this.patientType,
this.patientID,
this.clinicID,
this.doctorID,
this.admittingClinicID,
this.admittingDoctorID,
this.categoryID,
this.roomID,
this.bedID,
this.dischargeDate,
this.approvalNo,
this.status,
this.statusDesc,
this.statusDescN});
GetAdmissionInfoResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
admissionNo = json['AdmissionNo'];
admissionDate = json['AdmissionDate'];
admissionRequestNo = json['AdmissionRequestNo'];
admissionType = json['AdmissionType'];
patientType = json['PatientType'];
patientID = json['PatientID'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
admittingClinicID = json['AdmittingClinicID'];
admittingDoctorID = json['AdmittingDoctorID'];
categoryID = json['CategoryID'];
roomID = json['RoomID'];
bedID = json['BedID'];
dischargeDate = json['DischargeDate'];
approvalNo = json['ApprovalNo'];
status = json['Status'];
statusDesc = json['StatusDesc'];
statusDescN = json['StatusDescN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionDate'] = this.admissionDate;
data['AdmissionRequestNo'] = this.admissionRequestNo;
data['AdmissionType'] = this.admissionType;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['AdmittingClinicID'] = this.admittingClinicID;
data['AdmittingDoctorID'] = this.admittingDoctorID;
data['CategoryID'] = this.categoryID;
data['RoomID'] = this.roomID;
data['BedID'] = this.bedID;
data['DischargeDate'] = this.dischargeDate;
data['ApprovalNo'] = this.approvalNo;
data['Status'] = this.status;
data['StatusDesc'] = this.statusDesc;
data['StatusDescN'] = this.statusDescN;
return data;
}
}

@ -0,0 +1,86 @@
class GetAdmissionRequestInfoResponseModel {
int admissionRequestNo;
String clinicName;
String doctorName;
String expectedAdmissionDate;
List<MedicaLInstructions> medicalInstructions;
dynamic medicalInstructionsXML;
String medicalRemarks;
int projectId;
String projectName;
String setupId;
int clinicId;
int doctorId;
GetAdmissionRequestInfoResponseModel(
{this.admissionRequestNo,
this.clinicName,
this.doctorName,
this.expectedAdmissionDate,
this.medicalInstructions,
this.medicalInstructionsXML,
this.medicalRemarks,
this.projectId,
this.projectName,
this.setupId,
this.clinicId,
this.doctorId});
GetAdmissionRequestInfoResponseModel.fromJson(Map<String, dynamic> json) {
admissionRequestNo = json['admissionRequestNo'];
clinicName = json['clinicName'];
doctorName = json['doctorName'];
clinicId = json['ClinicID'];
doctorId = json['DoctorID'];
expectedAdmissionDate = json['expectedAdmissionDate'];
if (json['medicaLInstructions'] != null) {
medicalInstructions = <MedicaLInstructions>[];
json['medicaLInstructions'].forEach((v) {
medicalInstructions.add(new MedicaLInstructions.fromJson(v));
});
}
medicalInstructionsXML = json['medicalInstructionsXML'];
medicalRemarks = json['medicalRemarks'];
projectId = json['projectId'];
projectName = json['projectName'];
setupId = json['setupId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['admissionRequestNo'] = this.admissionRequestNo;
data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName;
data['clinicId'] = this.clinicId;
data['doctorId'] = this.doctorId;
data['expectedAdmissionDate'] = this.expectedAdmissionDate;
if (this.medicalInstructions != null) {
data['medicaLInstructions'] = this.medicalInstructions.map((v) => v.toJson()).toList();
}
data['medicalInstructionsXML'] = this.medicalInstructionsXML;
data['medicalRemarks'] = this.medicalRemarks;
data['projectId'] = this.projectId;
data['projectName'] = this.projectName;
data['setupId'] = this.setupId;
return data;
}
}
class MedicaLInstructions {
String description;
int parameterCode;
MedicaLInstructions({this.description, this.parameterCode});
MedicaLInstructions.fromJson(Map<String, dynamic> json) {
description = json['description'];
parameterCode = json['parameterCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['description'] = this.description;
data['parameterCode'] = this.parameterCode;
return data;
}
}

@ -0,0 +1,220 @@
class GetAdmittedPatientsResponseModel {
String setupID;
int projectID;
int admissionNo;
String admissionDate;
int patientType;
int patientID;
int clinicID;
int doctorID;
String roomID;
String bedID;
int status;
int admissionStatus;
String createdOn;
String firstName;
String middleName;
String lastName;
String firstNameN;
String middleNameN;
String lastNameN;
int gender;
String dateofBirth;
dynamic companionFirstName;
dynamic companionMiddleName;
dynamic companionLastName;
dynamic companionFirstNameN;
dynamic companionMiddleNameN;
dynamic companionLastNameN;
dynamic companionID;
dynamic companionGender;
bool isHasCompanion;
int buildingID;
int floorID;
int nursingStationID;
int dietType;
String dietTypeDateCahnged;
String dietTypeDescription;
String dietTypeDescriptionN;
dynamic allergyDiseaseDateCahnged;
dynamic allergyDiseaseChecked;
dynamic doctorRemarks;
dynamic allergyRemarks;
String age;
dynamic allergies;
String companionFullName;
bool dietTypeChanged;
String dietTypeDateCahngedDate;
String genderDescription;
dynamic genderImageUrl;
bool hasAllergy;
bool isNewAdmitted;
String patientFullName;
dynamic allergyRemark;
GetAdmittedPatientsResponseModel(
{this.setupID,
this.projectID,
this.admissionNo,
this.admissionDate,
this.patientType,
this.patientID,
this.clinicID,
this.doctorID,
this.roomID,
this.bedID,
this.status,
this.admissionStatus,
this.createdOn,
this.firstName,
this.middleName,
this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.gender,
this.dateofBirth,
this.companionFirstName,
this.companionMiddleName,
this.companionLastName,
this.companionFirstNameN,
this.companionMiddleNameN,
this.companionLastNameN,
this.companionID,
this.companionGender,
this.isHasCompanion,
this.buildingID,
this.floorID,
this.nursingStationID,
this.dietType,
this.dietTypeDateCahnged,
this.dietTypeDescription,
this.dietTypeDescriptionN,
this.allergyDiseaseDateCahnged,
this.allergyDiseaseChecked,
this.doctorRemarks,
this.allergyRemarks,
this.age,
this.allergies,
this.companionFullName,
this.dietTypeChanged,
this.dietTypeDateCahngedDate,
this.genderDescription,
this.genderImageUrl,
this.hasAllergy,
this.isNewAdmitted,
this.patientFullName,
this.allergyRemark});
GetAdmittedPatientsResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
admissionNo = json['AdmissionNo'];
admissionDate = json['AdmissionDate'];
patientType = json['PatientType'];
patientID = json['PatientID'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
roomID = json['RoomID'];
bedID = json['BedID'];
status = json['Status'];
admissionStatus = json['AdmissionStatus'];
createdOn = json['CreatedOn'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
gender = json['Gender'];
dateofBirth = json['DateofBirth'];
companionFirstName = json['CompanionFirstName'];
companionMiddleName = json['CompanionMiddleName'];
companionLastName = json['CompanionLastName'];
companionFirstNameN = json['CompanionFirstNameN'];
companionMiddleNameN = json['CompanionMiddleNameN'];
companionLastNameN = json['CompanionLastNameN'];
companionID = json['CompanionID'];
companionGender = json['CompanionGender'];
isHasCompanion = json['IsHasCompanion'];
buildingID = json['BuildingID'];
floorID = json['FloorID'];
nursingStationID = json['NursingStationID'];
dietType = json['DietType'];
dietTypeDateCahnged = json['DietTypeDateCahnged'];
dietTypeDescription = json['DietTypeDescription'];
dietTypeDescriptionN = json['DietTypeDescriptionN'];
allergyDiseaseDateCahnged = json['AllergyDiseaseDateCahnged'];
allergyDiseaseChecked = json['AllergyDiseaseChecked'];
doctorRemarks = json['DoctorRemarks'];
allergyRemarks = json['AllergyRemarks'];
age = json['Age'];
allergies = json['Allergies'];
companionFullName = json['CompanionFullName'];
dietTypeChanged = json['DietTypeChanged'];
dietTypeDateCahngedDate = json['DietTypeDateCahnged_Date'];
genderDescription = json['GenderDescription'];
genderImageUrl = json['GenderImageUrl'];
hasAllergy = json['HasAllergy'];
isNewAdmitted = json['IsNewAdmitted'];
patientFullName = json['PatientFullName'];
allergyRemark = json['allergyRemark'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionDate'] = this.admissionDate;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['RoomID'] = this.roomID;
data['BedID'] = this.bedID;
data['Status'] = this.status;
data['AdmissionStatus'] = this.admissionStatus;
data['CreatedOn'] = this.createdOn;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['Gender'] = this.gender;
data['DateofBirth'] = this.dateofBirth;
data['CompanionFirstName'] = this.companionFirstName;
data['CompanionMiddleName'] = this.companionMiddleName;
data['CompanionLastName'] = this.companionLastName;
data['CompanionFirstNameN'] = this.companionFirstNameN;
data['CompanionMiddleNameN'] = this.companionMiddleNameN;
data['CompanionLastNameN'] = this.companionLastNameN;
data['CompanionID'] = this.companionID;
data['CompanionGender'] = this.companionGender;
data['IsHasCompanion'] = this.isHasCompanion;
data['BuildingID'] = this.buildingID;
data['FloorID'] = this.floorID;
data['NursingStationID'] = this.nursingStationID;
data['DietType'] = this.dietType;
data['DietTypeDateCahnged'] = this.dietTypeDateCahnged;
data['DietTypeDescription'] = this.dietTypeDescription;
data['DietTypeDescriptionN'] = this.dietTypeDescriptionN;
data['AllergyDiseaseDateCahnged'] = this.allergyDiseaseDateCahnged;
data['AllergyDiseaseChecked'] = this.allergyDiseaseChecked;
data['DoctorRemarks'] = this.doctorRemarks;
data['AllergyRemarks'] = this.allergyRemarks;
data['Age'] = this.age;
data['Allergies'] = this.allergies;
data['CompanionFullName'] = this.companionFullName;
data['DietTypeChanged'] = this.dietTypeChanged;
data['DietTypeDateCahnged_Date'] = this.dietTypeDateCahngedDate;
data['GenderDescription'] = this.genderDescription;
data['GenderImageUrl'] = this.genderImageUrl;
data['HasAllergy'] = this.hasAllergy;
data['IsNewAdmitted'] = this.isNewAdmitted;
data['PatientFullName'] = this.patientFullName;
data['allergyRemark'] = this.allergyRemark;
return data;
}
}

@ -0,0 +1,52 @@
class GetGeneralInstructions {
int rowID;
int iD;
int projectID;
String text;
String textN;
bool isActive;
int createdBy;
String createdOn;
dynamic editedBy;
dynamic editedOn;
GetGeneralInstructions(
{this.rowID,
this.iD,
this.projectID,
this.text,
this.textN,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn});
GetGeneralInstructions.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
iD = json['ID'];
projectID = json['ProjectID'];
text = json['Text'];
textN = json['TextN'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['ID'] = this.iD;
data['ProjectID'] = this.projectID;
data['Text'] = this.text;
data['TextN'] = this.textN;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
return data;
}
}

@ -0,0 +1,71 @@
class InPatientAdvanceHistoryResponseModel {
int advanceNumber;
int errorCode;
String message;
List<ResponseInpatientAdvanceInfo> responseInpatientAdvanceInfo;
int statusCode;
InPatientAdvanceHistoryResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
InPatientAdvanceHistoryResponseModel.fromJson(Map<String, dynamic> json) {
advanceNumber = json['advanceNumber'];
errorCode = json['errorCode'];
message = json['message'];
if (json['responseInpatientAdvanceInfo'] != null) {
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
json['responseInpatientAdvanceInfo'].forEach((v) {
responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v));
});
}
statusCode = json['statusCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['advanceNumber'] = this.advanceNumber;
data['errorCode'] = this.errorCode;
data['message'] = this.message;
if (this.responseInpatientAdvanceInfo != null) {
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList();
}
data['statusCode'] = this.statusCode;
return data;
}
}
class ResponseInpatientAdvanceInfo {
int admissionNo;
int admissionReqNo;
String createdOn;
int patientId;
int projectId;
num requestedAmount;
String setupId;
int status;
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status});
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
admissionNo = json['admissionNo'];
admissionReqNo = json['admissionReqNo'];
createdOn = json['createdOn'];
patientId = json['patientId'];
projectId = json['projectId'];
requestedAmount = json['requestedAmount'];
setupId = json['setupId'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['admissionNo'] = this.admissionNo;
data['admissionReqNo'] = this.admissionReqNo;
data['createdOn'] = this.createdOn;
data['patientId'] = this.patientId;
data['projectId'] = this.projectId;
data['requestedAmount'] = this.requestedAmount;
data['setupId'] = this.setupId;
data['status'] = this.status;
return data;
}
}

@ -0,0 +1,74 @@
class InPatientAdvanceResponseModel {
int advanceNumber;
Null errorCode;
String message;
List<ResponseInpatientAdvanceInfo> responseInpatientAdvanceInfo;
int statusCode;
InPatientAdvanceResponseModel({this.advanceNumber, this.errorCode, this.message, this.responseInpatientAdvanceInfo, this.statusCode});
InPatientAdvanceResponseModel.fromJson(Map<String, dynamic> json) {
advanceNumber = json['advanceNumber'];
errorCode = json['errorCode'];
message = json['message'];
if (json['responseInpatientAdvanceInfo'] != null) {
responseInpatientAdvanceInfo = <ResponseInpatientAdvanceInfo>[];
json['responseInpatientAdvanceInfo'].forEach((v) {
responseInpatientAdvanceInfo.add(new ResponseInpatientAdvanceInfo.fromJson(v));
});
}
statusCode = json['statusCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['advanceNumber'] = this.advanceNumber;
data['errorCode'] = this.errorCode;
data['message'] = this.message;
if (this.responseInpatientAdvanceInfo != null) {
data['responseInpatientAdvanceInfo'] = this.responseInpatientAdvanceInfo.map((v) => v.toJson()).toList();
}
data['statusCode'] = this.statusCode;
return data;
}
}
class ResponseInpatientAdvanceInfo {
int admissionNo;
int admissionReqNo;
String createdOn;
int patientId;
int projectId;
num requestedAmount;
String setupId;
int status;
int paymentRequestID;
ResponseInpatientAdvanceInfo({this.admissionNo, this.admissionReqNo, this.createdOn, this.patientId, this.projectId, this.requestedAmount, this.setupId, this.status, this.paymentRequestID});
ResponseInpatientAdvanceInfo.fromJson(Map<String, dynamic> json) {
admissionNo = json['admissionNo'];
admissionReqNo = json['admissionReqNo'];
createdOn = json['createdOn'];
patientId = json['patientId'];
projectId = json['projectId'];
requestedAmount = json['requestedAmount'];
setupId = json['setupId'];
status = json['status'];
paymentRequestID = json['PaymentRequestId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['admissionNo'] = this.admissionNo;
data['admissionReqNo'] = this.admissionReqNo;
data['createdOn'] = this.createdOn;
data['patientId'] = this.patientId;
data['projectId'] = this.projectId;
data['requestedAmount'] = this.requestedAmount;
data['setupId'] = this.setupId;
data['status'] = this.status;
data['PaymentRequestId'] = this.paymentRequestID;
return data;
}
}

@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
class GetMealItemsScheduleResponseModel {
int itemID;
String description;
String descriptionN;
dynamic comment;
dynamic commentN;
String imageURL;
bool isDefault;
int categoryID;
String categoryDescription;
String categoryDescriptionN;
int scheduleID;
int cal;
GetMealItemsScheduleResponseModel(
{this.itemID,
this.description,
this.descriptionN,
this.comment,
this.commentN,
this.imageURL,
this.isDefault,
this.categoryID,
this.categoryDescription,
this.categoryDescriptionN,
this.scheduleID,
this.cal});
GetMealItemsScheduleResponseModel.fromJson(Map<String, dynamic> json) {
itemID = json['ItemID'];
description = json['Description'];
descriptionN = json['DescriptionN'];
comment = json['Comment'];
commentN = json['CommentN'];
imageURL = json['ImageURL'];
isDefault = json['IsDefault'];
categoryID = json['CategoryID'];
categoryDescription = json['CategoryDescription'];
categoryDescriptionN = json['CategoryDescriptionN'];
scheduleID = json['ScheduleID'];
cal = json['cal'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemID'] = this.itemID;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['Comment'] = this.comment;
data['CommentN'] = this.commentN;
data['ImageURL'] = this.imageURL;
data['IsDefault'] = this.isDefault;
data['CategoryID'] = this.categoryID;
data['CategoryDescription'] = this.categoryDescription;
data['CategoryDescriptionN'] = this.categoryDescriptionN;
data['ScheduleID'] = this.scheduleID;
data['cal'] = this.cal;
return data;
}
}
class GetMealItemsScheduleResponseModelList {
String filterName = "";
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelList = [];
// int selectedItemID = 0;
final ValueNotifier<int> selectedItemID = ValueNotifier(0);
GetMealItemsScheduleResponseModelList({this.filterName, GetMealItemsScheduleResponseModel getMealItemsScheduleResponseModel}) {
getMealItemsScheduleResponseModelList.add(getMealItemsScheduleResponseModel);
}
}

@ -0,0 +1,60 @@
class GetMealsScheduleResponseModel {
int scheduleID;
int mealID;
String description;
String descriptionN;
int weekID;
String weekDescription;
String weekDescriptionN;
String tAT;
int dietTypeID;
int dayID;
bool isShow;
String tATTime;
GetMealsScheduleResponseModel(
{this.scheduleID,
this.mealID,
this.description,
this.descriptionN,
this.weekID,
this.weekDescription,
this.weekDescriptionN,
this.tAT,
this.dietTypeID,
this.dayID,
this.isShow,
this.tATTime});
GetMealsScheduleResponseModel.fromJson(Map<String, dynamic> json) {
scheduleID = json['ScheduleID'];
mealID = json['MealID'];
description = json['Description'];
descriptionN = json['DescriptionN'];
weekID = json['WeekID'];
weekDescription = json['WeekDescription'];
weekDescriptionN = json['WeekDescriptionN'];
tAT = json['TAT'];
dietTypeID = json['DietTypeID'];
dayID = json['DayID'];
isShow = json['IsShow'];
tATTime = json['TATTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ScheduleID'] = this.scheduleID;
data['MealID'] = this.mealID;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['WeekID'] = this.weekID;
data['WeekDescription'] = this.weekDescription;
data['WeekDescriptionN'] = this.weekDescriptionN;
data['TAT'] = this.tAT;
data['DietTypeID'] = this.dietTypeID;
data['DayID'] = this.dayID;
data['IsShow'] = this.isShow;
data['TATTime'] = this.tATTime;
return data;
}
}

@ -0,0 +1,85 @@
class GetMedicalInstructions {
dynamic propertyChanged;
int admissionRequestNoField;
String clinicNameField;
String doctorNameField;
String expectedAdmissionDateField;
List<MedicaLInstructionsField> medicaLInstructionsField;
dynamic medicalInstructionsXMLField;
String medicalRemarksField;
int projectIdField;
String projectNameField;
String setupIdField;
GetMedicalInstructions(
{this.propertyChanged,
this.admissionRequestNoField,
this.clinicNameField,
this.doctorNameField,
this.expectedAdmissionDateField,
this.medicaLInstructionsField,
this.medicalInstructionsXMLField,
this.medicalRemarksField,
this.projectIdField,
this.projectNameField,
this.setupIdField});
GetMedicalInstructions.fromJson(Map<String, dynamic> json) {
propertyChanged = json['PropertyChanged'];
admissionRequestNoField = json['admissionRequestNoField'];
clinicNameField = json['clinicNameField'];
doctorNameField = json['doctorNameField'];
expectedAdmissionDateField = json['expectedAdmissionDateField'];
if (json['medicaLInstructions'] != null) {
medicaLInstructionsField = <MedicaLInstructionsField>[];
json['medicaLInstructions'].forEach((v) {
medicaLInstructionsField.add(new MedicaLInstructionsField.fromJson(v));
});
}
medicalInstructionsXMLField = json['medicalInstructionsXMLField'];
medicalRemarksField = json['medicalRemarksField'];
projectIdField = json['projectIdField'];
projectNameField = json['projectNameField'];
setupIdField = json['setupIdField'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PropertyChanged'] = this.propertyChanged;
data['admissionRequestNoField'] = this.admissionRequestNoField;
data['clinicNameField'] = this.clinicNameField;
data['doctorNameField'] = this.doctorNameField;
data['expectedAdmissionDateField'] = this.expectedAdmissionDateField;
if (this.medicaLInstructionsField != null) {
data['medicaLInstructionsField'] = this.medicaLInstructionsField.map((v) => v.toJson()).toList();
}
data['medicalInstructionsXMLField'] = this.medicalInstructionsXMLField;
data['medicalRemarksField'] = this.medicalRemarksField;
data['projectIdField'] = this.projectIdField;
data['projectNameField'] = this.projectNameField;
data['setupIdField'] = this.setupIdField;
return data;
}
}
class MedicaLInstructionsField {
Null propertyChanged;
String descriptionField;
int parameterCodeField;
MedicaLInstructionsField({this.propertyChanged, this.descriptionField, this.parameterCodeField});
MedicaLInstructionsField.fromJson(Map<String, dynamic> json) {
propertyChanged = json['PropertyChanged'];
descriptionField = json['description'];
parameterCodeField = json['parameterCodeField'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PropertyChanged'] = this.propertyChanged;
data['descriptionField'] = this.descriptionField;
data['parameterCodeField'] = this.parameterCodeField;
return data;
}
}

@ -160,6 +160,7 @@ class _BookSuccessState extends State<BookSuccess> {
return Container( return Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).size.height * 0.18,
margin: EdgeInsets.only(bottom: 24),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
@ -170,7 +171,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: Color(0xFF60686b), backgroundColor: CustomColors.green,
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
// navigateToQR(context); // navigateToQR(context);

@ -0,0 +1,305 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/AttachInsuranceCardImageDialog.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.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/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BirthNotification extends StatefulWidget {
const BirthNotification({Key key}) : super(key: key);
@override
State<BirthNotification> createState() => _BirthNotificationState();
}
class _BirthNotificationState extends State<BirthNotification> {
TextEditingController motherMRN = new TextEditingController();
TextEditingController motherName = new TextEditingController();
TextEditingController fatherName = new TextEditingController();
TextEditingController fatherNameAR = new TextEditingController();
TextEditingController babyName = new TextEditingController();
TextEditingController babyNameAR = new TextEditingController();
TextEditingController contactNumber = new TextEditingController();
ProjectViewModel projectViewModel;
List<String> images = [];
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
motherMRN.text = projectViewModel.user.patientID.toString();
motherName.text = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
contactNumber.text = projectViewModel.user.mobileNumber;
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).birthNotificationTitle + " " + TranslationBase.of(context).birthNotificationSubTitle,
body: SingleChildScrollView(
child: Container(
width: MediaQuery.of(context).size.width,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.all(21.0),
padding: const EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).enterDetailBelow + " :",
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
mHeight(16),
inputWidget(TranslationBase.of(context).mothersMRN, "", motherMRN, isEnable: false),
mHeight(16),
inputWidget(TranslationBase.of(context).mothersName, "", motherName, isEnable: false),
mHeight(16),
inputWidget(TranslationBase.of(context).fathersNameEN, "", fatherName),
mHeight(16),
inputWidget(TranslationBase.of(context).fathersNameAR, "", fatherNameAR),
mHeight(16),
inputWidget(TranslationBase.of(context).babysNameEN, "", babyName),
mHeight(16),
inputWidget(TranslationBase.of(context).babysNameAR, "", babyNameAR),
mHeight(16),
inputWidget(TranslationBase.of(context).contactNumber, "", contactNumber),
mHeight(16),
DefaultButton(
TranslationBase.of(context).scanID,
() {
confirmAttachInsuranceCardImageDialogDialog(
context: context, name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, fileNo: projectViewModel.user.patientID.toString());
},
color: CustomColors.accentColor,
disabledColor: CustomColors.grey2,
),
if (images.isNotEmpty) mHeight(16),
if (images.isNotEmpty)
Padding(
padding: const EdgeInsets.only(top: 16.0, bottom: 16.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Image.memory(
base64Decode(images[0]),
width: 80.0,
height: 80.0,
fit: BoxFit.cover,
),
Text(
"image 1.png",
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
InkWell(
onTap: () {
setState(() {
images.clear();
});
},
child: Icon(
Icons.delete_sharp,
color: Colors.red[300],
),
)
],
),
),
mHeight(16),
Text(
"" + TranslationBase.of(context).birthNotificationNotes1,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
mHeight(16),
Text(
"" + TranslationBase.of(context).birthNotificationNotes2,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
mHeight(16),
Text(
"" + TranslationBase.of(context).birthNotificationNotes3,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
mHeight(100.0),
// DefaultButton(
// TranslationBase.of(context).submit,
// (fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty) ? null : () {
// submitBirthNotification();
// },
// color: CustomColors.accentColor,
// disabledColor: CustomColors.grey2,
// ),
],
),
),
),
bottomSheet: Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20),
child: DefaultButton(
TranslationBase.of(context).submit,
(fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty)
? null
: () {
submitBirthNotification();
},
color: CustomColors.accentColor,
disabledColor: CustomColors.grey2,
),
),
);
}
void submitBirthNotification() {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.submitBirthNotification(
projectViewModel.user.patientID, projectViewModel.inPatientProjectID, fatherNameAR.text, fatherName.text, babyNameAR.text, babyName.text, contactNumber.text, images[0], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
Navigator.of(context).pop();
}).catchError((err) {
print(err);
});
}
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo}) {
showDialog(
context: context,
builder: (cxt) => AttachInsuranceCardImageDialog(
fileNo: fileNo,
name: name,
image: (file, image) async {
images.clear();
images.add(image);
setState(() {});
},
isBirthNotification: true,
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.name,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
}

@ -0,0 +1,103 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_history_response_model.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class InPatientPaidAdvancePayment extends StatefulWidget {
const InPatientPaidAdvancePayment({Key key}) : super(key: key);
@override
State<InPatientPaidAdvancePayment> createState() => _InPatientPaidAdvancePaymentState();
}
class _InPatientPaidAdvancePaymentState extends State<InPatientPaidAdvancePayment> {
ProjectViewModel projectViewModel;
InPatientAdvanceHistoryResponseModel inPatientAdvanceHistoryResponseModel;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
getInPatientAdvancePaymentHistory();
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Padding(
padding: const EdgeInsets.all(16.0),
child: inPatientAdvanceHistoryResponseModel != null && inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo != null
? ListView.separated(
itemCount: inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo.length,
itemBuilder: (BuildContext context, int index) {
return Container(
decoration: cardRadius(12),
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyRichText(
TranslationBase.of(context).admissionNo + ": ", inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].admissionNo.toString(), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).admissionReqNo + ": ", inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].admissionReqNo.toString(),
projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).date + ": ",
DateUtil.formatDateToDate(DateUtil.convertStringToDate(inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].createdOn), false),
projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).amount_ + ": ", inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index].requestedAmount.toString(), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).status + ": ", getStatus(inPatientAdvanceHistoryResponseModel.responseInpatientAdvanceInfo[index]), projectViewModel.isArabic),
],
),
);
},
separatorBuilder: (BuildContext context, int index) {
return SizedBox(
height: 12.0,
);
},
)
: getNoDataWidget(context),
);
}
String getStatus(ResponseInpatientAdvanceInfo responseInpatientAdvanceInfo) {
switch (responseInpatientAdvanceInfo.status) {
case 1:
return "Hold";
break;
case 2:
return "Active";
break;
case 4:
return "Cancelled";
break;
default:
return "";
}
}
void getInPatientAdvancePaymentHistory() {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.getInPatientAdvancePaymentHistory(projectViewModel.inPatientProjectID, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo : 0,
projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
inPatientAdvanceHistoryResponseModel = InPatientAdvanceHistoryResponseModel.fromJson(res["responseInpatient"]);
setState(() {});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -0,0 +1,285 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.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/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';
class InPatientPendingAdvancePayment extends StatefulWidget {
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
bool isHasData;
InPatientPendingAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel});
@override
State<InPatientPendingAdvancePayment> createState() => _InPatientPendingAdvancePaymentState();
}
class _InPatientPendingAdvancePaymentState extends State<InPatientPendingAdvancePayment> {
ProjectViewModel projectViewModel;
InAppBrowser browser = new InAppBrowser();
var _InAppBrowserOptions = InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false),
ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black),
android: AndroidInAppBrowserOptions(),
ios:
IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
@override
void initState() {
// browser = new InAppBrowser(onLoadStartCallback: onBrowserLoadStart);
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
child: Container(
decoration: cardRadius(12),
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: widget.isHasData && widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Payment request for: ",
// TranslationBase.of(context).covidBookAppo,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: -0.64,
),
),
mHeight(6),
Row(
children: [
Text(
TranslationBase.of(context).patientName + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).identificationNumber + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).mrn + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
)
: getNoDataWidget(context),
),
),
),
mHeight(12),
// Expanded(child: Container()),
widget.isHasData
? Container(
decoration: cardRadius(12.0),
margin: EdgeInsets.zero,
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).patientShareTotalToDo,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: -0.64,
),
),
Text(
TranslationBase.of(context).sar + " ${widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].requestedAmount}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24,
letterSpacing: -0.64,
),
),
],
),
SizedBox(height: 12),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
SizedBox(height: 12),
SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
() {
getInPatientPaymentLink(false);
},
// : null,
color: CustomColors.green,
disabledColor: CustomColors.grey2,
),
SizedBox(height: 12),
Text(
TranslationBase.of(context).copyLinkTxt,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).copyLink.toUpperCase(),
() {
getInPatientPaymentLink(true);
},
svgIcon: "assets/images/new/copy.svg",
color: CustomColors.accentColor,
disabledColor: CustomColors.grey2,
),
],
),
)
: Container(),
],
),
);
}
onBrowserLoadStart(String 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;
}
});
}
void getInPatientPaymentLink(bool isCopy) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
int orderID = num.parse(DateTime.now().microsecondsSinceEpoch.toString().substring(7, 15));
int clinicID = projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.clinicID : 17;
service
.getInPatientPaymentLink(
projectViewModel.inPatientProjectID,
projectViewModel.getAdmissionInfoResponseModel.admissionNo,
orderID,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user.emailAddress,
widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].requestedAmount,
projectViewModel.user.patientIdentificationNo,
clinicID,
widget.inPatientAdvanceResponseModel.responseInpatientAdvanceInfo[0].paymentRequestID,
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
String paymentLink = res["PaymentUrl"];
print(paymentLink);
if (isCopy) {
Share.share(paymentLink);
} else {
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(paymentLink)), options: _InAppBrowserOptions);
}
} else {
AppToast.showErrorToast(message: res["endUserMessage"]);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -0,0 +1,93 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_general_instructions_response_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class GeneralInstructions extends StatelessWidget {
List<GetGeneralInstructions> getGeneralInstructionsList;
ProjectViewModel projectViewModel;
GeneralInstructions({@required this.getGeneralInstructionsList});
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(21.0),
child: Text(TranslationBase.of(context).generalInstructions,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 21.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
)),
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: Card(
elevation: 0.0,
margin: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.transparent, width: 0.0),
),
child: Padding(
padding: EdgeInsets.all(16.0),
child: Container(
child: ListView.separated(
itemCount: getGeneralInstructionsList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset("assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Text(projectViewModel.isArabic ? getGeneralInstructionsList[index].textN : getGeneralInstructionsList[index].text,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
)),
),
],
));
},
separatorBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(left: 14, right: 14),
child: mHeight(16.0),
);
},
)),
),
),
),
)
],
));
}
}

@ -0,0 +1,169 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.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/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class HelpPRO extends StatefulWidget {
const HelpPRO({Key key}) : super(key: key);
@override
State<HelpPRO> createState() => _HelpPROState();
}
class _HelpPROState extends State<HelpPRO> {
TextEditingController assistText = new TextEditingController();
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).patientRelationOffice,
body: SingleChildScrollView(
child: Container(
width: MediaQuery.of(context).size.width,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.all(21.0),
padding: const EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).assistYou,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
mHeight(16),
inputWidget(TranslationBase.of(context).enterDetails, "", assistText),
mHeight(16),
DefaultButton(
TranslationBase.of(context).send,
() {
if (assistText.text.isNotEmpty) {
callReceivePrescriptionAPI(context);
} else {
Utils.showErrorToast(TranslationBase.of(context).emptyMessage);
}
},
),
],
),
),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.name,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
void callReceivePrescriptionAPI(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 1, (projectViewModel.user.firstName + " " + projectViewModel.user.lastName),
(projectViewModel.user.firstNameN + " " + projectViewModel.user.lastNameN), projectViewModel.user.mobileNumber, assistText.text, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).successSendReport);
Navigator.of(context).pop();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -0,0 +1,77 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_paid_advance_payment.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/components/inpatient_pending_advance_payment.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class InPatientAdvancePayment extends StatefulWidget {
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
bool isHasData;
InPatientAdvancePayment({this.isHasData, this.inPatientAdvanceResponseModel});
@override
State<InPatientAdvancePayment> createState() => _InPatientAdvancePaymentState();
}
class _InPatientAdvancePaymentState extends State<InPatientAdvancePayment> with SingleTickerProviderStateMixin {
TabController _tabController;
ProjectViewModel projectViewModel;
@override
void initState() {
_tabController = TabController(length: 2, vsync: this);
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).advancePayment,
body: Column(
children: [
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
physics: const NeverScrollableScrollPhysics(),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).pending), Text(TranslationBase.of(context).history)],
),
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
InPatientPendingAdvancePayment(isHasData: widget.isHasData, inPatientAdvanceResponseModel: widget.inPatientAdvanceResponseModel),
InPatientPaidAdvancePayment(),
],
),
)
],
),
);
}
}

@ -0,0 +1,378 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_general_instructions_response_model.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/birth_notification.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/general_instructions.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/help_PRO.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_advance_payment.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/meal_plan.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/medical_instructions.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
class InPatientServicesHome extends StatefulWidget {
@override
State<InPatientServicesHome> createState() => _InPatientServicesHomeState();
}
class _InPatientServicesHomeState extends State<InPatientServicesHome> {
ProjectViewModel projectViewModel;
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
bool isReceivePrescriptionEnabled = false;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
checkDischargeMedications(context);
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
List<Widget> inPatientServiceList = getInPatientServicesList(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
body: Container(
margin: EdgeInsets.all(20.0),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
padding: EdgeInsets.zero,
itemCount: inPatientServiceList.length,
itemBuilder: (BuildContext context, int index) {
return inPatientServiceList[index];
},
),
),
],
),
),
);
}
List<Widget> getInPatientServicesList(BuildContext context) {
List<Widget> serviceList = List();
serviceList.add(
InkWell(
onTap: () {
if (projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate()) openGeneralInstructions(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).generalInstructionsTitle,
imagePath: 'general_instructions.svg',
subTitle: TranslationBase.of(context).generalInstructionsSubTitle,
width: 50.0,
height: 40.0,
isInPatient: true,
isEnable: projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate(),
),
),
);
serviceList.add(
InkWell(
onTap: () {
if (projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate()) openMedicalInstructions(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medicalInstructionsTitle,
imagePath: 'medical_instructions.svg',
subTitle: TranslationBase.of(context).medicalInstructionsSubTitle,
width: 50.0,
height: 40.0,
isInPatient: true,
isEnable: projectViewModel.isPatientAdmitted ? true : checkAdmissionRequestDate(),
),
),
);
serviceList.add(
InkWell(
onTap: () {
if (projectViewModel.isPatientAdmitted) {
Navigator.push(context, FadePage(page: MealPlanPage()));
} else {
AppToast.showErrorToast(message: "This service is only available to admitted patients");
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).mealPlanTitle,
imagePath: 'meal_plan.svg',
subTitle: TranslationBase.of(context).mealPlanSubTitle,
width: 50.0,
height: 40.0,
isInPatient: true,
isEnable: projectViewModel.isPatientAdmitted),
),
);
serviceList.add(
InkWell(
onTap: () {
openBirthNotificationsPage(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).birthNotificationTitle,
imagePath: 'birth_notification.svg',
subTitle: TranslationBase.of(context).birthNotificationSubTitle,
width: 50.0,
height: 40.0,
isInPatient: true,
),
),
);
// serviceList.add(
// InkWell(
// onTap: () {
// // Navigator.push(context, FadePage(page: AdvancePaymentPage()));
// },
// child: MedicalProfileItem(
// title: TranslationBase.of(context).admissionNoticeTitle,
// imagePath: 'admission_notice.svg',
// subTitle: TranslationBase.of(context).admissionNoticeSubTitle,
// width: 50.0,
// height: 40.0,
// isInPatient: true,
// ),
// ),
// );
serviceList.add(
InkWell(
onTap: () {
getInPatientAdvancePaymentRequests(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).advancePayment,
imagePath: 'advance_payment.svg',
subTitle: TranslationBase.of(context).payment,
width: 50.0,
height: 40.0,
isInPatient: true,
),
),
);
serviceList.add(
InkWell(
onTap: () {
// Navigator.push(context, FadePage(page: AdvancePaymentPage()));
if (isReceivePrescriptionEnabled) receivePrescriptionAPI(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).receive,
imagePath: 'receive_prescription.svg',
subTitle: TranslationBase.of(context).prescriptions,
width: 50.0,
height: 40.0,
isInPatient: true,
isEnable: isReceivePrescriptionEnabled),
),
);
serviceList.add(
InkWell(
onTap: () {
checkCurrentTime(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).help,
imagePath: 'help_pro.svg',
subTitle: TranslationBase.of(context).PRO,
width: 50.0,
height: 40.0,
isInPatient: true,
),
),
);
return serviceList;
}
void receivePrescriptionAPI(BuildContext context) {
AlertDialogBox(
context: context,
confirmMessage: TranslationBase.of(context).successSendReport,
okText: TranslationBase.of(context).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
callReceivePrescriptionAPI(context);
}).showAlertDialog(context);
// ConfirmDialog dialog = new ConfirmDialog(
// context: context,
// confirmMessage: TranslationBase.of(context).successSendReport,
// okText: TranslationBase.of(context).ok,
// cancelText: TranslationBase.of(context).cancel_nocaps,
// okFunction: () {
// Navigator.of(context).pop();
// },
// cancelFunction: () => {});
// dialog.showAlertDialog(context);
}
void checkDischargeMedications(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getDischargeMedicationOrder(projectViewModel.getAdmissionInfoResponseModel).then((res) {
print(res["PatientHasDischargeMedicineList"].length);
setState(() {
if (res["PatientHasDischargeMedicineList"].length != 0) {
isReceivePrescriptionEnabled = true;
}
});
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void callReceivePrescriptionAPI(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.insertInPatientOrder(projectViewModel.getAdmissionInfoResponseModel, 2, (projectViewModel.user.firstName + " " + projectViewModel.user.lastName),
(projectViewModel.user.firstNameN + " " + projectViewModel.user.lastNameN), projectViewModel.user.mobileNumber, "I need my medicines", context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void openBirthNotificationsPage(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getBirthNotification(projectViewModel.user.patientID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
print(res['birthNotification']);
Navigator.push(context, FadePage(page: BirthNotification()));
} else {
AppToast.showErrorToast(message: res["endUserMessage"]);
}
}).catchError((err) {
print(err);
});
}
void openGeneralInstructions(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getGeneralInstructions(projectViewModel.inPatientProjectID, context).then((res) {
if (res['generalInstructions'].length != 0) {
List<GetGeneralInstructions> getGeneralInstructionsList = [];
res['generalInstructions'].forEach((v) {
getGeneralInstructionsList.add(new GetGeneralInstructions.fromJson(v));
});
GifLoaderDialogUtils.hideDialog(context);
print(res['generalInstructions']);
Navigator.push(context, FadePage(page: GeneralInstructions(getGeneralInstructionsList: getGeneralInstructionsList)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).noGeneralInstructions);
}
}).catchError((err) {
print(err);
});
}
void openMedicalInstructions(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getMedicalInstructions(projectViewModel.inPatientProjectID, context).then((res) {
if (res['MedicalInstruction'] != null && res['MedicalInstruction'].length != 0) {
List<GetMedicalInstructions> getMedicalInstructionsList = [];
res['MedicalInstruction'].forEach((v) {
getMedicalInstructionsList.add(new GetMedicalInstructions.fromJson(v));
});
GifLoaderDialogUtils.hideDialog(context);
print(res['MedicalInstruction']);
Navigator.push(context, FadePage(page: MedicalInstructionsPage(getMedicalInstructionsList: getMedicalInstructionsList)));
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: TranslationBase.of(context).noMedicalInstructions);
}
}).catchError((err) {
print(err);
});
}
void getInPatientAdvancePaymentRequests(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.getInPatientAdvancePaymentRequests(projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.projectID : projectViewModel.getAdmissionRequestInfoResponseModel.projectId, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo : 0,
projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
if (res['responseInpatient'] != null) {
inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]);
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).noData);
}
} else {
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void checkCurrentTime(BuildContext context) {
print(DateTime.now().hour);
print(DateTime.now().minute);
if (DateTime.now().hour >= 7 && DateTime.now().hour <= 22) {
Navigator.push(context, FadePage(page: HelpPRO()));
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).proErrorMessage,
okText: TranslationBase.of(context).callNow,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), launchUrl(Uri.parse("tel://" + "011 525 9553"))},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}
bool checkAdmissionRequestDate() {
print(DateUtil.convertStringToDate(projectViewModel.getAdmissionRequestInfoResponseModel.expectedAdmissionDate));
print(DateUtil.convertStringToDate(projectViewModel.getAdmissionRequestInfoResponseModel.expectedAdmissionDate).difference(DateTime.now()).inHours);
if (DateUtil.convertStringToDate(projectViewModel.getAdmissionRequestInfoResponseModel.expectedAdmissionDate).difference(DateTime.now()).inHours > 24) {
return false;
}
return true;
}
}

@ -0,0 +1,641 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admitted_patient_response_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_meal_items_schedule_response_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_meals_schedule_response_model.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MealPlanPage extends StatefulWidget {
const MealPlanPage({Key key}) : super(key: key);
@override
State<MealPlanPage> createState() => _MealPlanPageState();
}
class _MealPlanPageState extends State<MealPlanPage> {
ProjectViewModel projectViewModel;
GetAdmittedPatientsResponseModel getAdmittedPatientsResponseModel;
List<GetMealsScheduleResponseModel> getMealsScheduleResponseModelList = [];
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelBreakfast = [];
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelLunch = [];
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelDinner = [];
List<GetMealItemsScheduleResponseModelList> _getMealItemsScheduleResponseModelBreakfast = [];
List<GetMealItemsScheduleResponseModelList> _getMealItemsScheduleResponseModelLunch = [];
List<GetMealItemsScheduleResponseModelList> _getMealItemsScheduleResponseModelDinner = [];
int currentDay = 0;
int currentWeek = 0;
int selectedMealScheduleID = 0;
final ValueNotifier<bool> isFasting = ValueNotifier(false);
bool isFastingVal = false;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
getAdmittedPatientDetails();
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).mealPlanTitle,
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(21.0),
child: getMealsScheduleResponseModelList.length != 0
? Column(
children: [
Container(
decoration: containerRadius((getMealsScheduleResponseModelList[0].isShow) ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[0].isShow,
isDisabled: !getMealsScheduleResponseModelList[0].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelBreakfast[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ValueListenableBuilder<int>(
valueListenable: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID,
builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value,
activeColor: Colors.red[800],
onChanged: (value) {
_getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value = value;
},
);
}),
LargeAvatar(
name: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
],
),
),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelBreakfast.length),
],
),
),
),
mHeight(21),
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[1].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[1].isShow,
isDisabled: !getMealsScheduleResponseModelList[1].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelLunch[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ValueListenableBuilder<int>(
valueListenable: _getMealItemsScheduleResponseModelLunch[index].selectedItemID,
builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelLunch[index].selectedItemID.value,
activeColor: Colors.red[800],
onChanged: (value) {
_getMealItemsScheduleResponseModelLunch[index].selectedItemID.value = value;
},
);
}),
LargeAvatar(
name: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
],
),
),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelLunch.length),
],
),
),
),
mHeight(21),
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[2].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[2].isShow,
isDisabled: !getMealsScheduleResponseModelList[2].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelDinner[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ValueListenableBuilder<int>(
valueListenable: _getMealItemsScheduleResponseModelDinner[index].selectedItemID,
builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value,
activeColor: Colors.red[800],
onChanged: (value) {
_getMealItemsScheduleResponseModelDinner[index].selectedItemID.value = value;
},
);
}),
LargeAvatar(
name: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
],
),
),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelDinner.length),
],
),
),
),
],
)
: Container(),
),
),
bottomSheet: Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
ValueListenableBuilder<bool>(
valueListenable: isFasting,
builder: (context, val, child) {
return Checkbox(
onChanged: (bool value) {
isFasting.value = value;
isFastingVal = value;
},
value: isFastingVal,
activeColor: Color(0xFFc5272d),
);
}),
Text(
TranslationBase.of(context).isFasting,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.48,
),
),
],
),
mHeight(12),
DefaultButton(
TranslationBase.of(context).placeOrder,
() {
placeOrder();
},
color: Color(0xff359846),
disabledColor: Colors.grey,
),
],
),
),
);
}
void placeOrder() {
List<String> selectedItemIDs = [];
if (_getMealItemsScheduleResponseModelBreakfast.isNotEmpty) {
_getMealItemsScheduleResponseModelBreakfast.forEach((element) {
selectedItemIDs.add(element.selectedItemID.value.toString());
});
}
if (_getMealItemsScheduleResponseModelLunch.isNotEmpty) {
_getMealItemsScheduleResponseModelLunch.forEach((element) {
selectedItemIDs.add(element.selectedItemID.value.toString());
});
}
if (_getMealItemsScheduleResponseModelDinner.isNotEmpty) {
_getMealItemsScheduleResponseModelDinner.forEach((element) {
selectedItemIDs.add(element.selectedItemID.value.toString());
});
}
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.placeMealPlanOrder(getAdmittedPatientsResponseModel.projectID, selectedMealScheduleID, selectedItemIDs.join(","), projectViewModel.user.patientID,
getAdmittedPatientsResponseModel.admissionNo, getAdmittedPatientsResponseModel.isHasCompanion, isFastingVal, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "Your meal order has been received successfully");
Navigator.pop(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
Widget getDivider() {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 2.0,
color: Colors.black,
),
);
}
void getAdmittedPatientDetails() {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getAdmittedPatientDetails(projectViewModel.user.patientID, projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, 0, 0, 0, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["List_MOP_AdmittedPatients"] != null && res["List_MOP_AdmittedPatients"].length != 0) {
print(res["List_MOP_AdmittedPatients"]);
getAdmittedPatientsResponseModel = new GetAdmittedPatientsResponseModel.fromJson(res["List_MOP_AdmittedPatients"][0]);
print(getAdmittedPatientsResponseModel.dietType);
getCurrentWeekIDAndDay(getAdmittedPatientsResponseModel.dietType);
} else {
AppToast.showErrorToast(message: "No data found for admitted patient");
getCurrentWeekIDAndDay(1);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void getCurrentWeekIDAndDay(int dietType) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCurrentWeekIDAndDay(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
currentDay = res["CurrentDay"];
currentWeek = res["CurrentWeek"];
getMealsOfScheduleID(dietType);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void getMealsOfScheduleID(int dietType) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getMealsOfScheduleID(projectViewModel.inPatientProjectID, projectViewModel.getAdmissionInfoResponseModel.admissionNo, dietType, currentWeek, currentDay, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["List_MOP_MealsOfScheduleID_Mobile"] != null && res["List_MOP_MealsOfScheduleID_Mobile"].length != 0) {
res['List_MOP_MealsOfScheduleID_Mobile'].forEach((scheduleItem) {
getMealsScheduleResponseModelList.add(GetMealsScheduleResponseModel.fromJson(scheduleItem));
});
if (getMealsScheduleResponseModelList[0].isShow) {
selectedMealScheduleID = getMealsScheduleResponseModelList[0].scheduleID;
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID, 1);
}
if (getMealsScheduleResponseModelList[1].isShow) {
selectedMealScheduleID = getMealsScheduleResponseModelList[1].scheduleID;
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID, 2);
}
if (getMealsScheduleResponseModelList[2].isShow) {
selectedMealScheduleID = getMealsScheduleResponseModelList[2].scheduleID;
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID, 3);
}
} else {
AppToast.showErrorToast(message: "No meal schedule found for admitted patient");
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void getDefaultItemsOfScheduleID(int scheduleID, int mealType) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getDefaultItemsOfScheduleID(projectViewModel.inPatientProjectID, scheduleID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["List_MOP_DefaultItemsOfMealModel"] != null && res["List_MOP_DefaultItemsOfMealModel"].length != 0) {
if (mealType == 1) {
res['List_MOP_DefaultItemsOfMealModel'].forEach((scheduleItem) {
getMealItemsScheduleResponseModelBreakfast.add(GetMealItemsScheduleResponseModel.fromJson(scheduleItem));
});
sortMealsByCategoryBreakfast();
}
if (mealType == 2) {
res['List_MOP_DefaultItemsOfMealModel'].forEach((scheduleItem) {
getMealItemsScheduleResponseModelLunch.add(GetMealItemsScheduleResponseModel.fromJson(scheduleItem));
});
sortMealsByCategoryLunch();
}
if (mealType == 3) {
res['List_MOP_DefaultItemsOfMealModel'].forEach((scheduleItem) {
getMealItemsScheduleResponseModelDinner.add(GetMealItemsScheduleResponseModel.fromJson(scheduleItem));
});
sortMealsByCategoryDinner();
}
} else {
AppToast.showErrorToast(message: "No meal items found for admitted patient");
}
setState(() {});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void sortMealsByCategoryBreakfast() {
getMealItemsScheduleResponseModelBreakfast.forEach((element) {
List<GetMealItemsScheduleResponseModelList> breakfastMealItems = _getMealItemsScheduleResponseModelBreakfast
.where((elementClinic) => elementClinic.filterName == (projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription))
.toList();
if (breakfastMealItems.length != 0) {
_getMealItemsScheduleResponseModelBreakfast[_getMealItemsScheduleResponseModelBreakfast.indexOf(breakfastMealItems[0])].getMealItemsScheduleResponseModelList.add(element);
} else {
_getMealItemsScheduleResponseModelBreakfast
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
}
});
_getMealItemsScheduleResponseModelBreakfast.forEach((element) {
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
if (elementInner.isDefault) {
element.selectedItemID.value = elementInner.itemID;
}
});
});
}
void sortMealsByCategoryLunch() {
getMealItemsScheduleResponseModelLunch.forEach((element) {
List<GetMealItemsScheduleResponseModelList> breakfastMealItems = _getMealItemsScheduleResponseModelLunch
.where((elementClinic) => elementClinic.filterName == (projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription))
.toList();
if (breakfastMealItems.length != 0) {
_getMealItemsScheduleResponseModelLunch[_getMealItemsScheduleResponseModelLunch.indexOf(breakfastMealItems[0])].getMealItemsScheduleResponseModelList.add(element);
} else {
_getMealItemsScheduleResponseModelLunch
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
}
});
_getMealItemsScheduleResponseModelLunch.forEach((element) {
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
if (elementInner.isDefault) {
element.selectedItemID.value = elementInner.itemID;
}
});
});
}
void sortMealsByCategoryDinner() {
getMealItemsScheduleResponseModelDinner.forEach((element) {
List<GetMealItemsScheduleResponseModelList> breakfastMealItems = _getMealItemsScheduleResponseModelDinner
.where((elementClinic) => elementClinic.filterName == (projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription))
.toList();
if (breakfastMealItems.length != 0) {
_getMealItemsScheduleResponseModelDinner[_getMealItemsScheduleResponseModelDinner.indexOf(breakfastMealItems[0])].getMealItemsScheduleResponseModelList.add(element);
} else {
_getMealItemsScheduleResponseModelDinner
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
}
});
_getMealItemsScheduleResponseModelDinner.forEach((element) {
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
if (elementInner.isDefault) {
element.selectedItemID.value = elementInner.itemID;
}
});
});
}
}

@ -0,0 +1,100 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
class MedicalInstructionsPage extends StatefulWidget {
List<GetMedicalInstructions> getMedicalInstructionsList;
MedicalInstructionsPage({@required this.getMedicalInstructionsList});
@override
State<MedicalInstructionsPage> createState() => _MedicalInstructionsPageState();
}
class _MedicalInstructionsPageState extends State<MedicalInstructionsPage> {
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(21.0),
child: Text(TranslationBase.of(context).medicalInstructions,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 21.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
)),
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: Card(
elevation: 0.0,
margin: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.transparent, width: 0.0),
),
child: Padding(
padding: EdgeInsets.all(16.0),
child: Container(
child: ListView.separated(
itemCount: widget.getMedicalInstructionsList[0].medicaLInstructionsField.length,
itemBuilder: (BuildContext context, int index) {
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset("assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Text(widget.getMedicalInstructionsList[0].medicaLInstructionsField[index].descriptionField,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
)),
),
],
));
},
separatorBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(left: 14, right: 14),
child: mHeight(16.0),
);
},
)),
),
),
),
)
],
));
}
}

@ -379,7 +379,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate!), date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate!),
isSortByClinic: _isSortByClinic, isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate! + 0.0, rating: _appointmentResult.actualDoctorRate! + 0.0,
appointmentTime: _appointmentResult.isLiveCareAppointment! ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate!).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime!.substring(0, 5), appointmentTime: _appointmentResult.isLiveCareAppointment
! ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate!).toString().split(" ")[1].substring(0, 5)
: _appointmentResult.startTime!.substring(0, 5),
// appointmentTime: _appointmentResult.startTime.substring(0, 5), // appointmentTime: _appointmentResult.startTime.substring(0, 5),
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
? _appointmentResult.remaniningHoursTocanPay ? _appointmentResult.remaniningHoursTocanPay

@ -16,8 +16,9 @@ class AttachInsuranceCardImageDialog extends StatefulWidget {
final String identificationNo; final String identificationNo;
final String mobileNo; final String mobileNo;
final Function(File file, String image) image; final Function(File file, String image) image;
final bool isBirthNotification;
const AttachInsuranceCardImageDialog({Key? key, required this.name, required this.fileNo, required this.identificationNo, required this.mobileNo, required this.image}) : super(key: key); const AttachInsuranceCardImageDialog({Key? key, required this.name, required this.fileNo, required this.identificationNo, required this.mobileNo, required this.image, this.isBirthNotification = false}) : super(key: key);
@override @override
_AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState(); _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState();
@ -40,7 +41,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).updateInsurCards, widget.isBirthNotification ? TranslationBase.of(context).scanID : TranslationBase.of(context).updateInsurCards,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -122,6 +123,28 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
height: 250, height: 250,
), ),
), ),
if (!widget.isBirthNotification)
Text(
"OR",
style: TextStyle(
fontSize: 16,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
if (!widget.isBirthNotification)
Padding(
padding: const EdgeInsets.all(18.0),
child: DefaultButton(
TranslationBase.of(context).updateInsuranceManually,
() {
Navigator.pop(context);
Navigator.push(context, FadePage(page: UpdateInsuranceManually()));
},
textColor: Colors.white,
color: CustomColors.accentColor,
),
),
Text( Text(
"OR", "OR",
style: TextStyle( style: TextStyle(

@ -39,13 +39,12 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
late ApplePayResponse applePayResponse; late ApplePayResponse applePayResponse;
// bool isPatientAdmitted = true;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
// getPatientAppointmentHistory1();
// getFamilyFiles();
} }
initialiseHmgServices(bool isLogin) { initialiseHmgServices(bool isLogin) {
@ -62,10 +61,29 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
hmgServices.add(HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); hmgServices.add(HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin));
} }
initialiseInPatientHmgServices(bool isLogin) {
hmgServices.clear();
// hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
// hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin));
// hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin));
hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin));
hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin));
hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin));
hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin));
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
initialiseHmgServices(false);
if (projectViewModel.isPatientAdmitted || projectViewModel.patientHasAdmissionRequest) {
initialiseInPatientHmgServices(false);
} else {
initialiseHmgServices(false);
}
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
var userProvider = Provider.of<ToDoCountProviderModel>(context); var userProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
@ -261,23 +279,72 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
], ],
), ),
), ),
Padding( projectViewModel.isPatientAdmitted || projectViewModel.patientHasAdmissionRequest
padding: const EdgeInsets.only( ? Column(
left: 20, children: [
right: 20, Padding(
top: 0, padding: const EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 12.0),
), child: Row(
child: GridView.builder( mainAxisSize: MainAxisSize.min,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), children: [
physics: NeverScrollableScrollPhysics(), Expanded(
shrinkWrap: true, flex: 9,
itemCount: hmgServices.length, child: Container(
padding: EdgeInsets.zero, margin: projectViewModel.isArabic ? EdgeInsets.only(left: 12.0) : EdgeInsets.only(right: 12.0),
itemBuilder: (BuildContext context, int index) { child: AspectRatio(
return ServicesView(hmgServices[index], index, true); aspectRatio: 2.15,
}, child: ServicesView(
), new HmgServices(23, TranslationBase.of(context).InPatient, TranslationBase.of(context).inPatientServices, "assets/images/new/InPatient.svg", false),
), 23,
true)),
),
),
Expanded(
flex: 4,
child: AspectRatio(
aspectRatio: 1.0,
child: ServicesView(
new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2, true)),
),
],
),
),
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 0,
),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return ServicesView(hmgServices[index], index, true);
},
),
),
],
)
: Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 0,
),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return ServicesView(hmgServices[index], index, true);
},
),
),
], ],
), ),
mHeight(140), mHeight(140),
@ -545,6 +612,12 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
); );
} }
Widget getInpatientButton() {
return Container(
height: 50.0,
);
}
Widget showFloating(String icon) { Widget showFloating(String icon) {
return Container( return Container(
width: MediaQuery.of(context).size.width * 0.06, width: MediaQuery.of(context).size.width * 0.06,

@ -300,6 +300,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
} }
}); });
// HMG_Geofencing(context).loadZones().then((instance) => instance.init());
} }
void setUserValues(value) async { void setUserValues(value) async {
@ -317,25 +319,26 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
} }
registerGeofences() async { // registerGeofences() async {
await locator<GeofencingServices>().getAllGeoZones(GeoZonesRequestModel()); // await locator<GeofencingServices>().getAllGeoZones(GeoZonesRequestModel());
//
void doIt() { // // void doIt() {
getUserInformation().then((value) { // // // getUserInformation().then((value) {
if (value != null) projectViewModel.platformBridge().registerHmgGeofences(); // // // if (value != null)
}); // // projectViewModel.platformBridge().registerHmgGeofences();
} // // // });
// // }
if (await Permission.location.isGranted) { // //
doIt(); // // if (await Permission.location.isGranted) {
} else { // // doIt();
[Permission.location].request().then((value) async { // // } else {
if (await Permission.location.isGranted) { // // [Permission.location].request().then((value) async {
doIt(); // // if (await Permission.location.isGranted) {
} // // doIt();
}); // // }
} // // });
} // // }
// }
login() async { login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA); var data = await sharedPref.getObject(IMEI_USER_DATA);
@ -644,6 +647,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
String voipToken = await sharedPref.getString(APNS_TOKEN); String voipToken = await sharedPref.getString(APNS_TOKEN);
getOneSignalVOIPToken(voipToken); getOneSignalVOIPToken(voipToken);
} }
// registerGeofences();
} }
getOneSignalVOIPToken(String voipToken) { getOneSignalVOIPToken(String voipToken) {

@ -22,6 +22,7 @@ import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_home.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
@ -191,6 +192,9 @@ class ServicesView extends StatelessWidget {
} else if (hmgServices.action == 8) { } else if (hmgServices.action == 8) {
Navigator.push(context, FadePage(page: ContactUsPage())); Navigator.push(context, FadePage(page: ContactUsPage()));
locator<GAnalytics>().hmgServices.logServiceName('find us reach us'); locator<GAnalytics>().hmgServices.logServiceName('find us reach us');
} else if (hmgServices.action == 23) {
Navigator.push(context, FadePage(page: InPatientServicesHome()));
locator<GAnalytics>().hmgServices.logServiceName('find us reach us');
} }
} }

@ -14,6 +14,8 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info_response_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_request_info_response_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart'; import 'package:diplomaticquarterapp/pages/login/register_new.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
@ -649,8 +651,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID), sharedPref.setString(TOKEN, result.authenticationTokenID),
checkIfUserAgreedBefore(result),
projectViewModel.analytics.loginRegistration.login_successful(), projectViewModel.analytics.loginRegistration.login_successful(),
checkIfUserAgreedBefore(result),
} }
} }
else else
@ -685,6 +687,38 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
} }
checkIfIsInPatient() {
bool isAdmitted = false;
bool hasAdmissionRequest = false;
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel;
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel;
ClinicListService service = new ClinicListService();
service.checkIfInPatientAPI(context).then((res) {
if (res['MessageStatus'] == 1) {
isAdmitted = res['isAdmitted'];
hasAdmissionRequest = res['hasAdmissionRequests'];
print("IS ADMITTED: $isAdmitted");
print("Has Admission Request: $hasAdmissionRequest");
if (isAdmitted) {
if (res['PatientAdmittedInformation'].length != 0) {
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
projectViewModel.setIsPatientAdmitted(true);
}
}
if (hasAdmissionRequest) {
if (res['MedicalInstruction'].length != 0) {
getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]);
projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel);
projectViewModel.setPatientHasAdmissionRequest(true);
}
}
} else {}
});
}
insertIMEI() { insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) { authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) {
print(err); print(err);
@ -716,6 +750,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
getToDoCount(), getToDoCount(),
checkIfIsInPatient(),
GifLoaderDialogUtils.hideDialog(AppGlobal.context), GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -7,6 +9,8 @@ import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info_response_model.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_request_info_response_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
@ -17,6 +21,7 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/uitl/utils.dart';
@ -339,7 +344,7 @@ class _Login extends State<Login> {
} }
this.authService.checkActivationCode(request, code).then((result) async { this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
registerGeoZones(); // registerGeoZones();
projectViewModel.setPrivilege(privilegeList: result); projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
result.list.isFamily = false; result.list.isFamily = false;
@ -358,6 +363,7 @@ class _Login extends State<Login> {
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
checkIfIsInPatient(),
getToDoCount(), getToDoCount(),
GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
@ -399,7 +405,40 @@ class _Login extends State<Login> {
}); });
} }
void registerGeoZones() { checkIfIsInPatient() {
bool isAdmitted = false;
bool hasAdmissionRequest = false;
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel;
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel;
ClinicListService service = new ClinicListService();
service.checkIfInPatientAPI(context).then((res) {
if (res['MessageStatus'] == 1) {
isAdmitted = res['isAdmitted'];
hasAdmissionRequest = res['hasAdmissionRequests'];
print("IS ADMITTED: $isAdmitted");
print("Has Admission Request: $hasAdmissionRequest");
if (isAdmitted) {
if (res['PatientAdmittedInformation'].length != 0) {
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
projectViewModel.setIsPatientAdmitted(true);
}
}
if (hasAdmissionRequest) {
if (res['MedicalInstruction'].length != 0) {
getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]);
projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel);
projectViewModel.setPatientHasAdmissionRequest(true);
}
}
} else {}
});
}
void registerGeoZones() async {
await locator<GeofencingServices>().getAllGeoZones(GeoZonesRequestModel());
projectViewModel.platformBridge().registerHmgGeofences(); projectViewModel.platformBridge().registerHmgGeofences();
} }

@ -2,10 +2,14 @@ import 'package:badges/badges.dart' as badge_import;
import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_advance_payment.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -18,6 +22,8 @@ class PaymentService extends StatelessWidget {
ToDoCountProviderModel? model; ToDoCountProviderModel? model;
ProjectViewModel? projectViewModel; ProjectViewModel? projectViewModel;
InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -147,9 +153,55 @@ class PaymentService extends StatelessWidget {
), ),
), ),
); );
medical.add(
InkWell(
onTap: () {
if(projectViewModel.isPatientAdmitted) {
getInPatientAdvancePaymentRequests(context);
projectViewModel.analytics.advancePayments.payment_services(service_type: 'inpatient advance payment');
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).onlyAdmitted);
}
},
child: MedicalProfileItem(
title: "InPatient",
imagePath: 'assets/images/inpatient_advance.png',
subTitle: "Advance Payment",
isPngImage: true,
width: 45.0,
height: 45.0,
),
),
);
return medical; return medical;
} }
void getInPatientAdvancePaymentRequests(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.getInPatientAdvancePaymentRequests(projectViewModel.inPatientProjectID, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo : 0,
projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
if (res['responseInpatient'] != null) {
inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]);
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).noData);
}
} else {
Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel)));
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
navigateToToDoPage(BuildContext context) { navigateToToDoPage(BuildContext context) {
if (projectViewModel!.isLogin) { if (projectViewModel!.isLogin) {
// if (model.count != 0) { // if (model.count != 0) {

@ -217,7 +217,8 @@ class AuthProvider with ChangeNotifier {
request.channel = CHANNEL; request.channel = CHANNEL;
request.iPAdress = IP_ADDRESS; request.iPAdress = IP_ADDRESS;
request.generalid = GENERAL_ID; request.generalid = GENERAL_ID;
request.languageID = (languageID == 'ar' ? 1 : 2); // request.languageID = (languageID == 'ar' ? 1 : 2);
request.languageID = 2;
request.deviceTypeID = Platform.isIOS ? 1 : 2; request.deviceTypeID = Platform.isIOS ? 1 : 2;
request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.patientOutSA = request.zipCode == '966' ? 0 : 1;
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;

@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info_response_model.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ClinicListService extends BaseService { class ClinicListService extends BaseService {
@ -48,6 +50,96 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> checkIfInPatientAPI(context) async {
Map<String, dynamic> request;
request = {
"IsActiveAppointment": false,
};
dynamic localRes;
await baseAppClient.post(CHECK_IF_PATIENT_ADMITTED, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getGeneralInstructions(int projectID, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_GENERAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getInPatientAdvancePaymentRequests(int projectID, int admissionNo, int admissionReqNo, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AdmissionReqNo": admissionReqNo, "AdmissionNo": admissionNo};
dynamic localRes;
await baseAppClient.post(GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getInPatientPaymentLink(int projectID, int admissionNo, int orderID, String name, String email, num amount, String nationalID, int clinicID, int paymentRequestID, context) async {
Map<String, dynamic> request;
// request = {"ProjectID": projectID, "AdmissionReqNo": admissionReqNo, "AdmissionNo": admissionNo};
request = {
"ProjectID": projectID,
"ClientOrderID": orderID,
"OrderDescription": "InPatient Advance Payment",
"CustomerName": name,
"CustomerEmail": email,
"Amount": amount,
"IsPaid": 0,
"AppointmentID": admissionNo.toString(),
"PaymentOption": "0",
"PaymentReferenceNumber": admissionNo,
"SourceType": "1",
"NationalID": nationalID,
"ClinicID": clinicID,
"PaymentRequestId": paymentRequestID,
"createdBy": 102
};
dynamic localRes;
await baseAppClient.post(GET_INPATIENT_ADVANCE_PAYMENT_LINK, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getMedicalInstructions(int projectID, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_MEDICAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getProjectsList(context) async { Future<Map> getProjectsList(context) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -142,14 +234,228 @@ class ClinicListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCountries() async { Future<Map> getCountries() async {
Map<String, dynamic> request ={}; Map<String, dynamic> request = {};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertInPatientOrder(
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": getAdmissionInfoResponseModel.projectID,
"TypeID": typeID,
"RoomNo": getAdmissionInfoResponseModel.roomID,
"GenderId": 2,
"AdmissionNo": getAdmissionInfoResponseModel.admissionNo,
"prescriptionNo": 250420,
"patientName": patientName,
"patientNameN": patientNameAR,
"PatientMobileNumber": patientMobileNo,
"comments": comments
};
dynamic localRes;
await baseAppClient.post(INSERT_INPATIENT_ORDER, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getBirthNotification(num motherMRN, context) async {
Map<String, dynamic> request;
request = {
"mothermrn": motherMRN,
};
dynamic localRes;
await baseAppClient.post(GET_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> submitBirthNotification(num motherMRN, int projectID, String fatherNameAR, String fatherNameEN, String babyNameAR, String babyNameEN, String contactNum, String idImage, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"mothermrn": motherMRN,
"fatherName": fatherNameEN,
"fatherNameAr": fatherNameAR,
"babyName": babyNameEN,
"babyNameAr": babyNameAR,
"contactNumber": contactNum,
"iDImage": idImage,
};
dynamic localRes;
await baseAppClient.post(SAVE_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getAdmittedPatientDetails(int patientID, int projectID, int admissionNo, int buildingID, int floorID, int nursingStationID, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "PatientID": patientID, "AdmissionNo": admissionNo, "BuildingID": buildingID, "FloorID": floorID, "NursingStationID": nursingStationID};
dynamic localRes;
await baseAppClient.post(GET_ADMITTED_PATIENTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getInPatientAdvancePaymentHistory(int projectID, int admissionNo, int admissionReqNo, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AdmissionNo": admissionNo, "AdmissionReqNo": admissionReqNo};
dynamic localRes;
await baseAppClient.post(GET_INPATIENT_PAID_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getCurrentWeekIDAndDay(BuildContext context) async {
dynamic localRes;
await baseAppClient.get(GET_CURRENT_WEEKID_WEEKDAY, isExternal: false, isRCService: false, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
});
return localRes;
}
Future<Map> getMealsOfScheduleID(int projectID, int admissionNo, int dietType, int weekID, int weekDay, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"AdmissionNo": admissionNo,
"BuildingID": 0,
"FloorID": 0,
"NursingStationID": 0,
"DietType": dietType,
"WeekID": weekID,
"WeekDay": weekDay,
};
dynamic localRes;
await baseAppClient.post(GET_MEALS_OF_SCHEDULE_ID, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getDefaultItemsOfScheduleID(int projectID, int scheduleID, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"MealScheduleID": scheduleID,
};
dynamic localRes;
await baseAppClient.post(GET_MEAL_ITEMS_OF_SCHEDULE_ID, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> placeMealPlanOrder(int projectID, int scheduleID, String itemIDList, int patientID, int admissionNo, bool isCompanion, bool isFasting, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"ItemIDList": itemIDList,
"IsActive": true,
"OrderDate": DateUtil.getISODateFormat(DateTime.now()).replaceAll("T", " "),
"PatientID": patientID,
"AdmissionNo": admissionNo,
"IsCompanion": isCompanion,
"IsFasting": isFasting,
"CreatedBy": patientID,
"EditedBy": patientID,
"MealScheduleID": scheduleID,
"MealStatus": 1,
"ItemStatus": 0,
"ConfirmedBy": patientID,
"Remarks": "",
"IsVIP": false,
"IsFixedRemarks": false
};
dynamic localRes;
await baseAppClient.post(PLACE_MEAL_PLAN_ORDER, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getDischargeMedicationOrder(GetAdmissionInfoResponseModel getAdmissionInfoResponseModel) async {
Map<String, dynamic> request;
request = {
"ProjectID": getAdmissionInfoResponseModel.projectID,
"ClinicID": getAdmissionInfoResponseModel.clinicID,
"DoctorID": getAdmissionInfoResponseModel.doctorID,
"AdmissionNo": getAdmissionInfoResponseModel.admissionNo
};
// request = {
// "ProjectID": 12,
// "VersionID": 10.8,
// "Channel": 3,
// "LanguageID": 2,
// "IPAdress": "10.20.10.20",
// "generalid": "Cs2020@2016\$2958",
// "DeviceTypeID": 2,
// "PatientType": 1,
// "PatientTypeID": 1,
// "TokenID": "@dm!n",
// "PatientID": 869588,
// "PatientOutSA": 0,
// "SessionID": "rVuK3nzN4UKN0SW95un0jQ==",
// "ClinicID": 2,
// "DoctorID": "7600",
// "AdmissionNo": 2011001258
// };
dynamic localRes;
await baseAppClient.post(INPATIENT_DISCHARGE_MEDICATIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
} }

@ -18,7 +18,7 @@
// import 'package:geofencing/geofencing.dart'; // import 'package:geofencing/geofencing.dart';
// //
// class HMG_Geofencing { // class HMG_Geofencing {
// var _testTrigger = false; // var _testTrigger = true;
// static var _isolatePortName = "hmg_geofencing_send_port"; // static var _isolatePortName = "hmg_geofencing_send_port";
// //
// List<GeoZonesResponseModel> _zones; // List<GeoZonesResponseModel> _zones;

@ -1,4 +1,5 @@
import 'package:device_calendar/device_calendar.dart'; import 'package:device_calendar/device_calendar.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DateUtil { class DateUtil {
@ -90,6 +91,17 @@ class DateUtil {
return start + "$milliseconds" + end; return start + "$milliseconds" + end;
} }
static String convertTime(String timeStr) {
TimeOfDay time = TimeOfDay(hour: num.parse(timeStr.split(":")[0]), minute: num.parse(timeStr.split(":")[1])); // 24-hour format time
int hour = time.hourOfPeriod; // get hour in 12-hour format
String meridiem = time.period == DayPeriod.am ? "AM" : "PM"; // get AM/PM
String convertedTime = '$hour:${time.minute == 0 ? "00" : time.minute} $meridiem'; // create the new time string
return convertedTime;
}
static String formatDateToDate(DateTime date, bool isArabic) { static String formatDateToDate(DateTime date, bool isArabic) {
return DateFormat('dd MMM yyy', isArabic ? "ar_SA" : "en_US").format(date); return DateFormat('dd MMM yyy', isArabic ? "ar_SA" : "en_US").format(date);
} }

@ -19,6 +19,7 @@ import 'package:firebase_messaging/firebase_messaging.dart' as fir;
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_ios_voip_kit/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
@ -41,6 +42,7 @@ Future<dynamic> backgroundMessageHandler(dynamic message) async {
} }
if (message.data != null && (message.data['is_call'] == 'true' || message.data['is_call'] == true)) { if (message.data != null && (message.data['is_call'] == 'true' || message.data['is_call'] == true)) {
// showCallkitIncoming(message);
_incomingCall(message.data); _incomingCall(message.data);
return; return;
} else { } else {
@ -103,6 +105,57 @@ callPage(String sessionID, String token) async {
// } // }
} }
// Future<void> showCallkitIncoming(Map message) async {
// // if (message['type'] == 'ReservationCallStart') {
// var params = CallKitParams(
// id: DateTime.now().millisecondsSinceEpoch.toString(),
// nameCaller: 'Dr Sulaiman Al Habib',
// appName: 'Dr Sulaiman Al Habib',
// avatar: 'https://play-lh.googleusercontent.com/FBNNpxb7m6eM6wtW7MV1Ffp6OXOGLI38q47zcvP29OCYA1yhYH5mZzl5itZi0TgOyZpG',
// handle: 'LiveCare Call',
// type: 1,
// duration: 60000,
// textAccept: 'Accept',
// textDecline: 'Decline',
// textMissedCall: 'Missed call',
// textCallback: 'Call back',
// extra: <String, dynamic>{
// // 'reservationID': message['id'],
// 'userId': '1a2b3c4d'
// },
// headers: <String, dynamic>{'apiKey': 'Abc@123!', 'platform': 'flutter'},
// android: AndroidParams(
// isCustomNotification: true,
// isShowLogo: false,
// isShowCallback: false,
// ringtonePath: 'system_ringtone_default',
// backgroundColor: '#424242FF',
// // 'backgroundUrl': 'https://i.pravatar.cc/500',
// actionColor: '#4CAF50',
// incomingCallNotificationChannelName: "Incoming Call",
// missedCallNotificationChannelName: "Missed Call",
// ),
// ios: IOSParams(
// iconName: 'CallKitLogo',
// handleType: '',
// supportsVideo: true,
// maximumCallGroups: 2,
// maximumCallsPerCallGroup: 1,
// audioSessionMode: 'default',
// audioSessionActive: true,
// audioSessionPreferredSampleRate: 44100.0,
// audioSessionPreferredIOBufferDuration: 0.005,
// supportsDTMF: true,
// supportsHolding: true,
// supportsGrouping: false,
// supportsUngrouping: false,
// ringtonePath: 'system_ringtone_default'));
// await FlutterCallkitIncoming.showCallkitIncoming(params);
// // } else if (message['type'] == 'ReservationCallFinished') {
// // await FlutterCallkitIncoming.endAllCalls();
// // }
// }
_incomingCall(Map<String, dynamic> data) async { _incomingCall(Map<String, dynamic> data) async {
LandingPage.incomingCallData = IncomingCallData.fromJson(data); LandingPage.incomingCallData = IncomingCallData.fromJson(data);
if (LandingPage.isOpenCallPage == false) { if (LandingPage.isOpenCallPage == false) {
@ -262,6 +315,7 @@ class PushNotificationHandler {
} }
if (remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) { if (remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) {
_incomingCall(remoteMessage.data); _incomingCall(remoteMessage.data);
// showCallkitIncoming(remoteMessage.data);
} else { } else {
GetNotificationsResponseModel notification = new GetNotificationsResponseModel(); GetNotificationsResponseModel notification = new GetNotificationsResponseModel();

@ -2900,8 +2900,51 @@ class TranslationBase {
String get updateInsuranceManuallyDialog => localizedValues["updateInsuranceManuallyDialog"][locale.languageCode]; String get updateInsuranceManuallyDialog => localizedValues["updateInsuranceManuallyDialog"][locale.languageCode];
String get viewReport => localizedValues["viewReport"][locale.languageCode]; String get viewReport => localizedValues["viewReport"][locale.languageCode];
String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode]; String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode];
String get InPatient => localizedValues["InPatient"][locale.languageCode];
String get inPatientServices => localizedValues["InPatientServices"][locale.languageCode];
String get InPatientServicesHeader => localizedValues["InPatientServicesHeader"][locale.languageCode];
String get admissionGeneral => localizedValues["admissionGeneral"][locale.languageCode];
String get consent => localizedValues["consent"][locale.languageCode];
String get generalInstructionsTitle => localizedValues["generalInstructionsTitle"][locale.languageCode];
String get generalInstructionsSubTitle => localizedValues["generalInstructionsSubTitle"][locale.languageCode];
String get medicalInstructionsTitle => localizedValues["medicalInstructionsTitle"][locale.languageCode];
String get medicalInstructionsSubTitle => localizedValues["medicalInstructionsSubTitle"][locale.languageCode];
String get mealPlanTitle => localizedValues["mealPlanTitle"][locale.languageCode];
String get mealPlanSubTitle => localizedValues["mealPlanSubTitle"][locale.languageCode];
String get birthNotificationTitle => localizedValues["birthNotificationTitle"][locale.languageCode];
String get birthNotificationSubTitle => localizedValues["birthNotificationSubTitle"][locale.languageCode];
String get admissionNoticeTitle => localizedValues["admissionNoticeTitle"][locale.languageCode];
String get admissionNoticeSubTitle => localizedValues["admissionNoticeSubTitle"][locale.languageCode];
String get mothersMRN => localizedValues["mothersMRN"][locale.languageCode];
String get mothersName => localizedValues["mothersName"][locale.languageCode];
String get fathersNameEN => localizedValues["fathersNameEN"][locale.languageCode];
String get fathersNameAR => localizedValues["fathersNameAR"][locale.languageCode];
String get babysNameEN => localizedValues["babysNameEN"][locale.languageCode];
String get babysNameAR => localizedValues["babysNameAR"][locale.languageCode];
String get contactNumber => localizedValues["contactNumber"][locale.languageCode];
String get scanID => localizedValues["scanID"][locale.languageCode];
String get birthNotificationNotes1 => localizedValues["birthNotificationNotes1"][locale.languageCode];
String get birthNotificationNotes2 => localizedValues["birthNotificationNotes2"][locale.languageCode];
String get birthNotificationNotes3 => localizedValues["birthNotificationNotes3"][locale.languageCode];
String get placeOrder => localizedValues["placeOrder"][locale.languageCode];
String get isFasting => localizedValues["isFasting"][locale.languageCode];
String get noGeneralInstructions => localizedValues["noGeneralInstructions"][locale.languageCode];
String get noMedicalInstructions => localizedValues["noMedicalInstructions"][locale.languageCode];
String get medicalInstructions => localizedValues["medicalInstructions"][locale.languageCode];
String get generalInstructions => localizedValues["generalInstructions"][locale.languageCode];
String get copyLink => localizedValues["copyLink"][locale.languageCode];
String get copyLinkTxt => localizedValues["copyLinkTxt"][locale.languageCode];
String get paymentLinkCopied => localizedValues["paymentLinkCopied"][locale.languageCode];
String get proErrorMessage => localizedValues["proErrorMessage"][locale.languageCode];
String get admissionNo => localizedValues["admissionNo"][locale.languageCode];
String get admissionReqNo => localizedValues["admissionReqNo"][locale.languageCode];
String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode];
String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode];
String get onlyAdmitted => localizedValues["onlyAdmitted"][locale.languageCode];
String get assistYou => localizedValues["assistYou"][locale.languageCode];
String get receive => localizedValues["receive"][locale.languageCode];
String get PRO => localizedValues["PRO"][locale.languageCode];
String get patientRelationOffice => localizedValues["patientRelationOffice"][locale.languageCode];
String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode]; String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode];
String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode];
String get continueCash => localizedValues["continueCash"][locale.languageCode]; String get continueCash => localizedValues["continueCash"][locale.languageCode];

@ -759,6 +759,7 @@ class Utils {
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
text, text,
maxLines: 1,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
SizedBox(height: 5), SizedBox(height: 5),

@ -313,6 +313,13 @@ Decoration containerBottomRightRadiusWithGradientBorder(double radius, {Color? d
Decoration containerRadius(Color background, double radius) { Decoration containerRadius(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
border: Border.all( border: Border.all(
width: 1, // width: 1, //
color: background // <--- border width here color: background // <--- border width here

@ -70,7 +70,7 @@ class ImageOptions {
} }
galleryImageAndroid(Function(String, File) image) async { galleryImageAndroid(Function(String, File) image) async {
if(await PermissionService.isExternalStorageEnabled()) { if (await PermissionService.isExternalStorageEnabled()) {
File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20))!.path); File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.gallery, imageQuality: 20))!.path);
String fileName = _image.path; String fileName = _image.path;
final bytes = File(fileName).readAsBytesSync(); final bytes = File(fileName).readAsBytesSync();

@ -73,6 +73,7 @@ class DefaultButton extends StatelessWidget {
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: color ?? const Color(0xffD02127), backgroundColor: color ?? const Color(0xffD02127),
disabledForegroundColor: disabledColor, disabledForegroundColor: disabledColor,
disabledBackgroundColor: disabledColor,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),

@ -10,6 +10,7 @@ class MedicalProfileItem extends StatelessWidget {
final String subTitle; final String subTitle;
final bool hasBadge = false; final bool hasBadge = false;
final bool isPngImage; final bool isPngImage;
final bool isInPatient;
bool isEnable; bool isEnable;
Color? imgColor; Color? imgColor;
final width; final width;
@ -24,7 +25,7 @@ class MedicalProfileItem extends StatelessWidget {
this.imgColor, this.imgColor,
this.isPngImage = false, this.isPngImage = false,
this.width, this.width,
this.height}); this.height, this.isInPatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -64,7 +65,7 @@ class MedicalProfileItem extends StatelessWidget {
color: imgColor, color: imgColor,
) )
: SvgPicture.asset( : SvgPicture.asset(
"assets/images/new/services/$imagePath", isInPatient ? "assets/images/new/inpatient/$imagePath" : "assets/images/new/services/$imagePath",
height: height != null height: height != null
? height ? height
: SizeConfig.widthMultiplier! * 7, : SizeConfig.widthMultiplier! * 7,

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/core/service/privilege_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
@ -21,9 +20,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notificatio
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -611,6 +608,9 @@ class _AppDrawerState extends State<AppDrawer> {
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
await _privilegeService.getPrivilege(); await _privilegeService.getPrivilege();
projectProvider!.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider!.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
projectProvider!.setIsPatientAdmitted(false);
projectProvider!.setPatientHasAdmissionRequest(false);
projectProvider!.setInPatientProjectID(0);
var appLanguage = await sharedPref.getString(APP_LANGUAGE); var appLanguage = await sharedPref.getString(APP_LANGUAGE);
await sharedPref.clear(); await sharedPref.clear();
await sharedPref.setString(APP_LANGUAGE, appLanguage); await sharedPref.setString(APP_LANGUAGE, appLanguage);

@ -20,10 +20,22 @@ class AppExpandableNotifier extends StatefulWidget {
bool expandFlag = false; bool expandFlag = false;
bool hasCounter = false; bool hasCounter = false;
String counter = "0"; String counter = "0";
Color widgetColor = Colors.white;
var controller = new ExpandableController(); var controller = new ExpandableController();
bool isTitleSingleLine; bool isTitleSingleLine;
bool isDisabled = false;
AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true, this.hasCounter = false, this.counter = "0"}); AppExpandableNotifier(
{this.headerWidget,
this.bodyWidget,
this.title,
this.collapsed,
this.isExpand = false,
this.isTitleSingleLine = true,
this.hasCounter = false,
this.counter = "0",
this.widgetColor,
this.isDisabled = false});
_AppExpandableNotifier createState() => _AppExpandableNotifier(); _AppExpandableNotifier createState() => _AppExpandableNotifier();
} }
@ -60,7 +72,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
} }
return ExpandableNotifier( return ExpandableNotifier(
child: Container( child: Container(
color: Colors.white, color: widget.widgetColor != null ? widget.widgetColor : Colors.white,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
@ -80,10 +92,11 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
padding: const EdgeInsets.only(top: 20, bottom: 20, left: 21, right: 21), padding: const EdgeInsets.only(top: 20, bottom: 20, left: 21, right: 21),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { if (!widget.isDisabled)
widget.expandFlag = !widget.expandFlag; setState(() {
widget.controller.expanded = widget.expandFlag; widget.expandFlag = !widget.expandFlag;
}); widget.controller.expanded = widget.expandFlag;
});
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -94,27 +107,30 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (_mainTitle.isNotEmpty && widget.isTitleSingleLine) if (_mainTitle.isNotEmpty && widget.isTitleSingleLine)
!widget.hasCounter ? !widget.hasCounter
Text( ? Text(
_mainTitle, _mainTitle,
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
) : Row( )
children: [ : Row(
Text( children: [
_mainTitle, Text(
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), _mainTitle,
), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1),
SizedBox(width: 10.0,), ),
CircleAvatar( SizedBox(
backgroundColor: CustomColors.accentColor, width: 10.0,
radius: 12.0, ),
child: Text( CircleAvatar(
widget.counter, backgroundColor: CustomColors.accentColor,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.72), radius: 12.0,
child: Text(
widget.counter,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.72),
),
)
],
), ),
)
],
),
if (_title.isNotEmpty && !widget.isTitleSingleLine) if (_title.isNotEmpty && !widget.isTitleSingleLine)
Text( Text(
_title, _title,

@ -36,8 +36,8 @@ dependencies:
#chart #chart
fl_chart: ^0.64.0 fl_chart: ^0.64.0
#Camera Preview #Camera Preview
camera: ^0.10.1 camera: ^0.10.1
@ -142,7 +142,7 @@ dependencies:
flutter_nfc_kit: ^3.3.1 flutter_nfc_kit: ^3.3.1
#geofencing: any #geofencing: any
speech_to_text: ^6.1.1 speech_to_text: ^6.1.1
#in_app_update: ^4.2.2 #in_app_update: ^4.2.2
in_app_review: ^2.0.3 in_app_review: ^2.0.3
@ -157,7 +157,7 @@ dependencies:
flutter_staggered_grid_view: ^0.7.0 flutter_staggered_grid_view: ^0.7.0
huawei_hmsavailability: ^6.11.0+301 huawei_hmsavailability: ^6.11.0+301
huawei_location: ^6.11.0+301 huawei_location: ^6.11.0+301
share_plus: ^6.3.4
# Marker Animation # Marker Animation
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
equatable: ^2.0.3 equatable: ^2.0.3
@ -206,6 +206,7 @@ flutter:
- assets/payment_options/ - assets/payment_options/
- assets/images/new/ - assets/images/new/
- assets/images/new/inpatient/
- assets/images/new/mass/ - assets/images/new/mass/
- assets/images/new/bottom_nav/ - assets/images/new/bottom_nav/
- assets/images/new/services/ - assets/images/new/services/

Loading…
Cancel
Save