diff --git a/android/build.gradle b/android/build.gradle index e2e8a05f..8e56476b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..5660070d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Thu Sep 03 16:26:30 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/assets/images/report.jpg b/assets/images/report.jpg new file mode 100644 index 00000000..5846cd53 Binary files /dev/null and b/assets/images/report.jpg differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c1c5e34c..5ba52820 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -356,7 +356,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -433,7 +432,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -489,7 +487,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; diff --git a/lib/config/config.dart b/lib/config/config.dart index f3b05b6a..0165cb1b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -28,8 +28,8 @@ const GET_PRESCRIPTION_REPORT_ENH = ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; @@ -43,7 +43,8 @@ const SEND_RAD_REPORT_EMAIL = const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; const GET_PATIENT_AppointmentHistory = - 'Services/Doctors.svc/REST/PateintHasAppoimentHistory'; + 'Services' + '/Doctors.svc/REST/PateintHasAppoimentHistory'; ///VITAL SIGN const GET_PATIENT_VITAL_SIGN = @@ -75,6 +76,9 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; //URL to get doctors list const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; +//URL to dental doctors list +const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; + //URL to get doctor free slots const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; @@ -150,7 +154,7 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; const VERSION_ID = 5.6; const SETUP_ID = '91877'; -const LANGUAGE = 1; +const LANGUAGE = 2; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; const IS_DENTAL_ALLOWED_BACKEND = false; @@ -165,6 +169,8 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; +const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; +const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0ce36f70..192226c7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -365,13 +365,6 @@ const Map> localizedValues = { "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "ar": "السجلات"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, - "locationDialogMessage": { - "en": - "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", - "ar": - "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." - }, "parking": {"en": "Parking", "ar": "مواقف"}, "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, "parkingTitle": { @@ -388,6 +381,14 @@ const Map> localizedValues = { "building": {"en": "Building:", "ar": "المبنى"}, "branch": {"en": "Branch:", "ar": "الفرع"}, "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, + "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, + "locationDialogMessage": { + "en": + "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", + "ar": + "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." + }, + "user-view-requester": { "en": "User Wants To View Your Medical File", "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي" @@ -396,4 +397,73 @@ const Map> localizedValues = { "en": "User Can View Your Medical File", "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي" }, + "MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"}, + "NoBookedAppointments": { + "en": "No Booked Appointments", + "ar": "لا توجد مواعيد محجوزة" + }, + "NoConfirmedAppointments": { + "en": "No Confirmed Appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "noArrivedAppointments": { + "en": "No Arrived Appointments", + "ar": "لم تصل المواعيد" + }, + "MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"}, + "Radiology": {"en": "Radiology", "ar": "الأشعة"}, + "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, + "Lab": {"en": "Lab", "ar": "تحليل المختبر"}, + "LabSubtitle": {"en": "Result", "ar": "نتائج"}, + "Medicines": {"en": "Medicines", "ar": "الوصفات"}, + "MedicinesSubtitle": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "VitalSigns": {"en": "Vital Signs", "ar": "المؤشرات الحيوية"}, + "VitalSignsSubTitle": {"en": "Reports", "ar": "قراءات"}, + "MyMedical": {"en": "Active", "ar": "قراءات"}, + "MyMedicalSubtitle": {"en": "Medications", "ar": "النشطة"}, + "MyDoctor": {"en": "My Doctor", "ar": "اطبائي"}, + "MyDoctorSubtitle": {"en": "List", "ar": "قمت بزيارتهم"}, + "Eye": {"en": "Eye", "ar": "قياسات"}, + "EyeSubtitle": {"en": "Measurement", "ar": "النظر"}, + "Insurance": {"en": "Insurance", "ar": "بطاقة"}, + "InsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, + "UpdateInsurance": {"en": "Update Insurance", "ar": "تحديث التأمين"}, + "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, + "InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"}, + "InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"}, + "Allergies": {"en": "Approvals", "ar": "الحساسية"}, + "AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"}, + "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, + "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, + "Medical": {"en": "Medical", "ar": "التقارير"}, + "MedicalSubtitle": {"Report": "List", "ar": "الطبية"}, + "Monthly": {"en": "Monthly", "ar": "تقارير"}, + "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, + "Sick": {"en": "Sick", "ar": "الإجازات"}, + "SickSubtitle": {"en": "Leaves", "ar": "المرضية"}, + "MyBalance": {"en": "My Balance", "ar": "ارصدتي"}, + "MyBalanceSubtitle": {"en": "Credit", "ar": "المبالغ"}, + "PatientCall": {"en": "Patient Call", "ar": "النداء للموعد"}, + "PatientCallSubtitle": {"en": "Service", "ar": "خدمة"}, + "SmartWatches": {"en": "Smart Watches", "ar": "الساعة الذكية"}, + "SmartWatchesSubtitle": {"en": "Pairing", "ar": "ربط البيانات"}, + "MyTrackers": {"en": "My Trackers", "ar": "تتبع قراءاتي"}, + "MyTrackersSubtitle": {"en": "Service", "ar": "الطبية"}, + "AskYour": {"en": "Ask Your", "ar": "إرسل طبيبك"}, + "AskYourSubtitle": {"en": "Doctor", "ar": "خدمة"}, + "Internet": {"en": "Internet", "ar": "الاتصال"}, + "InternetSubtitle": {"en": "Pairing", "ar": "بالإنترنت"}, + "Chatbot": {"en": "Chatbot", "ar": "تاشت بوت"}, + "ChatbotSubtitle": {"en": "", "ar": ""}, + "TimeLine": {"en": "Time Line", "ar": "الجدول الزمني"}, + "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, + "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, + "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "History": {"en": "History", "ar": "السجل"}, + "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, + "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, + "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, + "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, + + "km": {"en": "KMs:", "ar": "كم"}, }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart new file mode 100644 index 00000000..23b3363d --- /dev/null +++ b/lib/core/model/labs/lab_result.dart @@ -0,0 +1,88 @@ +class LabResult { + String description; + Null femaleInterpretativeData; + int gender; + int lineItemNo; + Null maleInterpretativeData; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + Null superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + Null verifiedOnDateTime; + + LabResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/model/vaccine/my_vaccine.dart b/lib/core/model/vaccine/my_vaccine.dart new file mode 100644 index 00000000..ac6e2e19 --- /dev/null +++ b/lib/core/model/vaccine/my_vaccine.dart @@ -0,0 +1,91 @@ +class VaccineModel { + String to; + String from; + 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; + String invoiceDate; + String doctorImageURL; + String doctorName; + String doctorTitle; + String projectName; + String vaccineName; + + VaccineModel({ + this.to, + this.from, + 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.invoiceDate, + this.doctorImageURL, + this.doctorName, + this.doctorTitle, + this.projectName, + this.vaccineName, + }); + + VaccineModel.fromJson(Map json) { + vaccineName = json['VaccineName']; + projectName = json['ProjectName']; + doctorTitle = json['DoctorTitle']; + doctorName = json['DoctorName']; + doctorImageURL = json['DoctorImageURL']; + invoiceDate = json['InvoiceDate']; + to = json['To']; + from = json['From']; + 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']; + } + + Map toJson() { + final Map data = new Map(); + data['To'] = this.to; + data['From'] = this.from; + 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['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f45fe22b..e80d1e83 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,14 +2,11 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import '../../../locator.dart'; import '../../../routes.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); @@ -33,12 +30,12 @@ class BaseAppClient { var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); var user = await sharedPref.getObject(USER_PROFILE); - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID - : SETUP_ID; - body['VersionID'] = body.containsKey('VersionID') - ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID - : VERSION_ID; + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID + : SETUP_ID; + } + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['IPAdress'] = IP_ADDRESS; @@ -46,16 +43,29 @@ class BaseAppClient { body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA : PATIENT_OUT_SA; - body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; + + // if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + // } + body['DeviceTypeID'] = DeviceTypeID; - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; + + // if (body.containsKey('PatientType')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; + // } + + // if (body.containsKey('PatientTypeID')) { + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; + // } + if (user != null) { body['TokenID'] = token; body['PatientID'] = diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 8850e953..7fee6615 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,8 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.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.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class InsuranceCardService extends BaseService { List _cardList = List(); @@ -15,6 +20,9 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + clearInsuranceCard() { _cardList.clear(); } @@ -101,7 +109,7 @@ class InsuranceCardService extends BaseService { Future getInsuranceApproval({int appointmentNo}) async { hasError = false; // _cardList.clear(); - if(appointmentNo != null) { + if (appointmentNo != null) { _insuranceApprovalModel.appointmentNo = appointmentNo; _insuranceApprovalModel.eXuldAPPNO = null; _insuranceApprovalModel.projectID = null; @@ -124,4 +132,35 @@ class InsuranceCardService extends BaseService { super.error = error; }, body: _insuranceApprovalModel.toJson()); } + + Future getFamilyFiles() async { + var myFamily = await sharedPref.getObject(FAMILY_FILE); + if (myFamily != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + } else { + getSharedRecordByStatus(); + } + } + + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + 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); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 98f8110e..c1ad65f3 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart'; @@ -28,6 +29,7 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); + List labResultList = List(); Future getLaboratoryResult( {String projectID, @@ -52,6 +54,27 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } + Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['Procedure'] = "U/A"; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + //TODO Check the res + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index 349d7ace..4df3ce8a 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -1,15 +1,16 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; -import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_appointmentt.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; class MyDoctorService extends BaseService { - List patientDoctorAppointmentList = List(); + List patientDoctorAppointmentList = List(); DoctorProfile doctorProfile; + DoctorList doctorList; DoctorRating doctorRating = DoctorRating(); RequestPatientDoctorAppointment patientDoctorAppointmentRequest = @@ -49,7 +50,7 @@ class MyDoctorService extends BaseService { patientDoctorAppointmentList.clear(); response['PatientDoctorAppointmentResultList'].forEach((hospital) { patientDoctorAppointmentList - .add(PatientDoctorAppointment.fromJson(hospital)); + .add(DoctorList.fromJson(hospital)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -58,7 +59,6 @@ class MyDoctorService extends BaseService { } RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile( - doctorID: 2477, license: true, isRegistered: true, projectID: 12, @@ -79,11 +79,18 @@ class MyDoctorService extends BaseService { ///GET DOCTOR PROFILE _requestDoctorProfile.doctorID = doctorId; _requestDoctorProfile.clinicID = clinicID; - _requestDoctorProfile.patientID = projectID; + _requestDoctorProfile.projectID = projectID; hasError = false; await baseAppClient.post(GET_DOCTOR_PROFILE, onSuccess: (dynamic response, int statusCode) { doctorProfile = DoctorProfile.fromJson(response['DoctorProfileList'][0]); + doctorList = DoctorList.fromJson(response['DoctorProfileList'][0]); + doctorList.clinicName = doctorProfile.clinicDescription; + doctorList.doctorTitle = doctorProfile.doctorTitleForProfile; + doctorList.name = doctorProfile.doctorName; + doctorList.projectName = doctorProfile.projectName; + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/reports_monthly_service.dart b/lib/core/service/medical/reports_monthly_service.dart new file mode 100644 index 00000000..5e643669 --- /dev/null +++ b/lib/core/service/medical/reports_monthly_service.dart @@ -0,0 +1,83 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; + +class ReportsMonthlyService extends BaseService { + List reportsList = List(); + List appointHistoryList = List(); + + RequestReports _requestReports = RequestReports( + isReport: true, + encounterType: 1, + requestType: 1, + versionID: 5.5, + channel: 3, + languageID: 2, + iPAdress: "10.20.10.20", + generalid: 'Cs2020@2016\$2958', + patientOutSA: 0, + sessionID: 'KIbLoqkytuKJEWECHQ', + isDentalAllowedBackend: false, + deviceTypeID: 2, + patientID: 1231755, + tokenID: '@dm!n', + patientTypeID: 1, + patientType: 1); + + Future getReports() async { + hasError = false; + await baseAppClient.post(REPORTS, + onSuccess: (dynamic response, int statusCode) { + reportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + reportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReports.toJson()); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsForMedicalReport'] = true; + await baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertRequestForMedicalReport( + AppointmentHistory appointmentHistory) async { + Map body = new Map(); + body['ClinicID'] = appointmentHistory.clinicID; + body['DoctorID'] = appointmentHistory.doctorID; + body['SetupID'] = appointmentHistory.setupID; + body['EncounterNo'] = appointmentHistory.appointmentNo; + body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['IsActive'] = appointmentHistory.isActiveDoctor; + body['ProjectID'] = appointmentHistory.projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 1; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart new file mode 100644 index 00000000..189e26d8 --- /dev/null +++ b/lib/core/service/vaccine_service.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; + +class VaccineService extends BaseService { + List _vaccineList = List(); + + List get vaccineList => _vaccineList; + + VaccineModel _vaccineModel = VaccineModel( + to: "0", + from: "0", + channel: 3, + deviceTypeID: 2, + generalid: "Cs2020@2016\$2958", + iPAdress: "10.20.10.20", + isDentalAllowedBackend: false, + languageID: 2, + patientID: 1231755, + patientOutSA: 0, + patientType: 1, + patientTypeID: 1, + sessionID: "uoKFXSLUwEaHYPwKZNA", + tokenID: "@dm!n", + versionID: 5.5, + ); + + Future getMyVaccine() async { + hasError = false; + _vaccineList.clear(); + await baseAppClient.post(GET_VACCINES, + onSuccess: (dynamic response, int statusCode) { + response['List_DoneVaccines'].forEach((item) { + _vaccineList.add(VaccineModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _vaccineModel.toJson()); + } + + Future sendEmail() async {} +} diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index a6975360..e99a53f6 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dar import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -20,6 +21,9 @@ class InsuranceViewModel extends BaseViewModel { List get insuranceApproval => _insuranceCardService.insuranceApproval; + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _insuranceCardService.getAllSharedRecordsByStatusResponse; + Future getInsurance() async { hasError = false; _insuranceCardService.clearInsuranceCard(); @@ -41,7 +45,7 @@ class InsuranceViewModel extends BaseViewModel { error = _insuranceCardService.error; setState(ViewState.ErrorLocal); } else - setState(ViewState.Idle); + getFamilyFiles(); } Future getInsuranceApproval({int appointmentNo}) async { @@ -59,4 +63,13 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getFamilyFiles() async { + await _insuranceCardService.getFamilyFiles(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 1efdfb7c..032aeb1e 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,6 +1,6 @@ - import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; @@ -78,13 +78,32 @@ class LabsViewModel extends BaseViewModel { List get patientLabSpecialResult => _labsService.patientLabSpecialResult; + List get labResultList => _labsService.labResultList; + getLaboratoryResult( {String projectID, int clinicID, String invoiceNo, String orderNo}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,orderNo: orderNo,projectID: projectID,clinicID: clinicID); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult({PatientLabOrders patientLabOrder}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder + ); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/my_doctor_view_model.dart b/lib/core/viewModels/medical/my_doctor_view_model.dart index e04f9bdd..266157ff 100644 --- a/lib/core/viewModels/medical/my_doctor_view_model.dart +++ b/lib/core/viewModels/medical/my_doctor_view_model.dart @@ -2,8 +2,8 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; -import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -22,6 +22,9 @@ class MyDoctorViewModel extends BaseViewModel { ? _patientDoctorAppointmentListClinic : _patientDoctorAppointmentListHospital; + DoctorList get doctorList=> _myDoctorService.doctorList; + + DoctorProfile get doctorProfile => _myDoctorService.doctorProfile; DoctorRating get doctorRating => _myDoctorService.doctorRating; @@ -61,9 +64,7 @@ class MyDoctorViewModel extends BaseViewModel { .toList(); if (doctorByHospital.length != 0) { - _patientDoctorAppointmentListHospital[ - _patientDoctorAppointmentListHospital - .indexOf(doctorByHospital[0])] + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])] .patientDoctorAppointmentList .add(element); } else { @@ -83,7 +84,7 @@ class MyDoctorViewModel extends BaseViewModel { notifyListeners(); } - void getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { + Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { setState(ViewState.Busy); await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID); if (_myDoctorService.hasError) { diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart new file mode 100644 index 00000000..2e5952ae --- /dev/null +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -0,0 +1,84 @@ +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../core/enum/reportfilter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/reports/Reports.dart'; +import '../../../core/service/medical/reports_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ReportsMonthlyViewModel extends BaseViewModel { + ReportFilterType filterType = ReportFilterType.Requested; + + ReportsService _reportsService = locator(); + + List reportsOrderRequestList = List(); + List reportsOrderReadyList = List(); + List reportsOrderCompletedList = List(); + List reportsOrderCanceledList = List(); + + List get appointHistoryList => + _reportsService.appointHistoryList; + + getReports() async { + setState(ViewState.Busy); + reportsOrderRequestList.clear(); + reportsOrderReadyList.clear(); + reportsOrderCompletedList.clear(); + reportsOrderCanceledList.clear(); + await _reportsService.getReports(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + _filterList(); + setState(ViewState.Idle); + } + } + + getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _reportsService.getPatentAppointmentHistory(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _reportsService.reportsList.forEach((report) { + switch (report.status) { + case 1: + reportsOrderRequestList.add(report); + break; + case 2: + reportsOrderReadyList.add(report); + break; + case 3: + reportsOrderCompletedList.add(report); + break; + case 4: + reportsOrderCanceledList.add(report); + break; + default: + } + }); + } + + + insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ + setState(ViewState.Busy); + await _reportsService.insertRequestForMedicalReport(appointmentHistory); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: 'The order was send '); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart new file mode 100644 index 00000000..a3b6c057 --- /dev/null +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -0,0 +1,25 @@ +import 'base_view_model.dart'; +import '../../locator.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; +import 'package:diplomaticquarterapp/core/service/vaccine_service.dart'; + +class VaccineViewModel extends BaseViewModel { + bool hasError = false; + + VaccineService _vaccineService = locator(); + + List get vaccineList => _vaccineService.vaccineList; + + Future getVaccine() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _vaccineService.getMyVaccine(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index be35b5ab..6839fbc2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -12,6 +12,7 @@ import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; +import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; @@ -22,6 +23,7 @@ import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; +import 'core/viewModels/medical/reports_monthly_view_model.dart'; import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; @@ -29,6 +31,8 @@ import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; import 'core/viewModels/insurance_card_View_model.dart'; import 'core/viewModels/qr_view_model.dart'; +import 'core/viewModels/vaccine_view_model.dart'; +import 'core/service/vaccine_service.dart'; GetIt locator = GetIt.instance; @@ -50,6 +54,8 @@ void setupLocator() { locator.registerLazySingleton(() => DashboardService()); locator.registerLazySingleton(() => AppointmentRateService()); locator.registerLazySingleton(() => QrService()); + locator.registerFactory(() => VaccineService()); + locator.registerLazySingleton(() => ReportsMonthlyService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -60,11 +66,13 @@ void setupLocator() { locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => RadiologyViewModel()); locator.registerFactory(() => FeedbackViewModel()); + locator.registerFactory(() => VaccineViewModel()); locator.registerFactory(() => VitalSignViewModel()); locator.registerFactory(() => InsuranceViewModel()); locator.registerFactory(() => MedicalViewModel()); locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => AppointmentRateViewModel()); locator.registerFactory(() => QrViewModel()); + locator.registerFactory(() => ReportsMonthlyViewModel()); } diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index a935542a..9ba1fb8e 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -272,3 +272,13 @@ class AppoitmentAllHistoryResultList { return data; } } + +class PatientAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + PatientAppointmentList( + {this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/models/Appointments/DentalChiefComplaintsModel.dart b/lib/models/Appointments/DentalChiefComplaintsModel.dart new file mode 100644 index 00000000..c15b828a --- /dev/null +++ b/lib/models/Appointments/DentalChiefComplaintsModel.dart @@ -0,0 +1,48 @@ +class DentalChiefComplaintsModel { + List listDentalChiefComplain; + + DentalChiefComplaintsModel({this.listDentalChiefComplain}); + + DentalChiefComplaintsModel.fromJson(Map json) { + if (json['List_DentalChiefComplain'] != null) { + listDentalChiefComplain = new List(); + json['List_DentalChiefComplain'].forEach((v) { + listDentalChiefComplain.add(new ListDentalChiefComplain.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listDentalChiefComplain != null) { + data['List_DentalChiefComplain'] = + this.listDentalChiefComplain.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListDentalChiefComplain { + int projectID; + int iD; + String name; + String nameN; + + ListDentalChiefComplain({this.projectID, this.iD, this.name, this.nameN}); + + ListDentalChiefComplain.fromJson(Map json) { + projectID = json['ProjectID']; + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index e0468c1f..4c7241c8 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -85,7 +85,7 @@ class DoctorList { clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; iD = json['ID']; - name = json['Name']; + name = json['DoctorName']??json['Name']; projectID = json['ProjectID']; projectName = json['ProjectName']; actualDoctorRate = json['ActualDoctorRate']; @@ -118,7 +118,8 @@ class DoctorList { rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + if (json.containsKey('Speciality') && json['Speciality']!=null) + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 756aa8bf..9d3da450 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -1,5 +1,10 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -14,6 +19,11 @@ class DentalComplaints extends StatefulWidget { } class _DentalComplaintsState extends State { + List complaintsList = []; + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isDataLoaded = false; + var languageID; + @override void initState() { WidgetsBinding.instance @@ -26,20 +36,43 @@ class _DentalComplaintsState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: "Symptoms", - body: Container(), + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: ListView.builder( + itemCount: complaintsList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.only(bottom: 10.0), + child: DentalComplaintCard( + listDentalChiefComplain: complaintsList[index], + languageID: languageID, + ), + ); + }, + ), + ), ); } + getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + } + getChiefComplaintsList() { + getLanguageID(); ClinicListService service = new ClinicListService(); service .getChiefComplaintsList( widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) .then((res) { if (res['MessageStatus'] == 1) { -// setState(() { -// res['List_DentalChiefComplain'].forEach((v) {}); -// }); + print(res['List_DentalChiefComplain']); + setState(() { + res['List_DentalChiefComplain'].forEach((v) { + complaintsList.add(new ListDentalChiefComplain.fromJson(v)); + }); + print(complaintsList.length); + }); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index c52002b4..2b5fac17 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -43,7 +43,7 @@ class _SearchResultsState extends State { (index) => AppExpandableNotifier( title: widget .patientDoctorAppointmentListHospital[index].filterName + " - " +widget - .patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" , + .patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index de3aaed0..e844d4d1 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,5 +1,5 @@ import "dart:collection"; -import 'package:diplomaticquarterapp/config/config.dart'; + import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; @@ -77,12 +77,12 @@ class _SearchByClinicState extends State { } }); }, - trailing: Icon(TranslationBase.of(AppGlobal.context) - .locale - .languageCode == - 'en' - ? Icons.keyboard_arrow_right - : Icons.keyboard_arrow_left), + // trailing: Icon(TranslationBase.of(AppGlobal.context) + // .locale + // .languageCode == + // 'en' + // ? Icons.keyboard_arrow_right + // : Icons.keyboard_arrow_left), title: Text(result.clinicDescription, style: TextStyle( fontSize: 14.0, @@ -115,7 +115,7 @@ class _SearchByClinicState extends State { onChanged: (newValue) { setState(() { dropdownValue = newValue; - if (!isDentalSelectedAndSupported()) { + if (!isDentalSelectedAndSupported() && !nearestAppo) { projectDropdownValue = ""; getDoctorsList(context); } @@ -228,23 +228,21 @@ class _SearchByClinicState extends State { .getDoctorsList( int.parse(dropdownValue), projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, + nearestAppo, context) .then((res) { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { + print(res['DoctorList']); doctorsList.clear(); res['DoctorList'].forEach((v) { - try { - doctorsList.add(new DoctorList.fromJson(v)); + doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); - } catch (issue) { - print(issue); - } + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); }); } else {} }); @@ -259,6 +257,7 @@ class _SearchByClinicState extends State { } }).catchError((err) { print(err); + AppToast.showErrorToast(message: err); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } @@ -285,7 +284,9 @@ class _SearchByClinicState extends State { num: numAll, resultDistance: resultDistance), ), - ); + ).then((value) { + getProjectsList(); + }); } filterClinic() { diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 63d47b5f..48613ebf 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -148,7 +148,7 @@ class _ExpandableListViewState extends State { String getProjectDistance(String distance) { if (distance != "0") - return " - " + distance + " KMs"; + return " - " + distance + " " + TranslationBase.of(context).km; else { return ""; } diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart new file mode 100644 index 00000000..27f37d0a --- /dev/null +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +// ignore: must_be_immutable +class DentalComplaintCard extends StatefulWidget { + final ListDentalChiefComplain listDentalChiefComplain; + var languageID; + + DentalComplaintCard( + {@required this.listDentalChiefComplain, this.languageID}); + + @override + _DentalComplaintCardState createState() => _DentalComplaintCardState(); +} + +class _DentalComplaintCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: InkWell( + onTap: () { + getChiefComplaintsList(); + }, + child: Card( + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.85, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text(widget.listDentalChiefComplain.name, + style: + TextStyle(fontSize: 16.0, color: Colors.black)), + ), + ], + ), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon(Icons.arrow_forward_ios, + size: 20.0, color: Colors.black54), + ], + ), + ), + ], + ), + ), + ), + ); + } + + getChiefComplaintsList() { + List doctorsList = []; + List _patientDoctorAppointmentListHospital = + List(); + + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, + widget.listDentalChiefComplain.projectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + print(res['List_DentalDoctorChiefComplaintMapping']); + setState(() { + doctorsList.clear(); + res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } +} diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index e8f08af5..d3150459 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -9,7 +10,7 @@ import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { - DoctorList doctor; + final DoctorList doctor; DoctorView({@required this.doctor}); @@ -33,69 +34,87 @@ class DoctorView extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network(this.doctor.doctorImageURL, - fit: BoxFit.fill, height: 60.0, width: 60.0), + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(this.doctor.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(this.doctor.doctorTitle + " " + this.doctor.name, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.projectName, + Expanded( + flex: 4, + child: Container( + width: MediaQuery.of(context).size.width * 0.55, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if(doctor.doctorTitle!=null) + Text(this.doctor.doctorTitle + " " + this.doctor.name, style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], + fontSize: 14.0, + color: Colors.grey[700], letterSpacing: 1.0)), - ), - Container( + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if(doctor.speciality!=null) + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + this.doctor.nearestFreeSlot != null ? Container( margin: EdgeInsets.only(top: 3.0, bottom: 3.0), child: Text( - getDoctorSpeciality(this.doctor.speciality).trim(), + getDate(this.doctor.nearestFreeSlot), style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], + fontSize: 14.0, + fontWeight: FontWeight.bold, + color: Colors.green[600], letterSpacing: 1.0)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: - this.doctor.actualDoctorRate.toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - Container( - child: Image.network(this.doctor.nationalityFlagURL, - width: 25.0, height: 25.0), - ), - ], - ), - ], + ) : Container(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + this.doctor.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network(this.doctor.nationalityFlagURL, + width: 25.0, height: 25.0), + ), + ], + ), + ], + ), ), ), ], @@ -136,6 +155,29 @@ class DoctorView extends StatelessWidget { }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if(dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Navigator.push( diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 63034373..8076554e 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCar import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:smart_progress_bar/smart_progress_bar.dart'; @@ -15,6 +16,13 @@ class MyAppointments extends StatefulWidget { List confirmedAppoList = []; List arrivedAppoList = []; + List _patientBookedAppointmentListHospital = List(); + + List _patientConfirmedAppointmentListHospital = + List(); + + List _patientArrivedAppointmentListHospital = List(); + @override _MyAppointmentsState createState() => _MyAppointmentsState(); } @@ -36,11 +44,10 @@ class _MyAppointmentsState extends State @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "My Appointments", + appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, body: Container( child: Column(children: [ - /// this is will not colored with theme data TabBar( tabs: [ Tab(text: TranslationBase.of(context).booked), @@ -94,7 +101,8 @@ class _MyAppointmentsState extends State } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } bool isConfirmed(AppoitmentAllHistoryResultList appo) { @@ -123,15 +131,85 @@ class _MyAppointmentsState extends State widget.arrivedAppoList.add(v); } }); + + widget.bookedAppoList.forEach((element) { + List doctorByHospital = + widget._patientBookedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientBookedAppointmentListHospital[widget + ._patientBookedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientBookedAppointmentListHospital.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + }); + + widget.confirmedAppoList.forEach((element) { + List doctorByHospital = + widget._patientConfirmedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientConfirmedAppointmentListHospital[widget + ._patientConfirmedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientConfirmedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + }); + + widget.arrivedAppoList.forEach((element) { + List doctorByHospital = + widget._patientArrivedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientArrivedAppointmentListHospital[widget + ._patientArrivedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientArrivedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + }); } openAppointmentsTab() { if (widget.bookedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 1); + _tabController.index = 0; } else if (widget.confirmedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 2); + _tabController.index = 1; } else if (widget.arrivedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 3); + _tabController.index = 2; return; } } @@ -158,29 +236,100 @@ class _MyAppointmentsState extends State "assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", + child: Text(TranslationBase.of(context).noBookedAppointments, style: TextStyle( fontSize: 16.0, )), ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientBookedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientBookedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientBookedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Booked Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ), + ), + ) ], - ), - ), - ), - ); + + )))); } Widget getConfirmedAppointments() { return widget.confirmedAppoList.length != 0 ? Container( - child: new ListView.builder( - itemCount: widget.confirmedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.confirmedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientConfirmedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientConfirmedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientConfirmedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), ), ) : Container( @@ -192,7 +341,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Confirmed Appointments", + child: Text(TranslationBase.of(context).noConfirmedAppointments , style: TextStyle( fontSize: 16.0, )), @@ -206,16 +355,47 @@ class _MyAppointmentsState extends State Widget getArrivedAppointments() { return widget.arrivedAppoList.length != 0 ? Container( - child: new ListView.builder( - itemCount: widget.arrivedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.arrivedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientArrivedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientArrivedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientArrivedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), ), ) +// Container( +// child: new ListView.builder( +// itemCount: widget.arrivedAppoList.length, +// itemBuilder: (context, i) { +// return AppointmentCard( +// appo: widget.arrivedAppoList[i], +// onReloadAppointmentHistory: getPatientAppointmentHistory, +// ); +// }, +// ), +// ) : Container( child: Center( child: Column( @@ -225,7 +405,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Arrived Appointments", + child: Text(TranslationBase.of(context).noArrivedAppointments, style: TextStyle( fontSize: 16.0, )), diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index e2f6f706..b64bd232 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -42,7 +42,7 @@ class _ApointmentCardState extends State { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.6, + width: MediaQuery.of(context).size.width * 0.57, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -95,7 +95,7 @@ class _ApointmentCardState extends State { emptyIcon: Icons.star, ), Container( - transform: Matrix4.translationValues(0.0, -40.0, 0.0), + transform: Matrix4.translationValues(15.0, -40.0, 0.0), child: Image.asset( "assets/images/new-design/arrow.png", width: 25.0, diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index 9cc40692..038468e0 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -80,7 +80,7 @@ class _InsuranceApprovalState extends State { children: [ ExpansionTile( title: Container( - height: 120.0, + //height: 120.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 9cfa41a9..2fa291df 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; @@ -97,9 +98,12 @@ class _InsuranceUpdateState extends State children: [ Container( child: ListView.builder( - itemCount: model.insuranceUpdate == null + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList == + null ? 0 - : model.insuranceUpdate.length, + : model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( margin: EdgeInsets.all(10.0), @@ -112,81 +116,63 @@ class _InsuranceUpdateState extends State child: Container( width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10.0), - child: Column( + child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - model.insuranceUpdate[index] - .createdOn, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, left: 10.0, right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + Text( + 'File No.' + + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientID.toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + ], ), - Expanded( - flex: 1, - child: Container( -// height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Container( - child: Button( - label: 'Fetch', - ), - height: SizeConfig - .heightMultiplier * - 3.8, - width: - SizeConfig.screenWidth * - 4.2, - ), - ], - ), - ), - ) - ], + ), ), + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: 'Update', + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) ], ), ), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 06a2f9ca..d0c8d382 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -154,8 +154,8 @@ class _HomePageState extends State { ), Align( alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, + ? Alignment.bottomRight + : Alignment.bottomLeft, child: InkWell( onTap: () { widget.goToMyProfile(); @@ -368,13 +368,13 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, imageName: 'home_healthcare_service_bg.png', opacity: 0.5, ), @@ -403,7 +403,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', ), DashboardItem( @@ -431,7 +431,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, color: Hexcolor("#747C80"), imageName: 'emergency_service_image.png', ), @@ -472,7 +472,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, @@ -505,7 +505,7 @@ class _HomePageState extends State { ), ), width: MediaQuery.of(context).size.width * 0.29, - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, @@ -536,7 +536,7 @@ class _HomePageState extends State { ), ), ), - height: MediaQuery.of(context).size.width*0.4, + height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7f1316ed..d892be83 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -130,119 +130,119 @@ class _LandingPageState extends State with WidgetsBindingObserver { //_firebase Background message handler _firebaseMessaging.configure( - onMessage: (Map message) async { - showDialog("onMessage: $message"); - print("onMessage: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); - } - - if (Platform.isAndroid) { - if (message['data'].containsKey("is_call")) { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = - new Map.from(message['data']); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found Android"); - } - } else { - print("Is Call Not Found Android"); - } - }, - onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - onLaunch: (Map message) async { - print("onLaunch: $message"); - showDialog("onLaunch: $message"); - }, - onResume: (Map message) async { - print("onResume: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - showDialog("onResume: $message"); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = - new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); - } - }, - ); + // onMessage: (Map message) async { + // showDialog("onMessage: $message"); + // print("onMessage: $message"); + // print(message); + // print(message['name']); + // print(message['appointmentdate']); + // + // if (Platform.isIOS) { + // if (message['is_call'] == "true") { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = new Map.from(message); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // + // if (Platform.isAndroid) { + // if (message['data'].containsKey("is_call")) { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = + // new Map.from(message['data']); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found Android"); + // } + // } else { + // print("Is Call Not Found Android"); + // } + // }, + // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + // onLaunch: (Map message) async { + // print("onLaunch: $message"); + // showDialog("onLaunch: $message"); + // }, + // onResume: (Map message) async { + // print("onResume: $message"); + // print(message); + // print(message['name']); + // print(message['appointmentdate']); + // + // showDialog("onResume: $message"); + // + // if (Platform.isIOS) { + // if (message['is_call'] == "true") { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = + // new Map.from(message); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // }, + ); } showDialog(String message) { @@ -298,16 +298,21 @@ class _LandingPageState extends State with WidgetsBindingObserver { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - HomePage(goToMyProfile: (){ - _changeCurrentTab(1); - },), + HomePage( + goToMyProfile: () { + _changeCurrentTab(1); + }, + ), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions() ], // Please do not remove the BookingOptions from this array ), - bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,), + bottomNavigationBar: BottomNavBar( + changeIndex: _changeCurrentTab, + index: currentTab, + ), ); } @@ -316,7 +321,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 0: return TranslationBase.of(context).home; case 1: - return 'Medical Profile'; + return TranslationBase.of(context).medicalProfile; case 2: return TranslationBase.of(context).mySchedule; case 3: diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 4cce1dc8..7a01ef90 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -1,7 +1,10 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -34,7 +37,7 @@ class DoctorHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, @@ -51,7 +54,7 @@ class DoctorHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, @@ -75,16 +78,42 @@ class DoctorHomePage extends StatelessWidget { children: model.patientDoctorAppointmentList[index] .patientDoctorAppointmentList .map((doctor) { - return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DoctorProfilePage( - patientDoctorAppointment: doctor, - ), - ), - ); + DoctorList doctorList = DoctorList( + projectID: doctor.projectID, + setupID: doctor.setupID, + clinicID: doctor.clinicID, + projectName: doctor.projectName, + clinicName: doctor.clinicName, + actualDoctorRate: doctor.actualDoctorRate, + doctorID: doctor.doctorID, + doctorRate: doctor.doctorRate, + gender: doctor.gender, + doctorTitle: doctor.doctorTitle, + name: doctor.name, + doctorImageURL: doctor.doctorImageURL, + nationalityFlagURL: doctor.nationalityFlagURL); + return DoctorView( + doctor: doctorList, + ); + /* InkWell( + onTap: () async { + model + .getDoctorProfileAndRating( + doctorId: doctor.doctorID, + clinicID: doctor.clinicID, + projectID: doctor.projectID) + .then((value) { + var asd=""; + Navigator.push( + context, + FadePage( + page: DoctorView(doctor: model.doctorList,), + ), + ); + }).catchError((e){ + var asd=""; + + }); }, child: DoctorCard( name: doctor.doctorName, @@ -93,7 +122,8 @@ class DoctorHomePage extends StatelessWidget { subName: DateUtil.getMonthDayYearDateFormatted( doctor.appointmentDate), ), - ); + )*/ + ; }).toList(), )), ) diff --git a/lib/pages/medical/doctor/doctor_profile_page.dart b/lib/pages/medical/doctor/doctor_profile_page.dart index 2b19ba3d..7588205c 100644 --- a/lib/pages/medical/doctor/doctor_profile_page.dart +++ b/lib/pages/medical/doctor/doctor_profile_page.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -35,149 +37,147 @@ class _DoctorProfilePageState extends State @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDoctorProfileAndRating( - doctorId: widget.patientDoctorAppointment.doctorID, - clinicID: widget.patientDoctorAppointment.clinicID, - projectID: widget.patientDoctorAppointment.projectID), - builder: (context, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'Doctor Profile', - baseViewModel: model, - body: SingleChildScrollView( + /* onModelReady: (model) => model.getDoctorProfileAndRating( + doctorId: widget.patientDoctorAppointment.doctorID, + clinicID: widget.patientDoctorAppointment.clinicID, + projectID: widget.patientDoctorAppointment.projectID),*/ + builder: (context, model, widget) => DoctorView(doctor: model.doctorList,)/*AppScaffold( + isShowAppBar: true, + appBarTitle: 'Doctor Profile', + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + margin: EdgeInsets.only(top: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(top: 20.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(5), - width: 50, - height: 50, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey), - child: Icon( - Icons.calendar_view_day, - size: 25, - color: Colors.white, - )), - ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network( - patientDoctorAppointment.doctorImageURL, - fit: BoxFit.fill, - height: 120.0, - width: 120.0), - ), - Container( - margin: EdgeInsets.all(5), - width: 50, - height: 50, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey), - child: Icon( - Icons.format_list_bulleted, - size: 25, - color: Colors.white, - )), - ], - ), + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.calendar_view_day, + size: 25, + color: Colors.white, + )), + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + patientDoctorAppointment.doctorImageURL, + fit: BoxFit.fill, + height: 120.0, + width: 120.0), ), Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(patientDoctorAppointment.doctorName, - style: TextStyle( - fontSize: 20.0, - color: Colors.grey[900], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(patientDoctorAppointment.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[900], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: RatingBar.readOnly( - initialRating: - model.doctorRating.doctorRate?.toDouble() ?? - 0.0, - size: 35.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: Text( - "(${model.doctorRating.patientNumber ?? 0} Reviews)", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Divider( - color: Colors.grey[500], - ), - ), - TabBar( - indicatorColor: Colors.red[800], - indicatorWeight: 3.0, - tabs: [ - Tab( - child: Text('Doctor Information', - style: TextStyle(color: Colors.black))), - Tab( - child: Text( - TranslationBase.of(context).availableAppo, - style: TextStyle(color: Colors.black)), - ) - ], - controller: _tabController, - ), - Container( - height: MediaQuery.of(context).size.height * 0.8, - child: TabBarView( - physics: BouncingScrollPhysics(), - children: [ - DoctorInformation( - doctorProfile: model.doctorProfile, - ), - Container() - ], - controller: _tabController, - ), + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.format_list_bulleted, + size: 25, + color: Colors.white, + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.doctorName, + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + model.doctorRating.doctorRate?.toDouble() ?? 0.0, + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(${model.doctorRating.patientNumber ?? 0} Reviews)", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + TabBar( + indicatorColor: Colors.red[800], + indicatorWeight: 3.0, + tabs: [ + Tab( + child: Text('Doctor Information', + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + Container( + height: MediaQuery.of(context).size.height * 0.8, + child: TabBarView( + physics: BouncingScrollPhysics(), + children: [ + DoctorInformation( + doctorProfile: model.doctorProfile, ), + Container(), +// DocAvailableAppointments(doctor: model.doctorList,) ], + controller: _tabController, ), ), ], ), ), - )); + ], + ), + ), + )*/, + ); } } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 216b8adb..01cb6725 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -27,8 +27,10 @@ class LaboratoryResultPage extends StatelessWidget { body: ListView.builder( itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders), - billNo: model.patientLabSpecialResult[index].invoiceNo, + billNo: patientLabOrders.invoiceNo, details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: patientLabOrders.orderNo, + patientLabOrder: patientLabOrders, ), itemCount: model.patientLabSpecialResult.length, ), diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 00cd82a1..325d5dcd 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -19,7 +20,7 @@ class LabsHomePage extends StatelessWidget { builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: 'Lab Orders', + appBarTitle: TranslationBase.of(context).labOrders, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -34,7 +35,7 @@ class LabsHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, @@ -51,7 +52,7 @@ class LabsHomePage extends StatelessWidget { child: InkWell( onTap: () => model.setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, @@ -85,7 +86,7 @@ class LabsHomePage extends StatelessWidget { ), name: labOrder.doctorName, profileUrl: labOrder.doctorImageURL, - subName: 'Bill No : ${labOrder.invoiceNo}', + subName: TranslationBase.of(context).billNo+' ${labOrder.invoiceNo}', date: DateUtil.getMonthDayYearDateFormatted( labOrder.orderDate), ); diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 87486ce5..5dccb514 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -2,12 +2,15 @@ import 'dart:math'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.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/time_line_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -17,6 +20,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; +import 'package:provider/provider.dart'; import '../../locator.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; @@ -31,6 +35,7 @@ class MedicalProfilePage extends StatefulWidget { class _MedicalProfilePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( @@ -48,11 +53,9 @@ class _MedicalProfilePageState extends State { height: 210, decoration: BoxDecoration( image: DecorationImage( - image: ExactAssetImage( - 'assets/images/timeline_bg.png'), - fit: BoxFit.cover - ), - + image: ExactAssetImage( + 'assets/images/timeline_bg.png'), + fit: BoxFit.cover), ), child: Stack( children: [ @@ -70,13 +73,13 @@ class _MedicalProfilePageState extends State { itemCount: model.appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, - reverse: true, + reverse: !projectViewModel.isArabic, ), ], ), ), Padding( - padding: EdgeInsets.symmetric(vertical: 12.0), + padding: EdgeInsets.symmetric(vertical: 5.0), child: Column( children: [ Container( @@ -89,13 +92,19 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push(context, - FadePage(page: MyAppointments())); + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); }, child: MedicalProfileItem( - title: 'My Appointments', + title: TranslationBase.of(context) + .myAppointments, imagePath: 'my_appointment_icon.png', - subTitle: 'List', + subTitle: TranslationBase.of(context) + .myAppointmentsList, ), ), ), @@ -103,11 +112,12 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () => Navigator.push(context, - FadePage(page: RadiologyHomePage())), + FadePage(page: LabsHomePage())), child: MedicalProfileItem( - title: 'Radiology', - imagePath: 'radiology_icon.png', - subTitle: 'Service', + title: TranslationBase.of(context).lab, + imagePath: 'lab_result_icon.png', + subTitle: + TranslationBase.of(context).lab, ), ), ), @@ -115,11 +125,13 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () => Navigator.push(context, - FadePage(page: LabsHomePage())), + FadePage(page: RadiologyHomePage())), child: MedicalProfileItem( - title: 'Lab', - imagePath: 'lab_result_icon.png', - subTitle: 'Result', + title: TranslationBase.of(context) + .radiology, + imagePath: 'radiology_icon.png', + subTitle: TranslationBase.of(context) + .radiologySubtitle, ), ), ), @@ -132,14 +144,18 @@ class _MedicalProfilePageState extends State { child: InkWell( onTap: () { Navigator.push( - context, - FadePage( - page: HomePrescriptionsPage())); + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); }, child: MedicalProfileItem( - title: 'Medicines', + title: TranslationBase.of(context) + .medicines, imagePath: 'prescription_icon.png', - subTitle: 'Prescriptions', + subTitle: TranslationBase.of(context) + .medicinesSubtitle, ), ), ), @@ -147,13 +163,17 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () => Navigator.push( - context, - FadePage( - page: VitalSignDetailsScreen())), + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ), child: MedicalProfileItem( - title: 'Vital Signs', + title: TranslationBase.of(context) + .vitalSigns, imagePath: 'medical_history_icon.png', - subTitle: 'Reports', + subTitle: TranslationBase.of(context) + .vitalSignsSubtitle, ), ), ), @@ -163,9 +183,11 @@ class _MedicalProfilePageState extends State { // onTap: () => Navigator.push( // context, FadePage(page: RadiologyHomePage())), child: MedicalProfileItem( - title: 'My Medicines ', + title: TranslationBase.of(context) + .myMedical, imagePath: 'radiology_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .myMedicalSubtitle, ), ), ), @@ -177,13 +199,19 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push(context, - FadePage(page: DoctorHomePage())); + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); }, child: MedicalProfileItem( - title: 'My Doctor', + title: TranslationBase.of(context) + .myDoctor, imagePath: 'doctor_icon.png', - subTitle: 'List', + subTitle: TranslationBase.of(context) + .myDoctorSubtitle, ), ), ), @@ -196,10 +224,11 @@ class _MedicalProfilePageState extends State { // FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'Eye', + title: TranslationBase.of(context).eye, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Measurement', + subTitle: TranslationBase.of(context) + .eyeSubtitle, ), ), ), @@ -211,9 +240,11 @@ class _MedicalProfilePageState extends State { FadePage(page: InsuranceCard())); }, child: MedicalProfileItem( - title: 'Insurance', + title: TranslationBase.of(context) + .insurance, imagePath: 'insurance_card_icon.png', - subTitle: 'Card', + subTitle: TranslationBase.of(context) + .insuranceSubtitle, ), ), ), @@ -223,38 +254,43 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: InsuranceUpdate())); + }, child: MedicalProfileItem( - title: 'Update Insurance', + title: TranslationBase.of(context) + .updateInsurance, imagePath: 'insurance_card_icon.png', - subTitle: 'card', + subTitle: TranslationBase.of(context) + .updateInsuranceSubtitle, ), ), ), Expanded( flex: 1, child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: InsuranceApproval())); + }, child: MedicalProfileItem( - title: 'Insurance Approval', + title: TranslationBase.of(context) + .insuranceApproval, imagePath: 'insurance_approvals_icon.png', - subTitle: '', + subTitle: TranslationBase.of(context) + .insuranceApprovalSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Allergies', + title: + TranslationBase.of(context).allergies, imagePath: 'medical_history_icon.png', - subTitle: 'Diagnosed', + subTitle: TranslationBase.of(context) + .allergiesSubtitle, ), ), ]), @@ -262,15 +298,16 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: MyVaccines())); + }, child: MedicalProfileItem( - title: 'My Vaccines', + title: TranslationBase.of(context) + .myVaccines, imagePath: 'insurance_card_icon.png', - subTitle: 'card', + subTitle: TranslationBase.of(context) + .myVaccinesSubtitle, ), ), ), @@ -282,18 +319,21 @@ class _MedicalProfilePageState extends State { FadePage(page: HomeReportPage())); }, child: MedicalProfileItem( - title: 'Medical', + title: + TranslationBase.of(context).medical, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Reports', + subTitle: TranslationBase.of(context) + .medicalSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Monthly', + title: TranslationBase.of(context).monthly, imagePath: 'medical_history_icon.png', - subTitle: 'Report', + subTitle: TranslationBase.of(context) + .monthlySubtitle, ), ), ]), @@ -307,9 +347,10 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Sick', + title: TranslationBase.of(context).sick, imagePath: 'insurance_card_icon.png', - subTitle: 'Leaves', + subTitle: TranslationBase.of(context) + .sickSubtitle, ), ), ), @@ -321,18 +362,22 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'My Balance', + title: + TranslationBase.of(context).myBalance, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Credit', + subTitle: TranslationBase.of(context) + .myBalanceSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Patient Call', + title: + TranslationBase.of(context).patientCall, imagePath: 'medical_history_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .patientCallSubtitle, ), ), ]), @@ -346,9 +391,11 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Smart Watches', + title: TranslationBase.of(context) + .smartWatches, imagePath: 'insurance_card_icon.png', - subTitle: 'Pairing', + subTitle: TranslationBase.of(context) + .smartWatchesSubtitle, ), ), ), @@ -360,18 +407,21 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'My Trackers', + title: TranslationBase.of(context) + .myTrackers, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .myTrackersSubtitle, ), ), ), Expanded( flex: 1, child: MedicalProfileItem( - title: 'Ask Your', + title: TranslationBase.of(context).askYour, imagePath: 'medical_history_icon.png', - subTitle: 'Doctor', + subTitle: TranslationBase.of(context) + .askYourSubtitle, ), ), ]), @@ -385,9 +435,11 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: DoctorHomePage())); // }, child: MedicalProfileItem( - title: 'Internet', + title: + TranslationBase.of(context).internet, imagePath: 'insurance_card_icon.png', - subTitle: 'Pairing', + subTitle: TranslationBase.of(context) + .internetSubtitle, ), ), ), @@ -399,19 +451,17 @@ class _MedicalProfilePageState extends State { // context, FadePage(page: InsuranceApproval())); // }, child: MedicalProfileItem( - title: 'My Trackers', + title: + TranslationBase.of(context).chatbot, imagePath: 'insurance_approvals_icon.png', - subTitle: 'Service', + subTitle: TranslationBase.of(context) + .chatbotSubtitle, ), ), ), Expanded( flex: 1, - child: MedicalProfileItem( - title: 'Ask Your', - imagePath: 'medical_history_icon.png', - subTitle: 'Doctor', - ), + child: Container(), ), ]), ], @@ -428,17 +478,16 @@ class _MedicalProfilePageState extends State { width: double.infinity, height: 70, decoration: BoxDecoration( - color: Colors.grey[600], - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover - ) - ), + color: Colors.grey[600], + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -464,9 +513,10 @@ class _MedicalProfilePageState extends State { ), Positioned( top: 2, - left: 10, + left: projectViewModel.isArabic ? 0 : 10, + right: projectViewModel.isArabic ? 10 : 0, child: Texts( - 'Time Line ', + TranslationBase.of(context).timeLine, color: Colors.white, fontSize: 14, fontWeight: FontWeight.normal, diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart index efd9df44..9d63bf7d 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -49,7 +50,7 @@ class PrescriptionsHistoryPage extends StatelessWidget { height: 5, ), Texts( - 'Order No ${prescriptionsViewModel.prescriptionsHistory[index].iD}'), + '${TranslationBase.of(context).orderNo} ${prescriptionsViewModel.prescriptionsHistory[index].iD}'), SizedBox( height: 5, ), @@ -59,7 +60,7 @@ class PrescriptionsHistoryPage extends StatelessWidget { height: 5, ), Texts( - 'Order Details', + '${TranslationBase.of(context).orderNo}', fontWeight: FontWeight.w300, ), SizedBox( diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index fd903b4b..e6e3e6db 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -36,7 +37,7 @@ class _HomePrescriptionsPageState extends State onModelReady: (model) => model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'My Doctors', + appBarTitle: TranslationBase.of(context).myDoctor, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -84,13 +85,13 @@ class _HomePrescriptionsPageState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts('Prescriptions'), + child: Texts(TranslationBase.of(context).prescriptions), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts('History'), + child: Texts(TranslationBase.of(context).history), ), ), ], diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index e335f41c..e6e90d9e 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -32,7 +33,7 @@ class PrescriptionsPage extends StatelessWidget { onTap: () => prescriptionsViewModel.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: prescriptionsViewModel.filterType, @@ -50,7 +51,7 @@ class PrescriptionsPage extends StatelessWidget { onTap: () => prescriptionsViewModel .setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: prescriptionsViewModel.filterType, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 3288dcaf..0f9f4c7b 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -17,7 +18,7 @@ class RadiologyHomePage extends StatelessWidget { onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Radiology', + appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -32,7 +33,7 @@ class RadiologyHomePage extends StatelessWidget { onTap: () => model.setFilterType(FilterType.Clinic), child: ListTile( - title: const Text('Clinic'), + title: Text(TranslationBase.of(context).clinic), leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, @@ -50,7 +51,7 @@ class RadiologyHomePage extends StatelessWidget { onTap: () => model .setFilterType(FilterType.Hospital), child: ListTile( - title: const Text('Hospital'), + title: Text(TranslationBase.of(context).hospital), leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, @@ -85,7 +86,7 @@ class RadiologyHomePage extends StatelessWidget { child: DoctorCard( name: radiology.doctorName, profileUrl: radiology.doctorImageURL, - subName: '${radiology.projectName} \nBill No ${radiology.invoiceNo}', + subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', date: DateUtil.getMonthDayYearDateFormatted( radiology.orderDate), ), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart new file mode 100644 index 00000000..9c913705 --- /dev/null +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class MonthlyReportsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).monthlyReports, + body: Container(), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index a0dc78ff..b8c4eda2 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -16,7 +16,6 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; - VitalSignDetailsScreen({this.appointmentNo, this.projectID}); @override @@ -28,7 +27,7 @@ class VitalSignDetailsScreen extends StatelessWidget { : (model) => model.getPatientRadOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Vital Sign', + appBarTitle: TranslationBase.of(context).vitalSigns, baseViewModel: mode, body: mode.vitalSignResModelList.length > 0 ? Container( @@ -42,7 +41,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Height, - pageTitle: 'Height', + pageTitle: TranslationBase.of(context).height, vitalList: mode.vitalSignResModelList, ), ), @@ -66,7 +65,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Weight, - pageTitle: 'Weight', + pageTitle: TranslationBase.of(context).weight, vitalList: mode.vitalSignResModelList, ), ), @@ -92,7 +91,8 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.BodyMeasurements, - pageTitle: 'BMI', + pageTitle: TranslationBase.of(context) + .bodyMeasurements, vitalList: mode.vitalSignResModelList, ), ), @@ -112,7 +112,8 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Temperature, - pageTitle: 'Temperature', + pageTitle: + TranslationBase.of(context).temperature, vitalList: mode.vitalSignResModelList, ), ), @@ -138,7 +139,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.heart, - pageTitle: 'Hart ', + pageTitle: TranslationBase.of(context).heart, vitalList: mode.vitalSignResModelList, ), ), @@ -160,7 +161,8 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.Respiration, - pageTitle: 'Respiration Rate', + pageTitle: + TranslationBase.of(context).respirationRate, vitalList: mode.vitalSignResModelList, ), ), @@ -187,7 +189,7 @@ class VitalSignDetailsScreen extends StatelessWidget { FadePage( page: VitalSignItemDetailsScreen( pageKey: VitalSignDetails.BloodPressure, - pageTitle: 'BloodPressure', + pageTitle: TranslationBase.of(context).pulse, vitalList: mode.vitalSignResModelList, ), ), diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart new file mode 100644 index 00000000..cfb0415f --- /dev/null +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -0,0 +1,361 @@ +import 'dart:typed_data'; +import 'dart:convert'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:flutter_email_sender/flutter_email_sender.dart'; +import 'package:popup_box/popup_box.dart'; + +class MyVaccines extends StatefulWidget { + @override + _MyVaccinesState createState() => _MyVaccinesState(); +} + +class _MyVaccinesState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getVaccine(), + builder: (BuildContext context, VaccineViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'My Vaccines', + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( + children: [ + Row( + children: [ + Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig + .imageSizeMultiplier * + 23, + width: SizeConfig + .imageSizeMultiplier * + 20, + fit: BoxFit.fill, + ), + ), + ], + ), + Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index] + .doctorTitle + + model.vaccineList[index] + .doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: + TextStyle(fontSize: 17.0), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ], + ); + }), + ) + ], + ), + ), + SpaceBetweenTexts(space: 165.0), + Flexible( + child: Container( + width: 350.0, + height: 80.0, + child: Button( + label: 'CHECK VACCINE AVAILABILITY', + backgroundColor: Color(0xff9EA3A4), + ), + ), + ), + Flexible( + child: Container( + width: 350.0, + height: 80.0, + child: Button( + label: 'SEND EMAIL', + backgroundColor: Color(0xffF62426), + onTap: () async { + await PopupBox.showPopupBox( + context: context, + button: MaterialButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + color: Colors.white, + child: Text( + 'CANCEL', + style: TextStyle(fontSize: 16.5), + ), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + willDisplayWidget: Column( + children: [ + Text( + 'Conform \nSend a copy of this report to the email' + + model.vaccineList[0].doctorName, + style: TextStyle( + fontSize: 20, + color: Colors.black26, + fontWeight: FontWeight.w900), + ), + SizedBox( + height: 30.0, + ), + ], + )); + }, + ), + ), + ), + ], + ), + +// child: ListView.builder( +// itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, +// itemBuilder: (BuildContext context, int index) { +// return Column( +// children: [ +// RoundedContainer( +// backgroundColor: Colors.white, +// child: Column( +// children: [ +// ExpansionTile( +// title: Container( +// height: 60.0, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Texts('2018'), +// ], +// ), +// ), +// children: [ +// Column( +// children: [ +// Row( +// children: [ +// Column( +// children: [ +// Padding( +// padding: EdgeInsets.symmetric( +// horizontal: 20.0, vertical: 20.0), +// child: Container( +// child: Image.network( +// model.vaccineList[index] +// .doctorImageURL, +// height: SizeConfig +// .imageSizeMultiplier * +// 23, +// width: SizeConfig +// .imageSizeMultiplier * +// 20, +// fit: BoxFit.fill, +// colorBlendMode: +// BlendMode.hardLight, +// ), +// ), +// ) +// ], +// ), +// Container( +// child: Column( +// mainAxisAlignment: +// MainAxisAlignment.start, +// crossAxisAlignment: +// CrossAxisAlignment.start, +// children: [ +// Text( +// model.vaccineList[index] +// .doctorTitle + +// model.vaccineList[index] +// .doctorName, +// style: TextStyle( +// fontWeight: FontWeight.w900, +// fontSize: 17.5), +// ), +// Text( +// model +// .vaccineList[index].projectName, +// style: TextStyle( +// fontSize: 19.0, +// letterSpacing: 0.3, +// color: Colors.grey, +// fontWeight: FontWeight.bold), +// ), +// Text( +// model +// .vaccineList[index].vaccineName, +// style: TextStyle( +// fontSize: 19.0, +// color: Colors.grey, +// fontWeight: FontWeight.bold), +// ), +// Text( +// 'Date Taken ' + +// convertDateFormat(model +// .vaccineList[index] +// .invoiceDate), +// style: TextStyle( +// fontSize: 19.0, +// color: Colors.grey, +// fontWeight: FontWeight.bold), +// ), +// ], +// ), +// ), +// ], +// ), +// ], +// ), +// ], +// ), +// ], +// ), +// ), +// Container( +// width: 300, +// child: Button( +// label: 'CHECK VACCINE AVAILABILITY', +// backgroundColor: Color(0xff9EA3A4), +// ), +// ), +// Container( +// width: 300, +// child: Button( +// label: 'SEND EMAIL', +// backgroundColor: Color(0xff9EA3A4), +// ), +// ), +// ], +// ); +// }, +// ), + ), + ), + ); + } + + convertDateFormat(String Date) { + const start = "/Date("; + const end = "+0300)"; + + 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'); + + return newDate.toString(); + } + + emailSender() async { + final Email email = Email( + body: 'Email body', + subject: 'Email subject', + recipients: ['example@example.com'], + cc: ['cc@example.com'], + bcc: ['bcc@example.com'], + attachmentPaths: ['/path/to/attachment.zip'], + isHTML: false, + ); + + await FlutterEmailSender.send(email); + } +} + +class SpaceBetweenTexts extends StatelessWidget { + final double space; + SpaceBetweenTexts({this.space}); + + @override + Widget build(BuildContext context) { + return SizedBox( + height: space, + ); + } +} diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index ad58175c..c87818c1 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; class DoctorsListService extends BaseService { @@ -23,7 +22,8 @@ class DoctorsListService extends BaseService { double lat; double long; - Future getDoctorsList(int clinicID, int projectID, BuildContext context, + Future getDoctorsList( + int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName}) async { //Utils.showProgressDialog(context); Map request; @@ -68,6 +68,9 @@ class DoctorsListService extends BaseService { "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, + "IsGetNearAppointment": isNearest, + if (isNearest) + "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true }; diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index cb486762..8cc1e469 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -37,10 +37,10 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_CLINICS_LIST_URL, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -64,14 +64,15 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - Future getChiefComplaintsList(int clinicID, int projectID, BuildContext context, + Future getChiefComplaintsList( + int clinicID, int projectID, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -82,12 +83,6 @@ class ClinicListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && - await this.sharedPref.getDouble(USER_LONG) != null) { - lat = await this.sharedPref.getDouble(USER_LAT); - long = await this.sharedPref.getDouble(USER_LONG); - } - var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -114,11 +109,56 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } + Future getChiefComplaintDoctorList( + int chiefComplaintID, int projectID, BuildContext context, + {doctorId}) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "ChiefComplaintID": chiefComplaintID, + "ProjectID": projectID, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "Latitude": lat.toString(), + "Longitude": long.toString(), + "DeviceTypeID": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 023a1318..808c25de 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -463,6 +463,97 @@ class TranslationBase { String get logs => localizedValues['logs'][locale.languageCode]; String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => + localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => + localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => + localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => + localizedValues['noArrivedAppointments'][locale.languageCode]; + String get myAppointmentsList => + localizedValues['MyAppointmentsList'][locale.languageCode]; + String get radiology => localizedValues['Radiology'][locale.languageCode]; + String get radiologySubtitle => + localizedValues['RadiologySubtitle'][locale.languageCode]; + String get lab => localizedValues['Lab'][locale.languageCode]; + String get labSubtitle => localizedValues['LabSubtitle'][locale.languageCode]; + String get medicines => localizedValues['Medicines'][locale.languageCode]; + String get medicinesSubtitle => + localizedValues['MedicinesSubtitle'][locale.languageCode]; + String get vitalSigns => localizedValues['VitalSigns'][locale.languageCode]; + String get vitalSignsSubtitle => + localizedValues['VitalSignsSubTitle'][locale.languageCode]; + String get myMedical => localizedValues['MyMedical'][locale.languageCode]; + String get myMedicalSubtitle => + localizedValues['MyMedicalSubtitle'][locale.languageCode]; + String get myDoctor => localizedValues['MyDoctor'][locale.languageCode]; + String get myDoctorSubtitle => + localizedValues['MyDoctorSubtitle'][locale.languageCode]; + String get eye => localizedValues['Eye'][locale.languageCode]; + String get eyeSubtitle => localizedValues['EyeSubtitle'][locale.languageCode]; + String get insurance => localizedValues['Insurance'][locale.languageCode]; + String get insuranceSubtitle => + localizedValues['InsuranceSubtitle'][locale.languageCode]; + String get updateInsurance => + localizedValues['UpdateInsurance'][locale.languageCode]; + String get updateInsuranceSubtitle => + localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; + String get insuranceApproval => + localizedValues['InsuranceApproval'][locale.languageCode]; + String get insuranceApprovalSubtitle => + localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; + String get allergies => localizedValues['Allergies'][locale.languageCode]; + String get allergiesSubtitle => + localizedValues['AllergiesSubtitle'][locale.languageCode]; + String get myVaccines => localizedValues['MyVaccines'][locale.languageCode]; + String get myVaccinesSubtitle => + localizedValues['MyVaccinesSubtitle'][locale.languageCode]; + String get medical => localizedValues['Medical'][locale.languageCode]; + String get medicalSubtitle => + localizedValues['MedicalSubtitle'][locale.languageCode]; + String get monthly => localizedValues['Monthly'][locale.languageCode]; + String get monthlySubtitle => + localizedValues['MonthlySubtitle'][locale.languageCode]; + String get sick => localizedValues['Sick'][locale.languageCode]; + String get sickSubtitle => + localizedValues['SickSubtitle'][locale.languageCode]; + String get myBalance => localizedValues['MyBalance'][locale.languageCode]; + String get myBalanceSubtitle => + localizedValues['MyBalanceSubtitle'][locale.languageCode]; + String get patientCall => localizedValues['PatientCall'][locale.languageCode]; + String get patientCallSubtitle => + localizedValues['PatientCallSubtitle'][locale.languageCode]; + String get smartWatches => + localizedValues['SmartWatches'][locale.languageCode]; + String get smartWatchesSubtitle => + localizedValues['SmartWatchesSubtitle'][locale.languageCode]; + String get myTrackers => localizedValues['MyTrackers'][locale.languageCode]; + String get myTrackersSubtitle => + localizedValues['MyTrackersSubtitle'][locale.languageCode]; + String get askYour => localizedValues['AskYour'][locale.languageCode]; + String get askYourSubtitle => + localizedValues['AskYourSubtitle'][locale.languageCode]; + String get internet => localizedValues['Internet'][locale.languageCode]; + String get internetSubtitle => + localizedValues['InternetSubtitle'][locale.languageCode]; + String get chatbot => localizedValues['Chatbot'][locale.languageCode]; + String get chatbotSubtitle => + localizedValues['ChatbotSubtitle'][locale.languageCode]; + String get timeLine => localizedValues['TimeLine'][locale.languageCode]; + String get labOrders => localizedValues['LabOrders'][locale.languageCode]; + String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get prescriptions => + localizedValues['Prescriptions'][locale.languageCode]; + String get history => localizedValues['History'][locale.languageCode]; + String get orderNo => localizedValues['OrderNo'][locale.languageCode]; + String get orderDetails => + localizedValues['OrderDetails'][locale.languageCode]; + String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; + String get monthlyReports => + localizedValues['MonthlyReports'][locale.languageCode]; + String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; String get userViewRequest => @@ -470,6 +561,7 @@ class TranslationBase { String get userView => localizedValues['user-view'][locale.languageCode]; String get sentRequest => localizedValues['sent-requests'][locale.languageCode]; + String get km => localizedValues['km'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index b84b1076..53356095 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -1,5 +1,13 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../text.dart'; @@ -7,8 +15,16 @@ class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; final String details; + final String orderNo; + final PatientLabOrders patientLabOrder; - const LaboratoryResultWidget({Key key, this.onTap, this.billNo, this.details}) + const LaboratoryResultWidget( + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder}) : super(key: key); @override @@ -17,9 +33,12 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMore = false; + bool _isShowMoreGeneral = false; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.all(15), child: Column( @@ -45,7 +64,7 @@ class _LaboratoryResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Bill No'), + Texts('Invoice No'), Texts(widget.billNo), ], ), @@ -102,7 +121,7 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Texts('Result')), + Expanded(child: Texts('Special Result')), Container( width: 25, height: 25, @@ -132,12 +151,211 @@ class _LaboratoryResultWidgetState extends State { bottomRight: Radius.circular(5.0), )), duration: Duration(milliseconds: 7000), - child: Text(widget.details?? 'No Data'), - ) + child: Container( + width: double.infinity, + child: Text(widget.details ?? 'No Data')), + ), + SizedBox(height: 12,), + BaseView( + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrder), + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: Container( + child: Column( + children: [ + InkWell( + onTap: () { + setState(() { + _isShowMoreGeneral = !_isShowMoreGeneral; + }, + ); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded(child: Texts('General Result')), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[900]), + child: Icon( + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMoreGeneral) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + ), + ), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('U/A'), + InkWell( + onTap: () { + model.getPatientLabResult( + patientLabOrder: + widget.patientLabOrder); + }, + child: Texts( + 'Flow Chart', + decoration: TextDecoration.underline, + color: Colors.blue, + ), + ), + ], + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide( + width: 2.0, color: Colors.grey[300]), + ), + children: fullData(model.labResultList), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ) ], ), ], ), ); } + + List fullData(List labResultList) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0.0): Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + ), + ), + child: Center( + child: Texts( + 'Description', + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + + ), + child: Center( + child: Texts('Value', color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(10.0):Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Range', color: Colors.white), + ), + height: 60), + ), + ], + ), + ); + labResultList.forEach((lab) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.resultValue, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + ); + }); + return tableRow; + } } diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 25649b06..cd264111 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -276,7 +276,17 @@ class _SearchBot extends State { case '103': { List clnicID = unique(result['ClinicId']); - goToClinic(clnicID); + if (clnicID.length == 1) { + getDoctorsList( + 0, + clnicID[0], + context, + doctorId: null, + doctorName: null, + ); + } else { + goToClinic(clnicID); + } } break; default: @@ -317,7 +327,7 @@ class _SearchBot extends State { List arrDistance = []; DoctorsListService service = new DoctorsListService(); service - .getDoctorsList(clinicId, projectId, context, + .getDoctorsList(clinicId, projectId, false, context, doctorId: doctorId, doctorName: doctorName) .then((res) { if (res['MessageStatus'] == 1) { diff --git a/pubspec.yaml b/pubspec.yaml index f4c5e5c2..918bca3a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: url_launcher: ^5.5.0 shared_preferences: ^0.5.8 flutter_flexible_toast: ^0.1.4 - firebase_messaging: 6.0.12 + firebase_messaging: ^7.0.0 # Progress bar progress_hud_v2: ^2.0.0 @@ -68,7 +68,7 @@ dependencies: charts_flutter: ^0.9.0 # Qr code Scanner - barcode_scan: any + barcode_scan: ^3.0.1 # Rating Stars rating_bar: ^0.2.0 @@ -99,6 +99,15 @@ dependencies: #hijri hijri: ^2.0.3 + #Email Sender + flutter_email_sender: ^3.0.1 + + #Popup_window + popup_box: ^0.1.0 + + + + #Handle Geolocation geolocator: ^6.0.0+1