diff --git a/assets/images/heartbeat.png b/assets/images/heartbeat.png new file mode 100644 index 00000000..3a83ddee Binary files /dev/null and b/assets/images/heartbeat.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 1ec4417c..038ef7db 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -38,7 +38,13 @@ const SEND_RAD_REPORT_EMAIL = '/Notifications.svc/REST/SendRadReportEmail'; ///Feedback const SEND_FEEDBACK = '/COCWS.svc/REST/InsertCOCItemInSPList'; const GET_STATUS_FOR_COCO = '/COCWS.svc/REST/GetStatusforCOC'; +const GET_PATIENT_AppointmentHistory = '/Doctors.svc/REST/PateintHasAppoimentHistory'; +///VITAL SIGN +const GET_PATIENT_VITAL_SIGN = '/Doctors.svc/REST/Doctor_GetPatientVitalSign'; + + +//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment //const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment //const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4a79da88..48168f0a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -11,7 +11,7 @@ const Map> localizedValues = { 'services': {'en': 'SERVICES', 'ar': 'الخدمات'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, - + 'respirationRate':{'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, 'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'}, 'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'}, 'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, @@ -214,6 +214,17 @@ const Map> localizedValues = { "sent-requests": {"en": "Sent Requests", "ar": "الطلبات المرسلة"}, "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, + 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, + 'bodyMeasurements': {'en': 'body Mass', 'ar': 'قياسات الجسم'}, + 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, + 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, + 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, + 'bloodPressure': {'en': 'Blood Pressure', 'ar': 'ضغط الدم'}, + 'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'}, + 'weight' : {'en':'Weight','ar':'الوزن'}, + 'height' : {'en':'Height','ar':'الطول'}, + 'heart' :{'en':'Heart','ar':'قلب'}, + "request": {"en": "Request", "ar": "طلبات الاضافة"}, "member-name": {"en": "Member Name", "ar": "اسم العضو"}, "switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, diff --git a/lib/core/enum/patient_lookup.dart b/lib/core/enum/patient_lookup.dart new file mode 100644 index 00000000..08de54b2 --- /dev/null +++ b/lib/core/enum/patient_lookup.dart @@ -0,0 +1,39 @@ +const PATIENT_TYPE = const [ + {"text": "outPatiant", "text_ar": "المريض الخارجي", "val": "0"}, + {"text": "InPatiant", "text_ar": "المريض المنوم", "val": "1"}, + {"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"}, + {"text": "Referrd", "text_ar": "المريض المحول الي", "val": "3"}, + { + "text": "Referral Discharge", + "text_ar": "المريض المحال المعافى", + "val": "4" + }, + {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, + {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, +]; + +const LOCATIONS = const [ + { + "text": "In Saudi Arabia", + "text-ar": "داخل المملكة العربية السعودية", + "val": "1" + }, + { + "text": "Out Saudi Arabia", + "text-ar": "خارج المملكة العربية السعودية", + "val": "2" + }, +]; + +enum VitalSignDetails { + BodyMeasurements, + Temperature, + Pulse, + Prescriptions, + BloodPressure, + Respiration, + heart, + PainScale, + Weight, + Height +} diff --git a/lib/core/model/vital_sign/vital_sign_req_model.dart b/lib/core/model/vital_sign/vital_sign_req_model.dart new file mode 100644 index 00000000..7cad3ef7 --- /dev/null +++ b/lib/core/model/vital_sign/vital_sign_req_model.dart @@ -0,0 +1,69 @@ +class VitalSignReqModel { + int patientID; + int projectID; + int patientTypeID; + int inOutpatientType; + int transNo; + int languageID; + String stamp ; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + VitalSignReqModel( + {this.patientID, + this.projectID, + this.inOutpatientType, + this.transNo, + this.languageID, + this.tokenID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress='11.11.11.11', + this.versionID=1.2, + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.isLoginForDoctorApp=true, + this.patientTypeID, + this.patientOutSA=false}); + + VitalSignReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + languageID = json['LanguageID']; + inOutpatientType = json['InOutpatientType']; + transNo = json['TransNo']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InOutPatientType'] = this.inOutpatientType; + data['TransNo'] = this.transNo; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } + +} diff --git a/lib/core/model/vital_sign/vital_sign_res_model.dart b/lib/core/model/vital_sign/vital_sign_res_model.dart new file mode 100644 index 00000000..1377e626 --- /dev/null +++ b/lib/core/model/vital_sign/vital_sign_res_model.dart @@ -0,0 +1,259 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class VitalSignResModel { + var transNo; + var projectID; + var weightKg; + var heightCm; + var temperatureCelcius; + var pulseBeatPerMinute; + var respirationBeatPerMinute; + var bloodPressureLower; + var bloodPressureHigher; + var sAO2; + var fIO2; + var painScore; + var bodyMassIndex; + var headCircumCm; + var leanBodyWeightLbs; + var idealBodyWeightLbs; + var temperatureCelciusMethod; + var pulseRhythm; + var respirationPattern; + var bloodPressureCuffLocation; + var bloodPressureCuffSize; + var bloodPressurePatientPosition; + var painLocation; + var painDuration; + var painCharacter; + var painFrequency; + bool isPainManagementDone; + var status; + bool isVitalsRequired; + var patientID; + var createdOn; + var doctorID; + var clinicID; + var triageCategory; + var gCScore; + var lineItemNo; + DateTime vitalSignDate; + var actualTimeTaken; + var sugarLevel; + var fBS; + var rBS; + var observationType; + var heartRate; + var muscleTone; + var reflexIrritability; + var bodyColor; + var isFirstAssessment; + var dateofBirth; + var timeOfBirth; + var bloodPressure; + var bloodPressureCuffLocationDesc; + var bloodPressureCuffSizeDesc; + var bloodPressurePatientPositionDesc; + var clinicName; + var doctorImageURL; + var doctorName; + var painScoreDesc; + var pulseRhythmDesc; + var respirationPatternDesc; + var temperatureCelciusMethodDesc; + var time; + + VitalSignResModel( + {this.transNo, + this.projectID, + this.weightKg, + this.heightCm, + this.temperatureCelcius, + this.pulseBeatPerMinute, + this.respirationBeatPerMinute, + this.bloodPressureLower, + this.bloodPressureHigher, + this.sAO2, + this.fIO2, + this.painScore, + this.bodyMassIndex, + this.headCircumCm, + this.leanBodyWeightLbs, + this.idealBodyWeightLbs, + this.temperatureCelciusMethod, + this.pulseRhythm, + this.respirationPattern, + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressurePatientPosition, + this.painLocation, + this.painDuration, + this.painCharacter, + this.painFrequency, + this.isPainManagementDone, + this.status, + this.isVitalsRequired, + this.patientID, + this.createdOn, + this.doctorID, + this.clinicID, + this.triageCategory, + this.gCScore, + this.lineItemNo, + this.vitalSignDate, + this.actualTimeTaken, + this.sugarLevel, + this.fBS, + this.rBS, + this.observationType, + this.heartRate, + this.muscleTone, + this.reflexIrritability, + this.bodyColor, + this.isFirstAssessment, + this.dateofBirth, + this.timeOfBirth, + this.bloodPressure, + this.bloodPressureCuffLocationDesc, + this.bloodPressureCuffSizeDesc, + this.bloodPressurePatientPositionDesc, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.painScoreDesc, + this.pulseRhythmDesc, + this.respirationPatternDesc, + this.temperatureCelciusMethodDesc, + this.time}); + + VitalSignResModel.fromJson(Map json) { + transNo = json['TransNo']; + projectID = json['ProjectID']; + weightKg = json['WeightKg']; + heightCm = json['HeightCm']; + temperatureCelcius = json['TemperatureCelcius']; + pulseBeatPerMinute = json['PulseBeatPerMinute']; + respirationBeatPerMinute = json['RespirationBeatPerMinute']; + bloodPressureLower = json['BloodPressureLower']; + bloodPressureHigher = json['BloodPressureHigher']; + sAO2 = json['SAO2']; + fIO2 = json['FIO2']; + painScore = json['PainScore']; + bodyMassIndex = json['BodyMassIndex']; + headCircumCm = json['HeadCircumCm']; + leanBodyWeightLbs = json['LeanBodyWeightLbs']; + idealBodyWeightLbs = json['IdealBodyWeightLbs']; + temperatureCelciusMethod = json['TemperatureCelciusMethod']; + pulseRhythm = json['PulseRhythm']; + respirationPattern = json['RespirationPattern']; + bloodPressureCuffLocation = json['BloodPressureCuffLocation']; + bloodPressureCuffSize = json['BloodPressureCuffSize']; + bloodPressurePatientPosition = json['BloodPressurePatientPosition']; + painLocation = json['PainLocation']; + painDuration = json['PainDuration']; + painCharacter = json['PainCharacter']; + painFrequency = json['PainFrequency']; + isPainManagementDone = json['IsPainManagementDone']; + status = json['Status']; + isVitalsRequired = json['IsVitalsRequired']; + patientID = json['PatientID']; + createdOn = json['CreatedOn']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + triageCategory = json['TriageCategory']; + gCScore = json['GCScore']; + lineItemNo = json['LineItemNo']; + vitalSignDate = DateUtil.convertStringToDate(json['CreatedOn']); + actualTimeTaken = json['ActualTimeTaken']; + sugarLevel = json['SugarLevel']; + fBS = json['FBS']; + rBS = json['RBS']; + observationType = json['ObservationType']; + heartRate = json['HeartRate']; + muscleTone = json['MuscleTone']; + reflexIrritability = json['ReflexIrritability']; + bodyColor = json['BodyColor']; + isFirstAssessment = json['IsFirstAssessment']; + dateofBirth = json['DateofBirth']; + timeOfBirth = json['TimeOfBirth']; + bloodPressure = json['BloodPressure']; + bloodPressureCuffLocationDesc = json['BloodPressureCuffLocationDesc']; + bloodPressureCuffSizeDesc = json['BloodPressureCuffSizeDesc']; + bloodPressurePatientPositionDesc = json['BloodPressurePatientPositionDesc']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + painScoreDesc = json['PainScoreDesc']; + pulseRhythmDesc = json['PulseRhythmDesc']; + respirationPatternDesc = json['RespirationPatternDesc']; + temperatureCelciusMethodDesc = json['TemperatureCelciusMethodDesc']; + time = json['Time']; + } + + Map toJson() { + final Map data = new Map(); + data['TransNo'] = this.transNo; + data['ProjectID'] = this.projectID; + data['WeightKg'] = this.weightKg; + data['HeightCm'] = this.heightCm; + data['TemperatureCelcius'] = this.temperatureCelcius; + data['PulseBeatPerMinute'] = this.pulseBeatPerMinute; + data['RespirationBeatPerMinute'] = this.respirationBeatPerMinute; + data['BloodPressureLower'] = this.bloodPressureLower; + data['BloodPressureHigher'] = this.bloodPressureHigher; + data['SAO2'] = this.sAO2; + data['FIO2'] = this.fIO2; + data['PainScore'] = this.painScore; + data['BodyMassIndex'] = this.bodyMassIndex; + data['HeadCircumCm'] = this.headCircumCm; + data['LeanBodyWeightLbs'] = this.leanBodyWeightLbs; + data['IdealBodyWeightLbs'] = this.idealBodyWeightLbs; + data['TemperatureCelciusMethod'] = this.temperatureCelciusMethod; + data['PulseRhythm'] = this.pulseRhythm; + data['RespirationPattern'] = this.respirationPattern; + data['BloodPressureCuffLocation'] = this.bloodPressureCuffLocation; + data['BloodPressureCuffSize'] = this.bloodPressureCuffSize; + data['BloodPressurePatientPosition'] = this.bloodPressurePatientPosition; + data['PainLocation'] = this.painLocation; + data['PainDuration'] = this.painDuration; + data['PainCharacter'] = this.painCharacter; + data['PainFrequency'] = this.painFrequency; + data['IsPainManagementDone'] = this.isPainManagementDone; + data['Status'] = this.status; + data['IsVitalsRequired'] = this.isVitalsRequired; + data['PatientID'] = this.patientID; + data['CreatedOn'] = this.createdOn; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['TriageCategory'] = this.triageCategory; + data['GCScore'] = this.gCScore; + data['LineItemNo'] = this.lineItemNo; + data['VitalSignDate'] = this.vitalSignDate; + data['ActualTimeTaken'] = this.actualTimeTaken; + data['SugarLevel'] = this.sugarLevel; + data['FBS'] = this.fBS; + data['RBS'] = this.rBS; + data['ObservationType'] = this.observationType; + data['HeartRate'] = this.heartRate; + data['MuscleTone'] = this.muscleTone; + data['ReflexIrritability'] = this.reflexIrritability; + data['BodyColor'] = this.bodyColor; + data['IsFirstAssessment'] = this.isFirstAssessment; + data['DateofBirth'] = this.dateofBirth; + data['TimeOfBirth'] = this.timeOfBirth; + data['BloodPressure'] = this.bloodPressure; + data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; + data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['PainScoreDesc'] = this.painScoreDesc; + data['PulseRhythmDesc'] = this.pulseRhythmDesc; + data['RespirationPatternDesc'] = this.respirationPatternDesc; + data['TemperatureCelciusMethodDesc'] = this.temperatureCelciusMethodDesc; + data['Time'] = this.time; + return data; + } +} diff --git a/lib/core/service/base_service.dart b/lib/core/service/base_service.dart index 828420c7..aee938c6 100644 --- a/lib/core/service/base_service.dart +++ b/lib/core/service/base_service.dart @@ -1,9 +1,23 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'client/base_app_client.dart'; -class BaseService{ +class BaseService { String error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); + AuthenticatedUser user; -} \ No newline at end of file + AppSharedPreferences sharedPref = AppSharedPreferences(); + + BaseService() { + getUser(); + } + + getUser() async { + user = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 05cb0f8b..edf2b9c6 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -31,8 +31,8 @@ class BaseAppClient { body['LanguageID'] = LANGUAGE; body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; - // body['PatientOutSA'] = PATIENT_OUT_SA; - body['SessionID'] = null; //SESSION_ID; + body['PatientOutSA'] = PATIENT_OUT_SA; + body['SessionID'] = SESSION_ID; body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; body['DeviceTypeID'] = DeviceTypeID; body['PatientType'] = PATIENT_TYPE; diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index eaf2f94a..39065f48 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -4,16 +4,20 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class FeedbackService extends BaseService { List cOCItemList = List(); RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem(); + List appointHistoryList = List(); Future sendCOCItem( {String title, String details, String cOCTypeName, - String attachment}) async { + String attachment, + AppointmentHistory appointHistory}) async { hasError = false; _requestInsertCOCItem.attachment = attachment; @@ -21,23 +25,35 @@ class FeedbackService extends BaseService { _requestInsertCOCItem.details = details; _requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName; - _requestInsertCOCItem.mobileNo = - "966537503378"; //TODO Change it to be dynamic + _requestInsertCOCItem.mobileNo = user.mobileNumber; _requestInsertCOCItem.isUserLoggedIn = true; - _requestInsertCOCItem.projectID = 1231755; - _requestInsertCOCItem.patientName = "TAMER FANASHEH"; + _requestInsertCOCItem.projectID = user.projectID; + _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.fileName = ""; + _requestInsertCOCItem.appVersion = VERSION_ID; _requestInsertCOCItem.uILanguage = "ar"; //TODO Change it to be dynamic _requestInsertCOCItem.browserInfo = Platform.localHostname; _requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.projectID = 0; - _requestInsertCOCItem.identificationNo = 2344670985; + _requestInsertCOCItem.identificationNo = + int.parse(user.patientIdentificationNo); + + final Map body = _requestInsertCOCItem.toJson(); + + if (appointHistory != null) { + body['AppoinmentNo'] = appointHistory.appointmentNo; + body['AppointmentDate'] = + DateUtil.convertDateToString(appointHistory.appointmentDate); + body['ClinicID'] = appointHistory.clinicID; + body['ClinicName'] = appointHistory.clinicName; + body['DoctorID'] = appointHistory.doctorID; + body['DoctorName'] = appointHistory.doctorNameObj; + body['ProjectName'] = appointHistory.projectName; + } await baseAppClient - .post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) { - var asd = ""; - }, + .post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -46,9 +62,9 @@ class FeedbackService extends BaseService { Future getStatusCOC() async { hasError = false; - Map body = new Map(); - body['IdentificationNo'] = '2344670985'; - body['MobileNo'] = '966537503378'; + Map body = new Map(); + body['IdentificationNo'] = user.patientIdentificationNo; + body['MobileNo'] = user.mobileNumber; body['Searching_type'] = '1'; await baseAppClient.post(GET_STATUS_FOR_COCO, @@ -62,4 +78,20 @@ class FeedbackService extends BaseService { super.error = error; }, body: body); } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsComingFromCOC'] = true; + 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); + } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index cad5696a..98f8110e 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,10 +1,4 @@ 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/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'; @@ -14,78 +8,74 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class LabsService extends BaseService { - - RequestPatientLabOrders _requestPatientLabOrders = RequestPatientLabOrders(); List patientLabOrdersList = List(); - Future getPatientLabOrdersList() async { await baseAppClient.post(GET_Patient_LAB_ORDERS, onSuccess: (dynamic response, int statusCode) { - patientLabOrdersList.clear(); - response['ListPLO'].forEach((hospital) { - patientLabOrdersList - .add(PatientLabOrders.fromJson(hospital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestPatientLabOrders.toJson()); + patientLabOrdersList.clear(); + response['ListPLO'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPatientLabOrders.toJson()); } - - RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = + RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); Future getLaboratoryResult( - {String projectID, int clinicID, String invoiceNo, String orderNo}) async { - hasError = false; + {String projectID, + int clinicID, + String invoiceNo, + String orderNo}) async { + hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; - _requestPatientLabSpecialResult.invoiceNo = invoiceNo;//'1800296522';//; + _requestPatientLabSpecialResult.invoiceNo = invoiceNo; //'1800296522';//; _requestPatientLabSpecialResult.orderNo = orderNo; await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) { - patientLabSpecialResult.clear(); - response['ListPLSR'].forEach((hospital) { - patientLabSpecialResult - .add(PatientLabSpecialResult.fromJson(hospital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestPatientLabSpecialResult.toJson()); + patientLabSpecialResult.clear(); + response['ListPLSR'].forEach((hospital) { + patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPatientLabSpecialResult.toJson()); } - RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - - Future sendLabReportEmail( - {PatientLabOrders patientLabOrder}) async { + RequestSendLabReportEmail _requestSendLabReportEmail = + RequestSendLabReportEmail(); + Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; - _requestSendLabReportEmail.patientName = 'Tamer';//TODO Change it - _requestSendLabReportEmail.patientIditificationNum = '2344670985';//TODO change it - _requestSendLabReportEmail.dateofBirth = '/Date(536743800000+0300)/';//TODO change it - _requestSendLabReportEmail.to = 'Tamer.fanasheh@gmail.com';//TODO change it - _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; - _requestSendLabReportEmail.patientMobileNumber = '537503378';//TODO change it + _requestSendLabReportEmail.patientName = user.firstName + user.lastName; + _requestSendLabReportEmail.patientIditificationNum = + user.patientIdentificationNo; + _requestSendLabReportEmail.dateofBirth = user.dateofBirth; + _requestSendLabReportEmail.to = user.emailAddress; + _requestSendLabReportEmail.orderDate = + '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; + _requestSendLabReportEmail.patientMobileNumber = user.mobileNumber; _requestSendLabReportEmail.projectName = patientLabOrder.projectName; await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestSendLabReportEmail.toJson()); + AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestSendLabReportEmail.toJson()); } - - } diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index e14206d5..b3cb737b 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -1,25 +1,13 @@ 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/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'; -import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart'; -import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; - Future getRadImageURL({int invoiceNo, int lineItem,int projectId}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; @@ -36,7 +24,7 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders () async { + Future getPatientRadOrders() async { hasError = false; await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { @@ -67,29 +55,25 @@ class RadiologyService extends BaseService { RequestSendRadReportEmail _requestSendRadReportEmail = RequestSendRadReportEmail(); - Future sendRadReportEmail( - {FinalRadiology finalRadiology}) async { + Future sendRadReportEmail({FinalRadiology finalRadiology}) async { _requestSendRadReportEmail.projectID = finalRadiology.projectID; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; _requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName; _requestSendRadReportEmail.orderDate = '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}'; - _requestSendRadReportEmail.patientIditificationNum = '2344670985';//TODO change it - _requestSendRadReportEmail.patientMobileNumber = '537503378';//TODO change it - _requestSendRadReportEmail.patientName = 'TAMER FANASHE';//TODO change it - _requestSendRadReportEmail.patientIditificationNum = '2344670985';//TODO change it + _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; + _requestSendRadReportEmail.patientMobileNumber = user.mobileNumber; + _requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; + _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendRadReportEmail.projectName = finalRadiology.projectName; - _requestSendRadReportEmail.radResult = 'asd';//finalRadiology.reportData; - _requestSendRadReportEmail.to = 'Tamer.fanasheh@gmail.com'; - _requestSendRadReportEmail.dateofBirth = '/Date(536743800000+0300)/'; + _requestSendRadReportEmail.radResult = 'asd'; //finalRadiology.reportData; + _requestSendRadReportEmail.to = user.emailAddress; + _requestSendRadReportEmail.dateofBirth = user.dateofBirth; hasError = false; await baseAppClient.post(SEND_RAD_REPORT_EMAIL, - isAllowAny: true, - onSuccess: (dynamic response, int statusCode) { - - }, + isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/vital_sign_service.dart b/lib/core/service/medical/vital_sign_service.dart new file mode 100644 index 00000000..813332cc --- /dev/null +++ b/lib/core/service/medical/vital_sign_service.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; + +import '../base_service.dart'; + +class VitalSignService extends BaseService { + + List vitalSignResModelList = List(); + + Future getPatientRadOrders () async { + hasError = false; + await baseAppClient.post(GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + vitalSignResModelList.clear(); + response['List_DoctorPatientVitalSign'].forEach((vital) { + vitalSignResModelList.add(VitalSignResModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + + +} diff --git a/lib/core/viewModels/feedback/feedback_view_model.dart b/lib/core/viewModels/feedback/feedback_view_model.dart index 1176caf7..5f464322 100644 --- a/lib/core/viewModels/feedback/feedback_view_model.dart +++ b/lib/core/viewModels/feedback/feedback_view_model.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; import 'package:diplomaticquarterapp/core/service/feedback/feedback_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import '../../../locator.dart'; @@ -10,17 +11,22 @@ class FeedbackViewModel extends BaseViewModel { List get cOCItemList => _feedbackService.cOCItemList; + List get appointHistoryList => + _feedbackService.appointHistoryList; + Future sendCOCItem( {String title, String details, String cOCTypeName, - String attachment}) async { + String attachment, + AppointmentHistory appointHistory}) async { setState(ViewState.BusyLocal); await _feedbackService.sendCOCItem( title: title, details: details, cOCTypeName: cOCTypeName, - attachment: attachment); + attachment: attachment, + appointHistory: appointHistory); if (_feedbackService.hasError) { error = _feedbackService.error; setState(ViewState.ErrorLocal); @@ -41,4 +47,15 @@ class FeedbackViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _feedbackService.getPatentAppointmentHistory(); + if (_feedbackService.hasError) { + error = _feedbackService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModels/medical/vital_sign_view_model.dart b/lib/core/viewModels/medical/vital_sign_view_model.dart new file mode 100644 index 00000000..5a2d8514 --- /dev/null +++ b/lib/core/viewModels/medical/vital_sign_view_model.dart @@ -0,0 +1,23 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class VitalSignViewModel extends BaseViewModel { + VitalSignService _vitalSignService = locator(); + + List get vitalSignResModelList => _vitalSignService.vitalSignResModelList; + + + getPatientRadOrders() async { + setState(ViewState.Busy); + await _vitalSignService.getPatientRadOrders(); + if (_vitalSignService.hasError) { + error = _vitalSignService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 5806ca70..f884edcb 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -7,12 +7,14 @@ import 'core/service/medical/labs_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/vital_sign_service.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/medical/labs_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/vital_sign_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; @@ -31,6 +33,8 @@ void setupLocator() { locator.registerLazySingleton(() => RadiologyService()); locator.registerLazySingleton(() => FeedbackService()); locator.registerLazySingleton(() => InsuranceCardService()); + locator.registerLazySingleton(() => VitalSignService()); + /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -40,6 +44,6 @@ void setupLocator() { locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => RadiologyViewModel()); locator.registerFactory(() => FeedbackViewModel()); - + locator.registerFactory(() => VitalSignViewModel()); locator.registerFactory(() => InsuranceViewModel()); } diff --git a/lib/pages/feedback/appointment_history.dart b/lib/pages/feedback/appointment_history.dart new file mode 100644 index 00000000..cfbd5800 --- /dev/null +++ b/lib/pages/feedback/appointment_history.dart @@ -0,0 +1,276 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AppointmentHistory { + String setupID; + int projectID; + int appointmentNo; + DateTime appointmentDate; + Null appointmentDateN; + int appointmentType; + String bookDate; + int patientType; + int patientID; + int clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + int status; + int visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + String arrivedOn; + Null editedBy; + Null editedOn; + Null doctorName; + Null doctorNameN; + String statusDesc; + Null statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + int actualDoctorRate; + String clinicName; + bool complainExists; + String doctorImageURL; + String doctorNameObj; + int doctorRate; + List doctorSpeciality; + String doctorTitle; + int gender; + String genderDescription; + bool iSAllowOnlineCheckedIN; + bool isActiveDoctor; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int isFollowup; + bool isLiveCareAppointment; + bool isMedicalReportRequested; + bool isOnlineCheckedIN; + String latitude; + Null listHISGetContactLensPerscription; + Null listHISGetGlassPerscription; + String longitude; + int nextAction; + int noOfPatientsRate; + int originalClinicID; + int originalProjectID; + String projectName; + String qR; + int remaniningHoursTocanPay; + bool sMSButtonVisable; + + AppointmentHistory( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable}); + + AppointmentHistory.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = DateUtil.convertStringToDate(json['AppointmentDate']); + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = json['BookDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + complainExists = json['ComplainExists']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; + doctorRate = json['DoctorRate']; +// doctorSpeciality = json['DoctorSpeciality'].cast(); + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + isActiveDoctor = json['IsActiveDoctor']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isMedicalReportRequested = json['IsMedicalReportRequested']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + latitude = json['Latitude']; + listHISGetContactLensPerscription = + json['List_HIS_GetContactLensPerscription']; + listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription']; + longitude = json['Longitude']; + nextAction = json['NextAction']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + originalProjectID = json['OriginalProjectID']; + projectName = json['ProjectName']; + qR = json['QR']; + remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; + sMSButtonVisable = json['SMSButtonVisable']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['ComplainExists'] = this.complainExists; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorRate'] = this.doctorRate; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['IsActiveDoctor'] = this.isActiveDoctor; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsMedicalReportRequested'] = this.isMedicalReportRequested; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Latitude'] = this.latitude; + data['List_HIS_GetContactLensPerscription'] = + this.listHISGetContactLensPerscription; + data['List_HIS_GetGlassPerscription'] = this.listHISGetGlassPerscription; + data['Longitude'] = this.longitude; + data['NextAction'] = this.nextAction; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['OriginalProjectID'] = this.originalProjectID; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; + data['SMSButtonVisable'] = this.sMSButtonVisable; + return data; + } +} diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 92bfaff7..68f0bfab 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'Status_feedback_page.dart'; +import 'status_feedback_page.dart'; class FeedbackHomePage extends StatefulWidget { @override diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 801a0a37..436dae62 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -2,15 +2,21 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'appointment_history.dart'; + enum MessageType { ComplaintOnAnAppointment, ComplaintWithoutAppointment, @@ -32,7 +38,8 @@ class _SendFeedbackPageState extends State { String _selected = "not selected"; List images = []; String title; - + AppointmentHistory appointHistory; + bool isShowListAppointHistory = true; String message; final formKey = GlobalKey(); @@ -63,7 +70,7 @@ class _SendFeedbackPageState extends State { ), InkWell( onTap: () { - confirmBox(); + confirmBox(model); }, child: Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -93,6 +100,189 @@ class _SendFeedbackPageState extends State { ), ), ), + if (appointHistory != null) + InkWell( + onTap: () { + setState(() { + isShowListAppointHistory = true; + }); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointHistory.doctorNameObj, + url: appointHistory.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + appointHistory.doctorNameObj, + bold: true, + ), + Texts( + DateUtil + .getMonthDayYearDateFormatted( + appointHistory + .appointmentDate), + variant: 'caption3', + ), + StarRating( + totalAverage: appointHistory + .doctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, + ), + ), + ) + ], + ), + ), + ), + if (messageType == MessageType.ComplaintOnAnAppointment && + model.appointHistoryList.length != 0 && + isShowListAppointHistory) + Container( + height: MediaQuery.of(context).size.height * 0.4, + child: ListView.builder( + itemCount: model.appointHistoryList.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + setState(() { + appointHistory = model.appointHistoryList[index]; + isShowListAppointHistory = false; + }); + }, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + color: Colors.white, + child: Column( + children: [ + Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: model + .appointHistoryList[ + index] + .doctorNameObj, + url: model + .appointHistoryList[ + index] + .doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Texts( + model + .appointHistoryList[ + index] + .doctorNameObj, + bold: true, + ), + Texts( + DateUtil.getMonthDayYearDateFormatted(model + .appointHistoryList[ + index] + .appointmentDate), + variant: 'caption3', + ), + StarRating( + totalAverage: model + .appointHistoryList[ + index] + .doctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, + ), + ), + ) + ], + ), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[400], + ) + ], + ), + ), + ), + ), + ), Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( @@ -219,7 +409,11 @@ class _SendFeedbackPageState extends State { title: titleController.text, attachment: images.length > 0 ? images[0] : "", details: messageController.text, - cOCTypeName: getCOCName()) + cOCTypeName: getCOCName(), + appointHistory: messageType == + MessageType.ComplaintOnAnAppointment + ? appointHistory + : null) .then((value) { if (value) { setState(() { @@ -228,11 +422,10 @@ class _SendFeedbackPageState extends State { images = []; messageType = MessageType.NON; }); - AppToast.showSuccessToast(message: "Your feedback was sended"); - + AppToast.showSuccessToast( + message: "Your feedback was send"); } else { AppToast.showErrorToast(message: model.error); - } }); else { @@ -272,11 +465,21 @@ class _SendFeedbackPageState extends State { } // Show Dialog function - void confirmBox() { + void confirmBox(FeedbackViewModel model) { showDialog( context: context, child: FeedbackTypeDialog( - onValueChange: _onValueChange, + onValueChange: (MessageType value) { + if (value == MessageType.ComplaintOnAnAppointment) { + model.getPatentAppointmentHistory(); + setState(() { + appointHistory = null; + }); + } + setState(() { + messageType = value; + }); + }, initialValue: messageType, onValueSelected: () { setState(() { @@ -304,12 +507,6 @@ class _SendFeedbackPageState extends State { }, )); } - - void _onValueChange(MessageType value) { - setState(() { - messageType = value; - }); - } } class FeedbackTypeDialog extends StatefulWidget { diff --git a/lib/pages/feedback/Status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart similarity index 83% rename from lib/pages/feedback/Status_feedback_page.dart rename to lib/pages/feedback/status_feedback_page.dart index 7fc01d06..20ef4bed 100644 --- a/lib/pages/feedback/Status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -21,7 +21,7 @@ class _StatusFeedbackPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, body: Container( - margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0,bottom: MediaQuery.of(context).size.height * 0.1 ), + margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ), padding: EdgeInsets.all(15.0), child: ListView.builder( itemCount: model.cOCItemList.length, @@ -74,24 +74,6 @@ class _StatusFeedbackPageState extends State { ), )), ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, - width: double.infinity, - padding: EdgeInsets.all(8.0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.1, - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: 'Search', - loading: model.state == ViewState.BusyLocal, - onTap: () { - //TODO When come back - }, - ), - ), - ), - ), ), ); } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 0c7f662b..d3c4e378 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -3,6 +3,7 @@ import 'dart:math'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.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/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart'; @@ -149,10 +150,14 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: 'Vital Signs', - imagePath: 'medical_history_icon.png', - subTitle: 'Reports', + child: InkWell( + onTap: () => Navigator.push(context, + FadePage(page: VitalSignDetailsScreen())), + child: MedicalProfileItem( + title: 'Vital Signs', + imagePath: 'medical_history_icon.png', + subTitle: 'Reports', + ), ), ), ]), @@ -171,12 +176,11 @@ class _MedicalProfilePageState extends State { subTitle: 'Card', ), ), - ), Expanded( + ), + Expanded( flex: 1, child: InkWell( - onTap: () { - - }, + onTap: () {}, child: MedicalProfileItem( title: 'new', imagePath: 'insurance_card_icon.png', diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart new file mode 100644 index 00000000..61da0967 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -0,0 +1,188 @@ +import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item_details_screen.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'; +import 'package:flutter/material.dart'; + +import '../../../d_q_icons_icons.dart'; + +class VitalSignDetailsScreen extends StatelessWidget { + static const String url = "assets/images/"; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(), + builder: (_, mode, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Vital Sign', + baseViewModel: mode, + body: mode.vitalSignResModelList.length> 0? Container( + child: ListView( + children: [ + Row( + children: [ + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Height, + pageTitle: 'Height', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).height, + icon: DQIcons.height, + lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].heightCm.toString(), + unit: ' Cm', + ), + ), + ), + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Weight, + pageTitle: 'Weight', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: VitalSignItem( + des: TranslationBase.of(context).weight, + icon: DQIcons.weight_scale, + unit: ' Kg', + lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].weightKg.toString(), + ), + ), + + ], + ), + Row( + children: [ + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.BodyMeasurements, + pageTitle: 'BMI', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: VitalSignItem( + des: TranslationBase.of(context).bodyMeasurements, + icon: DQIcons.bmi, + lastVal: mode.vitalSignResModelList[1].pulseBeatPerMinute + .toString(), + unit: 'BMI', + ), + ), + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Temperature, + pageTitle: 'Temperature', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).temperature, + icon: DQIcons.thermometer, + lastVal: mode + .vitalSignResModelList[1].temperatureCelcius + .toString(), + unit: 'C', + ), + ), + ), + + ], + ), + Row( + children: [ + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.heart, + pageTitle: 'Hart ', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: VitalSignItem( + des: TranslationBase.of(context).heart, + icon: DQIcons.heart, + lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].pulseBeatPerMinute + .toString(), + unit: ' bpm', + ), + ), + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.Respiration, + pageTitle: 'Respiration Rate', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: VitalSignItem( + des: TranslationBase.of(context).respirationRate, + icon: DQIcons.outline, + lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length-1].respirationBeatPerMinute.toString(), + unit: ' bmp', + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: VitalSignDetails.BloodPressure, + pageTitle: 'BloodPressure', + vitalList: mode.vitalSignResModelList, + ), + ), + ), + child: VitalSignItem( + des: TranslationBase.of(context).pulse, + icon: DQIcons.blood_pressure, + lastVal: mode.vitalSignResModelList[mode.vitalSignResModelList.length -1].bloodPressure + .toString(), + unit: ' SBP/DBP', + ), + ), + ], + ), + ], + ), + ) : Center(child: Texts('No Data'),), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart new file mode 100644 index 00000000..ad5c6ffb --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class VitalSignDetailsWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String viewKey; + + VitalSignDetailsWidget( + {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + widget.title1, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts(widget.title2, color: Colors.white), + ), + height: 60), + ) + ])); + widget.vitalList.forEach((vital) { + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart new file mode 100644 index 00000000..9586fb25 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -0,0 +1,91 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class VitalSignItem extends StatelessWidget { + const VitalSignItem( + {Key key, + @required this.des, + this.lastVal = 'N/A', + this.unit = '', + this.height, + this.width, + @required this.icon}) + : super(key: key); + + final String des; + final String lastVal; + final String unit; + final IconData icon; + final double height; + final double width; + + @override + Widget build(BuildContext context) { + return RoundedContainer( + margin: 0.025 * SizeConfig.realScreenWidth, + height: 0.15 * SizeConfig.realScreenHeight, + width: 0.45 * SizeConfig.realScreenWidth, + child: Container( + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 0.10 * SizeConfig.realScreenHeight, + child: Row( + children: [ + Expanded( + flex: 2, + child: Align( + alignment: Alignment.topLeft, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + des, + style: TextStyle( + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Hexcolor('#B8382C'), + fontWeight: FontWeight.bold,), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container(child: Icon(icon,size: 40,),), + ) + ], + ), + ), + Expanded( + child: Container( + width: double.infinity, + child: Align( + alignment: Alignment.topRight, + child: Container( + margin: EdgeInsets.only(left: 5,right: 5), + child: RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan(text: lastVal), + TextSpan( + text: unit, + style: TextStyle( + color: Hexcolor('#B8382C'), + ), + ), + ]), + ), + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart new file mode 100644 index 00000000..802aae38 --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -0,0 +1,189 @@ +import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class VitalSignItemDetailsScreen extends StatelessWidget { + final VitalSignDetails pageKey; + final String pageTitle; + List VSchart; + + VitalSignItemDetailsScreen({this.vitalList, this.pageKey, this.pageTitle}); + + final List vitalList; + + @override + Widget build(BuildContext context) { + switch (pageKey) { + case VitalSignDetails.BodyMeasurements: + VSchart = [ + { + 'name': 'Height', + 'title1': 'Date', + 'title2': 'Cm', + 'viewKey': 'HeightCm', + }, + { + 'name': 'Weight Kg', + 'title1': 'Date', + 'title2': 'Kg', + 'viewKey': 'WeightKg', + }, + { + 'name': 'BodyMassIndex', + 'title1': 'Date', + 'title2': 'BodyMass', + 'viewKey': 'BodyMassIndex', + }, + { + 'name': 'HeadCircumCm', + 'title1': 'Date', + 'title2': 'Cm', + 'viewKey': 'HeadCircumCm', + }, + { + 'name': 'Ideal Body Weight (Lbs)', + 'title1': 'Date', + 'title2': 'Ideal Weight', + 'viewKey': 'IdealBodyWeightLbs', + }, + { + 'name': 'LeanBodyWeightLbs (Lbs)', + 'title1': 'Date', + 'title2': 'Lean Weight', + 'viewKey': 'LeanBodyWeightLbs', + } + ]; + + break; + + case VitalSignDetails.Temperature: + VSchart = [ + { + 'name': 'Temperature In Celcius', + 'title1': 'Date', + 'title2': 'C', + 'viewKey': 'TemperatureCelcius', + }, + ]; + + break; + case VitalSignDetails.Pulse: + VSchart = [ + { + 'name': 'Pulse Beat Per Minute', + 'title1': 'Date', + 'title2': 'Minute', + 'viewKey': 'PulseBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.Prescriptions: + VSchart = [ + { + 'name': 'Respiration Beat Per Minute', + 'title1': 'Date', + 'title2': 'Beat Per Minute', + 'viewKey': 'RespirationBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.BloodPressure: + VSchart = [ + { + 'name': 'Blood Pressure Higher', + 'title1': 'Date', + 'title2': 'Minute', + 'viewKey': 'BloodPressureHigher', + }, + { + 'name': 'Blood Pressure Lower', + 'title1': 'Date', + 'title2': 'Minute', + 'viewKey': 'BloodPressureLower', + } + ]; + + break; + case VitalSignDetails.Respiration: + VSchart = [ + { + 'name': 'Respiration Rate', + 'title1': 'Date', + 'title2': 'bpm', + 'viewKey': 'RespirationBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.heart: + VSchart = [ + { + 'name': 'FIO2', + 'title1': 'Date', + 'title2': 'bpm', + 'viewKey': 'PulseBeatPerMinute', + }, + ]; + + break; + case VitalSignDetails.PainScale: + VSchart = [ + { + 'name': 'PainScore', + 'title1': 'Date', + 'title2': 'Cm', + 'viewKey': 'PainScore', + }, + ]; + + break; + case VitalSignDetails.Weight: + VSchart = [ + { + 'name': 'Weight Kg', + 'title1': 'Date', + 'title2': 'Kg', + 'viewKey': 'WeightKg', + }, + ]; + + break; + + case VitalSignDetails.Height: + VSchart = [ + { + 'name': 'Height Cm', + 'title1': 'Date', + 'title2': 'Cm', + 'viewKey': 'HeightCm', + }, + ]; + + break; + default: + } + return AppScaffold( + appBarTitle: pageTitle, + isShowAppBar: true, + body: ListView( + children: VSchart.map((chartInfo) { + var vitalListTemp = vitalList.where( + (element) => element.toJson()[chartInfo['viewKey']] != null, + ); + return vitalListTemp.length != 0 + ? VitalSingChartAndDetials( + vitalList: vitalList, + name: chartInfo['name'], + title1: chartInfo['title1'], + title2: chartInfo['title2'], + viewKey: chartInfo['viewKey']) + : Container(); + }).toList(), + ), + ); + } +} diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart new file mode 100644 index 00000000..299605ef --- /dev/null +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -0,0 +1,82 @@ +import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +class VitalSingChartAndDetials extends StatelessWidget { + VitalSingChartAndDetials({ + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey, + @required this.title1, + @required this.title2, + }) : super(key: key); + + final List vitalList; + final String name; + final String viewKey; + final String title1; + final String title2; + List timeSeriesData = []; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + AppExpandableNotifier( + headerWidget: AppTimeSeriesChart( + seriesList: generateData(), + chartName: name, + startDate: DateTime( + vitalList[vitalList.length - 1] + .vitalSignDate + .year, + vitalList[vitalList.length - 1] + .vitalSignDate + .month + + 3, + vitalList[vitalList.length - 1] + .vitalSignDate + .day), + endDate: vitalList[0].vitalSignDate, + ), + bodyWidget: VitalSignDetailsWidget( + vitalList: vitalList.reversed.toList(), + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ), + ], + ); + } + + generateData() { + if (vitalList.length > 0) { + vitalList.forEach( + (element) { + timeSeriesData.add( + TimeSeriesSales( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey]?.toInt(), + ), + ); + }, + ); + } + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (TimeSeriesSales sales, _) => sales.time, + measureFn: (TimeSeriesSales sales, _) => sales.sales, + data: timeSeriesData, + ) + ]; + } +} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index e35fc41e..55bb4593 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -1,17 +1,29 @@ import 'package:intl/intl.dart'; + class DateUtil { /// convert String To Date function /// [date] String we want to convert static DateTime convertStringToDate(String date) { + if (date != null) { + const start = "/Date("; + const end = "+0300)"; + final startIndex = date.indexOf(start); + final endIndex = date.indexOf(end, startIndex + start.length); + return DateTime.fromMillisecondsSinceEpoch( + int.parse( + date.substring(startIndex + start.length, endIndex), + ), + ); + } else + return DateTime.now(); + } + + static String convertDateToString(DateTime date) { const start = "/Date("; const end = "+0300)"; - final startIndex = date.indexOf(start); - final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); + int milliseconds = date.millisecondsSinceEpoch; + + return start + "$milliseconds" + end; } /// check Date diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 52a939b2..2676bf70 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -110,6 +110,7 @@ class TranslationBase { String get time => localizedValues['time'][locale.languageCode]; + String get login => localizedValues['login'][locale.languageCode]; String get loginregister => @@ -158,20 +159,29 @@ class TranslationBase { String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; + String get register => localizedValues['register-user'][locale.languageCode]; + String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; + String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; + String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; @@ -241,23 +251,34 @@ class TranslationBase { String get cancelAppoMsg => localizedValues['cancelAppoMsg'][locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + String get description => localizedValues['description'][locale.languageCode]; + String get price => localizedValues['price'][locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + String get pleaseEnterMedicineName => localizedValues['pleaseEnterMedicineName'][locale.languageCode]; + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; + String get arabicChange => localizedValues['arabic-change'][locale.languageCode]; + String get notification => localizedValues['notification'][locale.languageCode]; + String get appsetting => localizedValues['app-settings'][locale.languageCode]; + String get rateApp => localizedValues['rate-app'][locale.languageCode]; String get setReminder => localizedValues['set-reminder'][locale.languageCode]; String get before => localizedValues['before'][locale.languageCode]; @@ -268,15 +289,21 @@ class TranslationBase { String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode]; String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode]; String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode]; + String get moreVerification => localizedValues['more-verify'][locale.languageCode]; + String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; + String get accountInfo => localizedValues['account-info'][locale.languageCode]; + String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; + String get next => localizedValues['next'][locale.languageCode]; + String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode]; String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode]; String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode]; @@ -294,22 +321,57 @@ class TranslationBase { String get payLater => localizedValues['payLater'][locale.languageCode]; String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode]; String get firstName => localizedValues['first-name'][locale.languageCode]; + String get middleName => localizedValues['middle-name'][locale.languageCode]; + String get lastName => localizedValues['last-name'][locale.languageCode]; + String get male => localizedValues['male'][locale.languageCode]; + String get female => localizedValues['female'][locale.languageCode]; + String get prefferedLanguage => localizedValues['preferred-language'][locale.languageCode]; + String get english => localizedValues['english'][locale.languageCode]; + String get arabic => localizedValues['arabic'][locale.languageCode]; + String get registrLocation => localizedValues['locations-register'][locale.languageCode]; + String get ksa => localizedValues['ksa'][locale.languageCode]; + String get dubai => localizedValues['dubai'][locale.languageCode]; + String get enterEmail => localizedValues['enter-email'][locale.languageCode]; + String get family => localizedValues['family'][locale.languageCode]; + String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; + + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + + String get bodyMeasurements => + localizedValues ['bodyMeasurements'][locale.languageCode]; + String get height => + localizedValues ['height'][locale.languageCode]; + + String get temperature => localizedValues['temperature'][locale.languageCode]; + + String get pulse => localizedValues['pulse'][locale.languageCode]; + + String get respiration => localizedValues['respiration'][locale.languageCode]; + + String get bloodPressure => + localizedValues['bloodPressure'][locale.languageCode]; + String get painScale => localizedValues['painScale'][locale.languageCode]; + String get heart => localizedValues['heart'][locale.languageCode]; + + String get weight => localizedValues['weight'][locale.languageCode]; + String get request => localizedValues['request'][locale.languageCode]; String get memberName => localizedValues['member-name'][locale.languageCode]; String get switchUser => localizedValues['switch-login'][locale.languageCode]; diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 413b03d9..857a7620 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -42,7 +42,7 @@ class AppTimeSeriesChart extends StatelessWidget { charts.RangeAnnotation( [ charts.RangeAnnotationSegment(startDate, endDate, - charts.RangeAnnotationAxisType.domain), + charts.RangeAnnotationAxisType.domain ), ], ), ], diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index 4bd0d03d..a35fa279 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -27,9 +27,9 @@ class FlexibleContainer extends StatelessWidget { @override Widget build(BuildContext context) { - return FractionallySizedBox( - widthFactor: widthFactor, - heightFactor: heightFactor, + return Container( +// widthFactor: widthFactor, +// heightFactor: heightFactor, child: ClipRRect( borderRadius: BorderRadius.circular(8.0), child: Material( diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index d582b77b..353846e1 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -38,7 +38,7 @@ class AppExpandableNotifier extends StatelessWidget { header: Padding( padding: EdgeInsets.all(10), child: Text( - title?? '', + title?? 'Details', style: TextStyle(fontWeight: FontWeight.bold,fontSize: 22,), ), ),