diff --git a/assets/images/bc_parking.png b/assets/images/bc_parking.png new file mode 100644 index 00000000..64633516 Binary files /dev/null and b/assets/images/bc_parking.png differ diff --git a/assets/images/nfc/ic_done.png b/assets/images/nfc/ic_done.png new file mode 100644 index 00000000..5b802855 Binary files /dev/null and b/assets/images/nfc/ic_done.png differ diff --git a/assets/images/nfc/ic_nfc.png b/assets/images/nfc/ic_nfc.png new file mode 100644 index 00000000..274e1b8c Binary files /dev/null and b/assets/images/nfc/ic_nfc.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index bd760fee..a361a5d9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -313,6 +313,9 @@ const UPDATE_HEALTH_TERMS = const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; +const SEND_CHECK_IN_NFC_REQUEST = + 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c3e42ff9..8dbde94c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -466,6 +466,14 @@ const Map localizedValues = { "ar": " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " }, + "parkingDescription": { + + "en": "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).", + + "ar": "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)." + + }, + "checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"}, "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, "showMyPark": {"en": "Show My Park", "ar": "عرض بارك"}, "clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"}, @@ -1081,6 +1089,7 @@ const Map localizedValues = { }, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, + "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, "Ports": {"en": "Ports", "ar": "المنافذ"}, "Way": {"en": "Way", "ar": "الطزيقة"}, diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 6e761991..703f5e3c 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -30,3 +30,4 @@ const NOTIFICATION_COUNT = 'notification-count'; const PHARMACY_SELECTED_ADDRESS = 'selected-address'; const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; const H2O_UNIT = 'H2O_UNIT'; +const H2O_REMINDER = 'H2O_REMINDER'; diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart index bb100219..2f4ec9f0 100644 --- a/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart +++ b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart @@ -49,6 +49,7 @@ class UserDetailModel { this.isNotificationON}); UserDetailModel.fromJson(Map json) { + if(json==null) return; userID = json['UserID']; patientID = json['PatientID']; patientType = json['PatientType']; diff --git a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart index 5f41f878..26bf567a 100644 --- a/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart +++ b/lib/core/model/insurance/ReauestInsuranceApprovalModel.dart @@ -1,4 +1,4 @@ -class ReauestInsuranceApprovalModel { +class RequestInsuranceApprovalModel { double versionID; int channel; int languageID; @@ -15,7 +15,7 @@ class ReauestInsuranceApprovalModel { int eXuldAPPNO; int projectID; - ReauestInsuranceApprovalModel( + RequestInsuranceApprovalModel( {this.versionID, this.channel, this.languageID, @@ -32,7 +32,7 @@ class ReauestInsuranceApprovalModel { this.eXuldAPPNO, this.projectID}); - ReauestInsuranceApprovalModel.fromJson(Map json) { + RequestInsuranceApprovalModel.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; languageID = json['LanguageID']; diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index 894fad46..27911267 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -1,140 +1,465 @@ -class InsuranceApprovalDetails { - String procedureName; - String status; - String isInvoicedDesc; - - InsuranceApprovalDetails({ - this.procedureName, - this.status, - this.isInvoicedDesc, - }); - - InsuranceApprovalDetails.fromJson(Map json) { - try { - isInvoicedDesc = json['IsInvoicedDesc']; - status = json['Status']; - procedureName = json['ProcedureName']; - } catch (e) { - print(e); - } - } -} - class InsuranceApprovalModel { - InsuranceApprovalDetails approvalDetails; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; - int patientID; - String tokenID; - int patientTypeID; - int patientType; - int eXuldAPPNO; + String setupID; int projectID; - String doctorName; - String clinicName; - String patientDescription; int approvalNo; - String approvalStatusDescption; - int unUsedCount; - - //String companyName; + String approvalDate; + int patientType; + int patientID; + int companyID; + int subCategoryID; + int doctorID; + int clinicID; + int approvalType; + String inpatientApprovalSubType; + String validFrom; + String vaildDays; + String validTo; + bool isApprovalOnGross; + bool isPackage; + int requestedAmount; + int actualApprovedAmount; + int aviliableAmount; + String companyApprovalNo; + int progNoteOrderNo; + String submitOn; + String receiptOn; + String remarks1; + String remarks2; + int status; + String feedbackStatusBy; + String feedbackStatus; + String feedbackStatusOn; + int authorizerID; String expiryDate; - String rceiptOn; int appointmentNo; + int admissionNo; + int admissionRequestNo; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + String rowVer; + bool isAddlDiscApplied; + int inProgressReasonID; + String extendedBy; + String extendedOn; + int subPolicyNo; + int noOrderAuthorizerID; + bool isVerbalApproval; + String subStatus; + bool isNotificationSend; + String eApprovalStatus; + String eApprovalRemarks; + bool isEmailSentOnDelayApproval; + int eAuthorizationID; + InsuranceApprovalDetails apporvalDetails; + String approvalStatusDescption; + String clinicName; + String clinicNameN; + String companyName; + String doctorImageURL; + String doctorName; + String doctorNameN; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isLiveCareAppointment; + String projectName; + String projectNameN; + String qR; + List speciality; + String strApprovalDate; + String strExpiryDate; + String strSubmitDate; + int totaUnUsedCount; + int unUsedCount; InsuranceApprovalModel( - {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.eXuldAPPNO, + {this.setupID, this.projectID, - this.doctorName, - this.clinicName, - this.patientDescription, this.approvalNo, - this.approvalStatusDescption, - this.unUsedCount, - //this.companyName, + this.approvalDate, + this.patientType, + this.patientID, + this.companyID, + this.subCategoryID, + this.doctorID, + this.clinicID, + this.approvalType, + this.inpatientApprovalSubType, + this.validFrom, + this.vaildDays, + this.validTo, + this.isApprovalOnGross, + this.isPackage, + this.requestedAmount, + this.actualApprovedAmount, + this.aviliableAmount, + this.companyApprovalNo, + this.progNoteOrderNo, + this.submitOn, + this.receiptOn, + this.remarks1, + this.remarks2, + this.status, + this.feedbackStatusBy, + this.feedbackStatus, + this.feedbackStatusOn, + this.authorizerID, this.expiryDate, - this.rceiptOn, - this.approvalDetails, - this.appointmentNo}); - - InsuranceApprovalDetails x = InsuranceApprovalDetails(); + this.appointmentNo, + this.admissionNo, + this.admissionRequestNo, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.rowVer, + this.isAddlDiscApplied, + this.inProgressReasonID, + this.extendedBy, + this.extendedOn, + this.subPolicyNo, + this.noOrderAuthorizerID, + this.isVerbalApproval, + this.subStatus, + this.isNotificationSend, + this.eApprovalStatus, + this.eApprovalRemarks, + this.isEmailSentOnDelayApproval, + this.eAuthorizationID, + this.apporvalDetails, + this.approvalStatusDescption, + this.clinicName, + this.clinicNameN, + this.companyName, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isLiveCareAppointment, + this.projectName, + this.projectNameN, + this.qR, + this.speciality, + this.strApprovalDate, + this.strExpiryDate, + this.strSubmitDate, + this.totaUnUsedCount, + this.unUsedCount}); InsuranceApprovalModel.fromJson(Map json) { - try { - rceiptOn = json['ReceiptOn']; - expiryDate = json['ExpiryDate']; - //companyName = json['CompanyName']; - unUsedCount = json['TotaUnUsedCount']; - approvalStatusDescption = json['ApprovalStatusDescption']; - approvalNo = json['ApprovalNo']; - patientDescription = json['IsInOutPatientDescription']; - versionID = json['VersionID']; - channel = json['Channel']; - languageID = json['LanguageID']; - iPAdress = json['IPAdress']; - generalid = json['generalid']; - patientOutSA = json['PatientOutSA']; - sessionID = json['SessionID']; - isDentalAllowedBackend = json['isDentalAllowedBackend']; - deviceTypeID = json['DeviceTypeID']; - patientID = json['PatientID']; - tokenID = json['TokenID']; - patientTypeID = json['PatientTypeID']; - patientType = json['PatientType']; - eXuldAPPNO = json['EXuldAPPNO']; - projectID = json['ProjectID']; - doctorName = json['DoctorName']; - clinicName = json['ClinicName']; - approvalDetails = - InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); - appointmentNo = json['AppointmentNo']; - } catch (e) { - print(e); + setupID = json['SetupID']; + projectID = json['ProjectID']; + approvalNo = json['ApprovalNo']; + approvalDate = json['ApprovalDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + companyID = json['CompanyID']; + subCategoryID = json['SubCategoryID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + approvalType = json['ApprovalType']; + inpatientApprovalSubType = json['InpatientApprovalSubType']; + validFrom = json['ValidFrom']; + vaildDays = json['VaildDays']; + validTo = json['ValidTo']; + isApprovalOnGross = json['IsApprovalOnGross']; + isPackage = json['IsPackage']; + requestedAmount = json['RequestedAmount']; + actualApprovedAmount = json['ActualApprovedAmount']; + aviliableAmount = json['AviliableAmount']; + companyApprovalNo = json['CompanyApprovalNo']; + progNoteOrderNo = json['ProgNoteOrderNo']; + submitOn = json['SubmitOn']; + receiptOn = json['ReceiptOn']; + remarks1 = json['Remarks1']; + remarks2 = json['Remarks2']; + status = json['Status']; + feedbackStatusBy = json['FeedbackStatusBy']; + feedbackStatus = json['FeedbackStatus']; + feedbackStatusOn = json['FeedbackStatusOn']; + authorizerID = json['AuthorizerID']; + expiryDate = json['ExpiryDate']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + admissionRequestNo = json['AdmissionRequestNo']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + rowVer = json['RowVer']; + isAddlDiscApplied = json['IsAddlDiscApplied']; + inProgressReasonID = json['InProgressReasonID']; + extendedBy = json['ExtendedBy']; + extendedOn = json['ExtendedOn']; + subPolicyNo = json['SubPolicyNo']; + noOrderAuthorizerID = json['NoOrderAuthorizerID']; + isVerbalApproval = json['isVerbalApproval']; + subStatus = json['SubStatus']; + isNotificationSend = json['IsNotificationSend']; + eApprovalStatus = json['EApprovalStatus']; + eApprovalRemarks = json['EApprovalRemarks']; + isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval']; + eAuthorizationID = json['EAuthorizationID']; + if (json['ApporvalDetails'] != null) { + apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); } + approvalStatusDescption = json['ApprovalStatusDescption']; + clinicName = json['ClinicName']; + clinicNameN = json['ClinicNameN']; + companyName = json['CompanyName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + strApprovalDate = json['StrApprovalDate']; + strExpiryDate = json['StrExpiryDate']; + strSubmitDate = json['StrSubmitDate']; + totaUnUsedCount = json['TotaUnUsedCount']; + unUsedCount = json['UnUsedCount']; } Map toJson() { final Map data = new Map(); - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; - data['IPAdress'] = this.iPAdress; - data['generalid'] = this.generalid; - data['PatientOutSA'] = this.patientOutSA; - data['SessionID'] = this.sessionID; - data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; - data['DeviceTypeID'] = this.deviceTypeID; - data['PatientID'] = this.patientID; - data['TokenID'] = this.tokenID; - data['PatientTypeID'] = this.patientTypeID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ApprovalNo'] = this.approvalNo; + data['ApprovalDate'] = this.approvalDate; data['PatientType'] = this.patientType; - if (appointmentNo == null) { - data['EXuldAPPNO'] = this.eXuldAPPNO; - data['ProjectID'] = this.projectID; - } - if (appointmentNo != null) { - data['AppointmentNo'] = this.appointmentNo; + data['PatientID'] = this.patientID; + data['CompanyID'] = this.companyID; + data['SubCategoryID'] = this.subCategoryID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['ApprovalType'] = this.approvalType; + data['InpatientApprovalSubType'] = this.inpatientApprovalSubType; + data['ValidFrom'] = this.validFrom; + data['VaildDays'] = this.vaildDays; + data['ValidTo'] = this.validTo; + data['IsApprovalOnGross'] = this.isApprovalOnGross; + data['IsPackage'] = this.isPackage; + data['RequestedAmount'] = this.requestedAmount; + data['ActualApprovedAmount'] = this.actualApprovedAmount; + data['AviliableAmount'] = this.aviliableAmount; + data['CompanyApprovalNo'] = this.companyApprovalNo; + data['ProgNoteOrderNo'] = this.progNoteOrderNo; + data['SubmitOn'] = this.submitOn; + data['ReceiptOn'] = this.receiptOn; + data['Remarks1'] = this.remarks1; + data['Remarks2'] = this.remarks2; + data['Status'] = this.status; + data['FeedbackStatusBy'] = this.feedbackStatusBy; + data['FeedbackStatus'] = this.feedbackStatus; + data['FeedbackStatusOn'] = this.feedbackStatusOn; + data['AuthorizerID'] = this.authorizerID; + data['ExpiryDate'] = this.expiryDate; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionRequestNo'] = this.admissionRequestNo; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['RowVer'] = this.rowVer; + data['IsAddlDiscApplied'] = this.isAddlDiscApplied; + data['InProgressReasonID'] = this.inProgressReasonID; + data['ExtendedBy'] = this.extendedBy; + data['ExtendedOn'] = this.extendedOn; + data['SubPolicyNo'] = this.subPolicyNo; + data['NoOrderAuthorizerID'] = this.noOrderAuthorizerID; + data['isVerbalApproval'] = this.isVerbalApproval; + data['SubStatus'] = this.subStatus; + data['IsNotificationSend'] = this.isNotificationSend; + data['EApprovalStatus'] = this.eApprovalStatus; + data['EApprovalRemarks'] = this.eApprovalRemarks; + data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval; + data['EAuthorizationID'] = this.eAuthorizationID; + if (this.apporvalDetails != null) { + data['ApporvalDetails'] = this.apporvalDetails.toJson; } + data['ApprovalStatusDescption'] = this.approvalStatusDescption; + data['ClinicName'] = this.clinicName; + data['ClinicNameN'] = this.clinicNameN; + data['CompanyName'] = this.companyName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['StrApprovalDate'] = this.strApprovalDate; + data['StrExpiryDate'] = this.strExpiryDate; + data['StrSubmitDate'] = this.strSubmitDate; + data['TotaUnUsedCount'] = this.totaUnUsedCount; + data['UnUsedCount'] = this.unUsedCount; + return data; + } +} + +class InsuranceApprovalDetails { + int setupID; + int projectID; + int approvalNo; + int lineItemNo; + int orderType; + int procedureID; + int toothNo; + int price; + int approvedAmount; + String unapprovedPatientShare; + int waivedAmount; + String discountType; + int discountValue; + String shareType; + String patientShareTypeValue; + String companyShareTypeValue; + String patientShare; + String companyShare; + int deductableAmount; + String disapprovedRemarks; + int progNoteOrderNo; + int progNoteLineItemNo; + String invoiceTransactionType; + int invoiceNo; + String procedureName; + String procedureNameN; + String status; + bool isInvoiced; + String isInvoicedDesc; + + InsuranceApprovalDetails( + {this.setupID, + this.projectID, + this.approvalNo, + this.lineItemNo, + this.orderType, + this.procedureID, + this.toothNo, + this.price, + this.approvedAmount, + this.unapprovedPatientShare, + this.waivedAmount, + this.discountType, + this.discountValue, + this.shareType, + this.patientShareTypeValue, + this.companyShareTypeValue, + this.patientShare, + this.companyShare, + this.deductableAmount, + this.disapprovedRemarks, + this.progNoteOrderNo, + this.progNoteLineItemNo, + this.invoiceTransactionType, + this.invoiceNo, + this.procedureName, + this.procedureNameN, + this.status, + this.isInvoiced, + this.isInvoicedDesc}); + + InsuranceApprovalDetails.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + approvalNo = json['ApprovalNo']; + lineItemNo = json['LineItemNo']; + orderType = json['OrderType']; + procedureID = json['ProcedureID']; + toothNo = json['ToothNo']; + price = json['Price']; + approvedAmount = json['ApprovedAmount']; + unapprovedPatientShare = json['UnapprovedPatientShare']; + waivedAmount = json['WaivedAmount']; + discountType = json['DiscountType']; + discountValue = json['DiscountValue']; + shareType = json['ShareType']; + patientShareTypeValue = json['PatientShareTypeValue']; + companyShareTypeValue = json['CompanyShareTypeValue']; + patientShare = json['PatientShare']; + companyShare = json['CompanyShare']; + deductableAmount = json['DeductableAmount']; + disapprovedRemarks = json['DisapprovedRemarks']; + progNoteOrderNo = json['ProgNoteOrderNo']; + progNoteLineItemNo = json['ProgNoteLineItemNo']; + invoiceTransactionType = json['InvoiceTransactionType']; + invoiceNo = json['InvoiceNo']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + status = json['Status']; + isInvoiced = json['IsInvoiced']; + isInvoicedDesc = json['IsInvoicedDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ApprovalNo'] = this.approvalNo; + data['LineItemNo'] = this.lineItemNo; + data['OrderType'] = this.orderType; + data['ProcedureID'] = this.procedureID; + data['ToothNo'] = this.toothNo; + data['Price'] = this.price; + data['ApprovedAmount'] = this.approvedAmount; + data['UnapprovedPatientShare'] = this.unapprovedPatientShare; + data['WaivedAmount'] = this.waivedAmount; + data['DiscountType'] = this.discountType; + data['DiscountValue'] = this.discountValue; + data['ShareType'] = this.shareType; + data['PatientShareTypeValue'] = this.patientShareTypeValue; + data['CompanyShareTypeValue'] = this.companyShareTypeValue; + data['PatientShare'] = this.patientShare; + data['CompanyShare'] = this.companyShare; + data['DeductableAmount'] = this.deductableAmount; + data['DisapprovedRemarks'] = this.disapprovedRemarks; + data['ProgNoteOrderNo'] = this.progNoteOrderNo; + data['ProgNoteLineItemNo'] = this.progNoteLineItemNo; + data['InvoiceTransactionType'] = this.invoiceTransactionType; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['Status'] = this.status; + data['IsInvoiced'] = this.isInvoiced; + data['IsInvoicedDesc'] = this.isInvoicedDesc; return data; } } diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 0b626342..6eb1f415 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart'; +import 'package:diplomaticquarterapp/core/model/insurance/ReauestInsuranceApprovalModel.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; @@ -25,8 +26,7 @@ class InsuranceCardService extends BaseService { List insuranceCardDetailsList = List(); bool isHaveInsuranceCard = false; - GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = - GetAllSharedRecordsByStatusResponse(); + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); clearInsuranceCard() { _cardList.clear(); @@ -36,19 +36,12 @@ class InsuranceCardService extends BaseService { _cardUpdated.clear(); } - - InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( - isDentalAllowedBackend: false, - patientTypeID: 1, - patientType: 1, - eXuldAPPNO: 0, - projectID: 0); + RequestInsuranceApprovalModel _requestInsuranceApprovalModel = RequestInsuranceApprovalModel(isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0); Future getInsurance() async { hasError = false; _cardList.clear(); - await baseAppClient.post(GET_PAtIENTS_INSURANCE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PAtIENTS_INSURANCE, onSuccess: (dynamic response, int statusCode) { response['List_PatientInsuranceCard'].forEach((item) { _cardList.add(InsuranceCardModel.fromJson(item)); }); @@ -60,10 +53,9 @@ class InsuranceCardService extends BaseService { Future getInsuranceUpdate() async { hasError = false; - _cardList.clear(); - await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, - onSuccess: (dynamic response, int statusCode) { - _cardUpdated.clear(); + _cardList.clear(); + await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, onSuccess: (dynamic response, int statusCode) { + _cardUpdated.clear(); response['List_PatientInsuranceCardHistory'].forEach((item) { _cardUpdated.add(InsuranceUpdateModel.fromJson(item)); }); @@ -77,17 +69,16 @@ class InsuranceCardService extends BaseService { hasError = false; // _cardList.clear(); if (appointmentNo != null) { - _insuranceApprovalModel.appointmentNo = appointmentNo; - _insuranceApprovalModel.eXuldAPPNO = null; - _insuranceApprovalModel.projectID = null; + // _requestInsuranceApprovalModel.appointmentNo = appointmentNo; + _requestInsuranceApprovalModel.eXuldAPPNO = null; + _requestInsuranceApprovalModel.projectID = null; } else { - _insuranceApprovalModel.appointmentNo = null; - _insuranceApprovalModel.eXuldAPPNO = 0; - _insuranceApprovalModel.projectID = 0; + // _requestInsuranceApprovalModel.appointmentNo = null; + _requestInsuranceApprovalModel.eXuldAPPNO = 0; + _requestInsuranceApprovalModel.projectID = 0; } - await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; @@ -97,14 +88,13 @@ class InsuranceCardService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _insuranceApprovalModel.toJson()); + }, body: _requestInsuranceApprovalModel.toJson()); } Future getFamilyFiles() async { var myFamily = await sharedPref.getObject(FAMILY_FILE); if (myFamily != null) { - getAllSharedRecordsByStatusResponse = - GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(myFamily); } else { getSharedRecordByStatus(); } @@ -115,68 +105,75 @@ class InsuranceCardService extends BaseService { dynamic localRes; var request = GetAllSharedRecordsByStatusReq(); request.status = 0; - await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { AppToast.showErrorToast(message: error); throw error; }, body: request.toJson()); sharedPref.setObject(FAMILY_FILE, localRes); - getAllSharedRecordsByStatusResponse = - GetAllSharedRecordsByStatusResponse.fromJson(localRes); + getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); } catch (error) { print(error); throw error; } } - Future getInsuranceDetails(data) async{ + + Future getInsuranceDetails(data) async { dynamic localRes; - await baseAppClient.post(INSURANCE_DETAILS, - onSuccess: (dynamic response, int statusCode) { - localRes = response['List_InsuranceCheckList']; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); + await baseAppClient.post( + INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + localRes = response['List_InsuranceCheckList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'CompanyID': data.companyID, 'SubCategoryID': data.subCategoryID}, + ); return Future.value(localRes); } - Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ + Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID, int patientID}) async { error = ""; hasError = false; insuranceCardDetails = null; isHaveInsuranceCard = false; - await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, - onSuccess: (dynamic response, int statusCode) { - insuranceCardDetailsList.clear(); - isHaveInsuranceCard = true; - response['List_PatientInsuranceDetails'].forEach((item) { - insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:{'SetupID': setupID,'ProjectID':projectID,'PatientIdentificationID':patientIdentificationID ,'isDentalAllowedBackend':false,'PatientID':patientID},); - + await baseAppClient.post( + GET_PATIENT_INSURANCE_DETAILS, + onSuccess: (dynamic response, int statusCode) { + insuranceCardDetailsList.clear(); + isHaveInsuranceCard = true; + response['List_PatientInsuranceDetails'].forEach((item) { + insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'SetupID': setupID, 'ProjectID': projectID, 'PatientIdentificationID': patientIdentificationID, 'isDentalAllowedBackend': false, 'PatientID': patientID}, + ); } - Future uploadInsuranceCard({ String patientIdentificationID,int patientID,String image=""}) async{ + Future uploadInsuranceCard({String patientIdentificationID, int patientID, String image = ""}) async { error = ""; - Map body = Map(); - body['PatientID']=patientID; - body['PatientType']=user.patientType; - body['MobileNo']=user.mobileNumber; - body['PatientIdentificationID']=patientIdentificationID; - body['InsuranceCardImage']= image; - - await baseAppClient.post(UPLOAD_INSURANCE_CARD, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body:body,); - + Map body = Map(); + body['PatientID'] = patientID; + body['PatientType'] = user.patientType; + body['MobileNo'] = user.mobileNumber; + body['PatientIdentificationID'] = patientIdentificationID; + body['InsuranceCardImage'] = image; + + await baseAppClient.post( + UPLOAD_INSURANCE_CARD, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 4acc7eaf..b8be6539 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -14,6 +14,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; +import 'package:manage_calendar_events/manage_calendar_events.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'Dialog/setting_page_radio_button_list_dialog.dart'; @@ -53,14 +54,14 @@ class _H2oSettingState extends State { void initState() { super.initState(); _userDetailModel = widget.userDetailModel; - _heightValue = _userDetailModel.height; - _weightValue = _userDetailModel.weight; + _heightValue = _userDetailModel?.height ?? 100; + _weightValue = _userDetailModel?.weight ?? 50; _heightController.text = _heightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0); _nameController.text = _userDetailModel.firstName; - _isWeightKG = _userDetailModel.isWeightInKG; - _isHeightCM = _userDetailModel.isHeightInCM; - _isGenderMale = _userDetailModel.gender == "M" ? true : false; + _isWeightKG = _userDetailModel?.isWeightInKG ?? true; + _isHeightCM = _userDetailModel?.isHeightInCM ?? true; + _isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false; _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB); _selectedActiveLevel = _userDetailModel.activityID ?? 1; readPrefs(); @@ -70,6 +71,7 @@ class _H2oSettingState extends State { void readPrefs() async { prefs = await SharedPreferences.getInstance(); _isUnitML = (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false; + _selectedRemindedTime = prefs.getInt(H2O_REMINDER) ?? 0; setState(() {}); } @@ -450,14 +452,35 @@ class _H2oSettingState extends State { _userDetailModel.dOB = tempDate; _userDetailModel.activityID = _selectedActiveLevel; GifLoaderDialogUtils.showMyDialog(context); - await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l"); - await widget.viewModel.updateUserDetail(_userDetailModel, (tag) { + await widget.viewModel.updateUserDetail(_userDetailModel, (tag) async { if (tag) { AppToast.showSuccessToast(message: TranslationBase.of(context).success); + await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l"); + int _tempRemindTime = prefs.getInt(H2O_REMINDER) ?? _selectedRemindedTime; + if (_tempRemindTime != _selectedRemindedTime) { + await prefs.setInt(H2O_REMINDER, _selectedRemindedTime); + _addReminderToCalender(_selectedRemindedTime); + } } GifLoaderDialogUtils.hideDialog(context); }); Navigator.pop(context); } + + final CalendarPlugin _myPlugin = CalendarPlugin(); + void _addReminderToCalender(int _selectedRemindedTime) async { + bool _calendarPermission = await _myPlugin.hasPermissions(); + if (_calendarPermission) { + } else { + await _myPlugin.requestPermissions(); + } + _myPlugin.hasPermissions().then((value) { + if (!value) { + _myPlugin.requestPermissions(); + } else { + _myPlugin.getCalendars().then((value) => {print(value.length)}); + } + }); + } } diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart index 82c390ea..19f06a56 100644 --- a/lib/pages/AlHabibMedicalService/parking_page.dart +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -8,7 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; - +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import '../../d_q_icons_icons.dart'; class ParkingPage extends StatelessWidget { @@ -19,6 +19,13 @@ class ParkingPage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).parking, + description: TranslationBase.of(context).parkingDescription, + imagesInfo: [ + ImagesInfo( + imageAr: 'assets/images/bc_parking.png', + imageEn: 'assets/images/bc_parking.png', + isAsset: true) + ], body: SingleChildScrollView( padding: EdgeInsets.all(12), child: !model.isSavePark diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 00fb2fc8..ff7224be 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -13,8 +13,10 @@ 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/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:nfc_in_flutter/nfc_in_flutter.dart'; class QRCode extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -30,17 +32,27 @@ class QRCode extends StatefulWidget { class _QRCodeState extends State { Uint8List _bytes; + bool _supportsNFC = false; + BuildContext _context; @override void initState() { // TODO: implement initState + _bytes = base64.decode(widget.appoQR.split(',').last); widget.authUser = new AuthenticatedUser(); + NFC.isNDEFSupported.then((supported) { + setState(() { + print("nfc supprted"); + _supportsNFC = true; + }); + }); super.initState(); } @override Widget build(BuildContext context) { + _context = context; return AppScaffold( appBarTitle: TranslationBase.of(context).attendRegisterCode, isShowAppBar: true, @@ -51,9 +63,56 @@ class _QRCodeState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - margin: EdgeInsets.only(top: 30.0), - alignment: Alignment.center, - child: Image.memory(_bytes, scale: 0.5), + width: double.infinity, + height: MediaQuery.of(context).size.width / 3, + child: Row( + children: [ + _supportsNFC + ? Expanded( + flex: 1, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + child: Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(10), + ), + child: Image.asset( + "assets/images/nfc/ic_nfc.png"), + ), + onTap: () { + showNfcReader(context, + onNcfScan: (String nfcId) { + Future.delayed( + const Duration(milliseconds: 100), + () { + sendNfcCheckInRequest(nfcId); + }); + }); + }, + ), + ], + ), + ) + : Container(), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only(top: 30.0), + alignment: Alignment.center, + child: Image.memory( + _bytes, + ), + ), + ), + ], + ), ), Container( margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), @@ -70,18 +129,20 @@ class _QRCodeState extends State { EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), child: Image.asset( "assets/images/new-design/device_icon.png", - width: 120.0, - height: 120.0), + width: MediaQuery.of(context).size.width / 3.4, + height: MediaQuery.of(context).size.width / 3.4), ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - margin: EdgeInsets.only( - top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, - style: TextStyle( - color: Colors.red[700], - fontSize: 20.0, - fontWeight: FontWeight.bold)), + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + color: Colors.red[700], + fontSize: 18.0, + fontWeight: FontWeight.bold)), + ), ), ], ), @@ -300,4 +361,51 @@ class _QRCodeState extends State { } return docSpeciality; } + + sendNfcCheckInRequest(String nfcId) { + GifLoaderDialogUtils.showMyDialog(context); + + DoctorsListService service = new DoctorsListService(); + + service + .sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, + widget.patientShareResponse.projectID, context) + .then((res) { + print(res); + + GifLoaderDialogUtils.hideDialog(context); + _showMyDialog(res["SuccessMsg"], this.context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + _showMyDialog(err, this.context); + }); + } + + Future _showMyDialog(String message, BuildContext context) async { + return showDialog( + context: context, + barrierDismissible: true, // user must tap button! + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Alert'), + content: SingleChildScrollView( + child: ListBody( + children: [ + Text(message), + ], + ), + ), + actions: [ + TextButton( + child: const Text('OK'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 79bcd94b..319221d5 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -92,6 +92,12 @@ class _ToDoState extends State { padding: EdgeInsets.all(0.0), itemCount: widget.appoList.length, itemBuilder: (context, index) { + print("ttt "+getNextActionImage(widget + .appoList[index] + .nextAction)); + print("ttt "+widget + .appoList[index] + .nextAction.toString()); return Container( margin: EdgeInsets.all(10.0), child: Column( @@ -459,6 +465,10 @@ class _ToDoState extends State { return "assets/images/new-design/waiting_for_doctor.png"; break; + case 90: + return "assets/images/new-design/check-in.png"; + break; + default: return ""; } @@ -480,6 +490,9 @@ class _ToDoState extends State { break; case 60: break; + case 90: + getAppoQR(context, appo); + break; } } @@ -516,6 +529,10 @@ class _ToDoState extends State { return TranslationBase.of(context).waitingForDoctor; break; + case 90: + return TranslationBase.of(context).checkinOptions; + break; + default: return ""; } diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index d81e704e..7283abf8 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -24,23 +24,13 @@ class _InsuranceApprovalState extends State { @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); + imagesInfo + .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); + imagesInfo + .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); return BaseView( - onModelReady: widget.appointmentNo != null - ? (model) => - model.getInsuranceApproval(appointmentNo: widget.appointmentNo) - : (model) => model.getInsuranceApproval(), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => - AppScaffold( + onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, @@ -65,153 +55,121 @@ class _InsuranceApprovalState extends State { children: [ Texts( TranslationBase.of(context).totalApproval, - color: Color(0xff60688B), - fontSize: 19.0, - fontWeight: FontWeight.w600, + color: Color(0xff60688B), + fontSize: 19.0, + fontWeight: FontWeight.w600, ), if (model.insuranceApproval.length > 0) Container( width: 60, height: 40, - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular(19.0)), + decoration: BoxDecoration(color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), child: Center( child: Texts( - model.insuranceApproval[0].unUsedCount - .toString(), - color: Colors.white, fontSize: 17.0, + model.insuranceApproval[0].unUsedCount.toString(), + color: Colors.white, + fontSize: 17.0, ), )) ], )), - ...List.generate( - model.insuranceApproval.length, - (index) => RoundedContainer( - backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - //height: 120.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - model.insuranceApproval[index].patientDescription == "In Patient" - ? Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: - BorderRadius.circular( - 16.0)), - width: 115.0, - padding: - EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).inPatient, - color: Colors.white, - ), - ), - ) - : Container( - decoration: BoxDecoration( - color: Color(0xff505A5D), - borderRadius: - BorderRadius.circular( - 16.0)), - width: 115.0, - padding: - EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).outpatient, - color: Colors.white, - ), - ), - ), - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0), - child: Texts( - model.insuranceApproval[index] - .clinicName, - fontSize: 20.0, - color: Color(0xff60686B), - fontWeight: FontWeight.w600, - ), + ...List.generate(model.insuranceApproval.length, (index) { + print(model.insuranceApproval[index].isLiveCareAppointment); + return RoundedContainer( + backgroundColor: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + //height: 120.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + model.insuranceApproval[index].isLiveCareAppointment + ? sideBadge(TranslationBase.of(context).liveCare, 0xffA9A089) + : model.insuranceApproval[index].isInOutPatient + ? sideBadge(TranslationBase.of(context).outpatient, 0xff505a5d) + : sideBadge(TranslationBase.of(context).inPatient, 0xffb8372c), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.0), + child: Texts( + model.insuranceApproval[index].clinicName, + fontSize: 20.0, + color: Color(0xff60686B), + fontWeight: FontWeight.w600, + ), + ), + Texts( + model.insuranceApproval[index].doctorName, + fontSize: 17.0, + ), + ], + ), + ), + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).approvalNo, + fontSize: 18.0, ), Texts( - model.insuranceApproval[index] - .doctorName, - fontSize: 17.0, + model.insuranceApproval[index].approvalNo.toString(), + fontSize: 18.0, + fontWeight: FontWeight.w600, ), ], ), - ), - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 12.0, horizontal: 12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context).approvalNo, - fontSize: 18.0, - ), - Texts(model.insuranceApproval[index].approvalNo.toString(), - fontSize: 18.0, - fontWeight: FontWeight.w600,), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).procedureStatus , - fontSize: 17.5, - ), - SizedBox(width: 12,), - Texts( - model.insuranceApproval[index].approvalStatusDescption, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).unusedCount, - fontSize: 17.5, - ), - Texts( - model.insuranceApproval[index].unUsedCount.toString(), - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).procedureStatus, + fontSize: 17.5, + ), + SizedBox( + width: 12, + ), + Texts( + model.insuranceApproval[index].approvalStatusDescption, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).unusedCount, + fontSize: 17.5, + ), + Texts( + model.insuranceApproval[index].unUsedCount.toString(), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), // Text( // 'Company Name: ' + // model.insuranceApproval[index] @@ -224,190 +182,131 @@ class _InsuranceApprovalState extends State { // fontSize: 17.5, // fontWeight: FontWeight.w600), // ), - Texts( - TranslationBase.of(context).companyName, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).receiptOn , - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - Texts( - convertDateFormat(model.insuranceApproval[index].rceiptOn), - fontSize: 17.5, - fontWeight: FontWeight.w600, + Texts( + TranslationBase.of(context).companyName, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), - ), - ], + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).receiptOn, + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + Texts( + convertDateFormat(model.insuranceApproval[index].receiptOn), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).expiryDate, + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + Texts( + convertDateFormat(model.insuranceApproval[index].expiryDate), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 55.0, + thickness: 1.2, + ), + IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of(context).procedureName), + Padding( + padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), + child: Text( + model.insuranceApproval[index].apporvalDetails?.procedureName ?? '', + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.5), + ), + ), + ], + ), ), - Divider( + VerticalDivider( + width: 10.0, + thickness: 1.2, color: Colors.black, - height: 25.0, - thickness: 1.0, ), - Row( - children: [ - Texts( - TranslationBase.of(context).expiryDate, - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - Texts( - convertDateFormat(model.insuranceApproval[index].expiryDate), - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - ], + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of(context).procedureStatus), + Padding( + padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), + child: Text( + model.insuranceApproval[index].apporvalDetails?.status ?? '', + style: TextStyle(fontSize: 17.5, fontWeight: FontWeight.w600), + ), + ), + ], + ), ), - Divider( - color: Colors.black, - height: 55.0, + VerticalDivider( + width: 2.3, thickness: 1.2, + color: Colors.black, ), - IntrinsicHeight( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.center, + Expanded( + flex: 1, + child: Column( children: [ - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .procedureName), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .procedureName, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 15.5), - ), - ), - ], - ), - ), - VerticalDivider( - width: 10.0, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .procedureStatus), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .status, - style: TextStyle( - fontSize: 17.5, - fontWeight: - FontWeight - .w600), - ), - ), - ], - ), - ), - VerticalDivider( - width: 2.3, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .usageStatus), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .isInvoicedDesc, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 17.5), - ), - ), - ], + Text(TranslationBase.of(context).usageStatus), + Padding( + padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0), + child: Text( + model.insuranceApproval[index].apporvalDetails?.isInvoicedDesc ?? '', + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 17.5), ), ), ], ), ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), ], ), ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), ], ), - ], - ), - )), + ), + ], + ), + ], + ), + ); + }), ], ), ), @@ -416,6 +315,22 @@ class _InsuranceApprovalState extends State { ); } + Widget sideBadge(String title, int color) { + return Container( + decoration: BoxDecoration( + color: Color(color), + borderRadius: BorderRadius.circular(16.0), + ), + width: 115.0, + padding: EdgeInsets.only(top: 1, bottom: 1), + alignment: Alignment.center, + child: Texts( + title, + color: Colors.white, + ), + ); + } + convertDateFormat(String Date) { const start = "/Date("; const end = "+0300)"; @@ -423,13 +338,8 @@ class _InsuranceApprovalState extends State { final startIndex = Date.indexOf(start); final endIndex = Date.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(Date.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0'); return newDate.toString(); } diff --git a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart index 5bc9618d..a6fc5fef 100644 --- a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart +++ b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart @@ -49,7 +49,8 @@ class ActiveMedicationsPage extends StatelessWidget { height: 5, ), Texts( - TranslationBase.of(context).expDate+' :' + + TranslationBase.of(context).expDate + + ' :' + DateUtil.getDayMonthYearDateFormatted(model .activePrescriptionReport[index].orderDate), ), @@ -57,21 +58,24 @@ class ActiveMedicationsPage extends StatelessWidget { height: 5, ), Texts( - TranslationBase.of(context).route+ ' :' + + TranslationBase.of(context).route + + ' :' + model.activePrescriptionReport[index].route, ), SizedBox( height: 5, ), Texts( - TranslationBase.of(context).frequency+ ' :' + + TranslationBase.of(context).frequency + + ' :' + model.activePrescriptionReport[index].frequency, ), SizedBox( height: 5, ), Texts( - TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', + TranslationBase.of(context).dailyQuantity + + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', ), ], ), @@ -86,16 +90,20 @@ class ActiveMedicationsPage extends StatelessWidget { color: Colors.red, size: 28, ), - SizedBox(height: 25,), + SizedBox( + height: 25, + ), InkWell( - onTap: (){ + onTap: () { Navigator.push( context, FadePage( page: ReminderPage( - frequency: model.activePrescriptionReport[index] + frequency: model + .activePrescriptionReport[index] .frequencyNumber, - days: model.activePrescriptionReport[index].days, + days: model + .activePrescriptionReport[index].days, itemDescription: model .activePrescriptionReport[index] .itemDescription, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 65fe2b04..c894c84c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1445,4 +1445,24 @@ class DoctorsListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future sendCheckinNfcRequest( + int appointmentNo, String nfcCode,int projectId, BuildContext context) async { + Map request; + + Request req = appGlobal.getPublicRequest(); + request = { + "AppointmentNo":appointmentNo, + "NFC_Code": nfcCode, + "ProjectID": projectId, + }; + dynamic localRes; + await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 43fdc456..3ad128d4 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -117,8 +117,8 @@ class AuthProvider with ChangeNotifier { var imei = await sharedPref.getString(PUSH_TOKEN); // if (!request.) { newRequest.iMEI = imei; //imei!=null ? imei : ''; - newRequest.firstName = request.firstName + " " + request.lastName; - newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; + newRequest.firstName = request.firstName??"" + " " + request.lastName??""; + newRequest.firstNameN = request.firstNameN??"" + " " + request.lastNameN??""; newRequest.lastNameN = request.lastNameN ?? ""; newRequest.outSA = request.outSA == 1 ? true : false; newRequest.biometricEnabled = false; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5a586814..a315e714 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -471,6 +471,8 @@ class TranslationBase { String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode]; + String get parkingDescription => localizedValues['parkingDescription'][locale.languageCode]; + String get checkinOptions => localizedValues['checkinOption'][locale.languageCode]; String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode]; String get parkingTitle => diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 94b23b05..e081d5db 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -209,49 +209,44 @@ class Utils { bool isLogin, count}) { List medical = List(); - if (projectViewModel.havePrivilege(5)) { - medical.add(InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: MyAppointments(), - ), - ); - }, - child: isLogin - ? Stack(children: [ - MedicalProfileItem( + + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(5) + ? Navigator.push(context, FadePage(page: MyAppointments())) + : null, + child: isLogin + ? Stack(children: [ + MedicalProfileItem( title: TranslationBase.of(context).myAppointments, imagePath: 'my_appointment_icon.png', subTitle: TranslationBase.of(context).myAppointmentsList, hasBadge: true, - ), - Positioned( - right: 0.0, - child: Badge( - toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), - style: - TextStyle(color: Colors.white, fontSize: 16.0)), - ), + isEnable: projectViewModel.havePrivilege(5)), + Positioned( + right: 0.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), + style: TextStyle(color: Colors.white, fontSize: 16.0)), ), ), - ]) - : MedicalProfileItem( - title: TranslationBase.of(context).myAppointments, - imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context).myAppointmentsList, - hasBadge: true, ), - )); - } + ]) + : MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel.havePrivilege(5), + ), + )); + if (projectViewModel.havePrivilege(10)) { medical.add(InkWell( onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), @@ -263,106 +258,97 @@ class Utils { )); } - if (projectViewModel.havePrivilege(7)) { - medical.add(InkWell( - onTap: () => - Navigator.push(context, FadePage(page: RadiologyHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology_icon.png', - subTitle: TranslationBase.of(context).radiologySubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(7) + ? Navigator.push(context, FadePage(page: RadiologyHomePage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology_icon.png', + subTitle: TranslationBase.of(context).radiologySubtitle, + isEnable: projectViewModel.havePrivilege(7), + ), + )); - if (projectViewModel.havePrivilege(12)) { - medical.add(InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomePrescriptionsPage(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, - imagePath: 'prescription_icon.png', - subTitle: TranslationBase.of(context).medicinesSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(12) + ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).medicines, + imagePath: 'prescription_icon.png', + subTitle: TranslationBase.of(context).medicinesSubtitle, + isEnable: projectViewModel.havePrivilege(12), + ), + )); - if (projectViewModel.havePrivilege(25)) { - medical.add(InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: VitalSignDetailsScreen(), - ), - ), - child: MedicalProfileItem( - title: TranslationBase.of(context).vitalSigns, - imagePath: 'vital_signs.png', - subTitle: TranslationBase.of(context).vitalSignsSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(25) + ? Navigator.push( + context, + FadePage(page: VitalSignDetailsScreen()), + ) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).vitalSigns, + imagePath: 'vital_signs.png', + subTitle: TranslationBase.of(context).vitalSignsSubtitle, + isEnable: projectViewModel.havePrivilege(25), + ), + )); - //if (projectViewModel.havePrivilege(48)) { medical.add(InkWell( - onTap: () => - Navigator.push(context, FadePage(page: ActiveMedicationsPage())), + onTap: () => projectViewModel.havePrivilege(48) + ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) + : null, child: MedicalProfileItem( title: TranslationBase.of(context).myMedical, imagePath: 'active_medications.png', subTitle: TranslationBase.of(context).myMedicalSubtitle, + isEnable: false, ), )); - //} - if (projectViewModel.havePrivilege(6)) { - medical.add(InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ); - }, - child: MedicalProfileItem( + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(6) + ? Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ) + : null, + child: MedicalProfileItem( title: TranslationBase.of(context).myDoctor, imagePath: 'doctor_icon.png', subTitle: TranslationBase.of(context).myDoctorSubtitle, - ), - )); - } + isEnable: projectViewModel.havePrivilege(6)), + )); + + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(14) + ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).eye, + imagePath: 'eye_measurement_icon.png', + subTitle: TranslationBase.of(context).eyeSubtitle, + isEnable: projectViewModel.havePrivilege(14), + ), + )); + + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(22) + ? Navigator.push(context, FadePage(page: InsuranceCard())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).insurance, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).insuranceSubtitle, + isEnable: projectViewModel.havePrivilege(22), + ), + )); - if (projectViewModel.havePrivilege(14)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: EyeMeasurementsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).eye, - imagePath: 'eye_measurement_icon.png', - subTitle: TranslationBase.of(context).eyeSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(22)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceCard())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).insurance, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).insuranceSubtitle, - ), - )); - } medical.add(InkWell( onTap: () { Navigator.push(context, FadePage(page: InsuranceUpdate())); @@ -374,137 +360,132 @@ class Utils { ), )); - if (projectViewModel.havePrivilege(18)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceApproval())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).insuranceApproval, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(18) + ? Navigator.push(context, FadePage(page: InsuranceApproval())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).insuranceApproval, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, + isEnable: projectViewModel.havePrivilege(18), + ), + )); - if (projectViewModel.havePrivilege(23)) { - medical.add(InkWell( - onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).allergies, - imagePath: 'my_allergies_icon.png', - subTitle: TranslationBase.of(context).allergiesSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(23) + ? Navigator.push(context, FadePage(page: AllergiesPage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).allergies, + imagePath: 'my_allergies_icon.png', + subTitle: TranslationBase.of(context).allergiesSubtitle, + isEnable: projectViewModel.havePrivilege(23), + ), + )); - if (projectViewModel.havePrivilege(26)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyVaccines())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myVaccines, - imagePath: 'my_vaccines_icon.png', - subTitle: TranslationBase.of(context).myVaccinesSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(20)) - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: HomeReportPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).medical, - imagePath: 'medical_reports_icon.png', - subTitle: TranslationBase.of(context).medicalSubtitle, - ), - )); + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(26) + ? Navigator.push(context, FadePage(page: MyVaccines())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).myVaccines, + imagePath: 'my_vaccines_icon.png', + subTitle: TranslationBase.of(context).myVaccinesSubtitle, + isEnable: projectViewModel.havePrivilege(26), + ), + )); - if (projectViewModel.havePrivilege(19)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MonthlyReportsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, - imagePath: 'monthly_reports_icon.png', - subTitle: TranslationBase.of(context).monthlySubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(20) + ? Navigator.push(context, FadePage(page: HomeReportPage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).medical, + imagePath: 'medical_reports_icon.png', + subTitle: TranslationBase.of(context).medicalSubtitle, + isEnable: projectViewModel.havePrivilege(20), + ), + )); - if (projectViewModel.havePrivilege(16)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: PatientSickLeavePage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).sick, - imagePath: 'sick_leaves_icons.png', - subTitle: TranslationBase.of(context).sickSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(19) + ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).monthly, + imagePath: 'monthly_reports_icon.png', + subTitle: TranslationBase.of(context).monthlySubtitle, + isEnable: projectViewModel.havePrivilege(19), + ), + )); - if (projectViewModel.havePrivilege(47)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyBalancePage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myBalance, - imagePath: 'check-in.png', - subTitle: TranslationBase.of(context).myBalanceSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(16) + ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).sick, + imagePath: 'sick_leaves_icons.png', + subTitle: TranslationBase.of(context).sickSubtitle, + isEnable: projectViewModel.havePrivilege(16), + ), + )); - if (projectViewModel.havePrivilege(61)) { - medical.add(MedicalProfileItem( - title: TranslationBase.of(context).patientCall, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context).patientCallSubtitle, - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(47) + ? Navigator.push(context, FadePage(page: MyBalancePage())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).myBalance, + imagePath: 'check-in.png', + subTitle: TranslationBase.of(context).myBalanceSubtitle, + isEnable: projectViewModel.havePrivilege(47), + ), + )); - if (projectViewModel.havePrivilege(24)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyTrackers())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myTrackers, - imagePath: 'my_tracker_icon.png', - subTitle: TranslationBase.of(context).myTrackersSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(30)) - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: SmartWatchInstructions())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).smartWatches, - imagePath: 'smartwatch_icon.png', - subTitle: TranslationBase.of(context).smartWatchesSubtitle, - ), - )); + medical.add(MedicalProfileItem( + title: TranslationBase.of(context).patientCall, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context).patientCallSubtitle, + isEnable: projectViewModel.havePrivilege(61), + )); - if (projectViewModel.havePrivilege(28)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AskDoctorHomPage())); - }, - child: MedicalProfileItem( + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(24) + ? Navigator.push(context, FadePage(page: MyTrackers())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).myTrackers, + imagePath: 'my_tracker_icon.png', + subTitle: TranslationBase.of(context).myTrackersSubtitle, + isEnable: projectViewModel.havePrivilege(24), + ), + )); + + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(30) + ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).smartWatches, + imagePath: 'smartwatch_icon.png', + subTitle: TranslationBase.of(context).smartWatchesSubtitle, + isEnable: projectViewModel.havePrivilege(30), + ), + )); + + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(28) + ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) + : null, + child: MedicalProfileItem( title: TranslationBase.of(context).askYour, imagePath: 'ask_doctor_icon.png', subTitle: TranslationBase.of(context).askYourSubtitle, - ), - )); - } + isEnable: projectViewModel.havePrivilege(28)), + )); + if (projectViewModel.havePrivilege(32) || true) { medical.add(InkWell( onTap: () { @@ -536,18 +517,17 @@ class Utils { )); } - if (projectViewModel.havePrivilege(40)) { - medical.add(InkWell( - onTap: () { - launch('whatsapp://send?phone=18885521858&text='); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).chatbot, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).chatbotSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(40) + ? launch('whatsapp://send?phone=18885521858&text=') + : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).chatbot, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).chatbotSubtitle, + isEnable: projectViewModel.havePrivilege(40), + ), + )); return medical; } diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 09306441..7b49559c 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -103,7 +103,7 @@ class _LaboratoryResultWidgetState extends State { color: Colors.white, ), Texts( - TranslationBase.of(context).sendCopy, + TranslationBase.of(context).sendEmail, color: Colors.white, ) ], diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index c7e47dd9..bbc92db1 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -8,16 +8,19 @@ import '../../../Constants.dart'; import '../text.dart'; class MedicalProfileItem extends StatelessWidget { - MedicalProfileItem( - {@required this.imagePath, - @required this.title, - @required this.subTitle, - hasBadge}); - final String imagePath; final String title; final String subTitle; final bool hasBadge = false; + bool isEnable; + + MedicalProfileItem({ + @required this.imagePath, + @required this.title, + @required this.subTitle, + hasBadge, + this.isEnable = true, + }); @override Widget build(BuildContext context) { @@ -26,27 +29,48 @@ class MedicalProfileItem extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.14, margin: EdgeInsets.all(5), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white - ), - padding: EdgeInsets.all(10), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(title, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: secondaryColor, - fontWeight: FontWeight.bold), - Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,), - Align( - alignment:projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, - child: Image.asset( - "assets/images/medical/$imagePath", - height: SizeConfig.heightMultiplier * 5, - width: SizeConfig.heightMultiplier * 5, + borderRadius: BorderRadius.circular(10), color: Colors.white), + clipBehavior: Clip.antiAlias, + child: Stack( + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(title, + fontSize: 1.5 * SizeConfig.textMultiplier, + color: secondaryColor, + fontWeight: FontWeight.bold), + Texts( + subTitle, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + child: Image.asset( + "assets/images/medical/$imagePath", + height: SizeConfig.heightMultiplier * 5, + width: SizeConfig.heightMultiplier * 5, + ), + ) + ], ), - ) + ), + isEnable + ? Container() + : Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) ], ), ); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 63509b7c..946876a7 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -21,17 +21,17 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - // static String SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + + // static String PREAUTH_SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart new file mode 100644 index 00000000..067c0c9a --- /dev/null +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -0,0 +1,196 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:nfc_in_flutter/nfc_in_flutter.dart'; + +void showNfcReader(BuildContext context, {Function onNcfScan}) { + showModalBottomSheet( + context: context, + enableDrag: false, + isDismissible: false, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(12), topRight: Radius.circular(12)), + ), + backgroundColor: Colors.white, + builder: (context) { + return NfcLayout( + onNcfScan: onNcfScan, + ); + }); +} + +class NfcLayout extends StatefulWidget { + Function onNcfScan; + + NfcLayout({this.onNcfScan}); + + @override + _NfcLayoutState createState() => _NfcLayoutState(); +} + +class _NfcLayoutState extends State { + StreamSubscription _stream; + bool _reading = false; + Widget mainWidget; + String nfcId; + + @override + void initState() { + super.initState(); + + setState(() { + // _reading = true; + // Start reading using NFC.readNDEF() + _stream = NFC + .readNDEF( + once: false, + throwOnUserCancel: false, + readerMode: NFCDispatchReaderMode()) + .listen((NDEFMessage message) { + setState(() { + _reading = true; + mainWidget = doneNfc(); + }); + Future.delayed(const Duration(milliseconds: 500), () { + _stream?.cancel(); + widget.onNcfScan(nfcId); + Navigator.pop(context); + }); + print("read NDEF id: ${message.id}"); + // widget.onNcfScan(message.id); + nfcId = message.id; + }, onError: (e) { + // Check error handling guide below + }); + }); + } + + @override + Widget build(BuildContext context) { + (mainWidget == null && !_reading) + ? mainWidget = scanNfc() + : mainWidget = doneNfc(); + return AnimatedSwitcher( + duration: Duration(milliseconds: 500), child: mainWidget); + } + + Widget scanNfc() { + return Container( + key: ValueKey(1), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + height: 30, + ), + Text( + "Ready To Scan", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 24, + ), + ), + SizedBox( + height: 30, + ), + Image.asset( + "assets/images/nfc/ic_nfc.png", + height: MediaQuery.of(context).size.width / 3, + ), + SizedBox( + height: 30, + ), + Text( + "Approach an NFC Tag", + style: TextStyle( + fontSize: 18, + ), + ), + SizedBox( + height: 30, + ), + ButtonTheme( + minWidth: MediaQuery.of(context).size.width / 1.2, + height: 45.0, + buttonColor: Colors.grey[300], + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + child: RaisedButton( + onPressed: () { + _stream?.cancel(); + Navigator.pop(context); + }, + child: Text("CANCEL"), + ), + ), + SizedBox( + height: 30, + ), + ], + ), + ); + } + + Widget doneNfc() { + return Container( + key: ValueKey(2), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + height: 30, + ), + Text( + "Successfully Scanned", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 24, + ), + ), + SizedBox( + height: 30, + ), + Image.asset( + "assets/images/nfc/ic_done.png", + height: MediaQuery.of(context).size.width / 3, + ), + SizedBox( + height: 30, + ), + Text( + "Approach an NFC Tag", + style: TextStyle( + fontSize: 18, + ), + ), + SizedBox( + height: 30, + ), + ButtonTheme( + minWidth: MediaQuery.of(context).size.width / 1.2, + height: 45.0, + buttonColor: Colors.grey[300], + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + child: RaisedButton( + // onPressed: () { + // _stream?.cancel(); + // widget.onNcfScan(nfcId); + // Navigator.pop(context); + // }, + onPressed: null, + + child: Text("DONE"), + ), + ), + SizedBox( + height: 30, + ), + ], + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index c86b4a59..c109bd0a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -171,6 +171,7 @@ dependencies: wifi: ^0.1.5 vibration: ^1.7.3 + nfc_in_flutter: ^2.0.5 speech_to_text: path: speech_to_text @@ -220,6 +221,7 @@ flutter: - assets/images/gif/ - assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/lakum/ + - assets/images/nfc/ fonts: