diff --git a/android/app/build.gradle b/android/app/build.gradle index ab88f580..44cefae1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 // signingConfigs { // release { diff --git a/android/build.gradle b/android/build.gradle index ae74fcf6..cd7010e5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.5.20' repositories { google() jcenter() diff --git a/assets/images/dr_avatar.png b/assets/images/dr_avatar.png new file mode 100644 index 00000000..693ebd7a Binary files /dev/null and b/assets/images/dr_avatar.png differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 41e65f70..3c58fe30 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -310,7 +310,7 @@ "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", - "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework", + "${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework", "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", "${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework", ); @@ -352,7 +352,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework", ); diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 033bc44c..636db329 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -7,8 +7,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:flutter/cupertino.dart'; @@ -64,6 +64,7 @@ class BaseAppClient { body['TokenID'] = token ?? ''; } // body['TokenID'] = "@dm!n" ?? ''; + if (!isFallLanguage) { String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/config.dart b/lib/config/config.dart index 2301eab0..16628fda 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,6 @@ const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_ORDERS_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; const PATIENT_GET_DOCTOR_BY_CLINIC_URL = @@ -44,7 +42,6 @@ const GET_PATIENT_VITAL_SIGN_DATA = const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; @@ -138,7 +135,7 @@ const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; -const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; @@ -155,8 +152,6 @@ const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; @@ -180,8 +175,6 @@ const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = - 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; const POST_EPISODE_FOR_IN_PATIENT = @@ -208,15 +201,13 @@ const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; -const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; + const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; @@ -271,7 +262,6 @@ const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions -const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT_NEW = @@ -280,18 +270,11 @@ const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; -const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; -const GET_PRESCRIPTION_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; - -const GET_INSURANCE_IN_PATIENT = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; - const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; @@ -386,6 +369,21 @@ const GET_PENDING_DISCHARGE_SUMMARY = const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; +const VTE_ASSESSMENT = + "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; + +const GET_INTERVENTION_MEDICATION = + "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; + +const GET_INTERVENTION_MEDICATION_HISTORY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; + +const SET_ACCEPTED_OR_REJECTED = + "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; + +const GET_STP_MASTER_LIST = + "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ @@ -448,7 +446,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; -const Color IN_PROGRESS_COLOR = Color(0xFFCC9B14); /// Timer Info const TIMER_MIN = 10; @@ -458,4 +455,7 @@ class AppGlobal { static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); static Color appTextColor = Color(0xFF2B353E); + static Color scheduleTextColor = Color(0xFF2E303A); + static Color inProgressColor = Color(0xFFCC9B14); + } diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2f44f19a..eb052bc5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -20,6 +20,7 @@ const Map> localizedValues = { "ar": "ليس لديك أي جدول" }, "verify": {"en": "VERIFY", "ar": "تحقق"}, + "pharmacy-intervention": {"en": "Pharmacy Intervention", "ar": "التدخل الصيدلاني"}, "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, "frequency": {"en": "Frequency", "ar": "تكرر"}, @@ -83,8 +84,8 @@ const Map> localizedValues = { "ar": "المريض الذي حضر للموعد" }, "searchMedicineNameHere": {"en": "Search Medicine ", "ar": "ابحث هنا"}, - "youCanFind": {"en": "You Can Find ", "ar": "تستطيع ان تجد "}, - "itemsInSearch": {"en": "items in search", "ar": "عناصر في البحث"}, + "youCanFind": {"en": "You can find ", "ar": "تستطيع ان تجد "}, + "medicineSearchResult": {"en": "as a search result for", "ar": "كنتيجة بحث عن"}, "qr": {"en": "QR", "ar": "QR"}, "reader": {"en": "Reader", "ar": "قارىء رمز ال"}, "startScanning": {"en": "Start Scanning", "ar": "بدء المسح"}, @@ -537,6 +538,10 @@ const Map> localizedValues = { "selectSeverity": {"en": "Select Severity", "ar": "حدد الخطورة"}, "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, "medications": {"en": "Medications", "ar": "الأدوية"}, + "medication": {"en": "Medication", "ar": "الدواء"}, + "createdByName": {"en": "Created By Name", "ar": "الدواء"}, + "statusDescription": {"en": "Status Description", "ar": "وصف الحالة"}, + "doctorComments": {"en": "Doctor Comments", "ar": "تعليقات الطبيب"}, "procedures": {"en": "Procedures", "ar": "الإجراءات"}, "vitalSignEmptyMsg": { "en": "There is no vital signs for this patient", @@ -663,6 +668,7 @@ const Map> localizedValues = { "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, + "riskScore": {"en": "Risk Score :", "ar": "درجة المخاطر"}, "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, "noItem": { @@ -1053,6 +1059,8 @@ const Map> localizedValues = { "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, "nursing": {"en": "Nursing", "ar": "تمريض"}, "diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, + "pharmacy": {"en": "Pharmacy", "ar": "الصيدلاني"}, + "intervention": {"en": "Intervention", "ar": "التدخل"}, "chart": {"en": "Chart", "ar": "جدول"}, "operationTimeStart": { "en": "Operation Time Start :", @@ -1118,4 +1126,20 @@ const Map> localizedValues = { }, "planedProcedure": {"en": "Planed Procedure", "ar": "الإجراء المخطط"}, "moreDetails": {"en": "More Details", "ar": "المزيد من التفاصيل"}, + "VTE_Type": {"en": "VTE Type", "ar": "VTE Type"}, + "pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"}, + "reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"}, + "youDoNotHaveFavoritePrescription": {"en": "You Don't Have Favorite Prescription", "ar": "ليس لديك وصفة طبية مفضلة"}, + "pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"}, + "searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"}, + "sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"}, + "thousandIsTheMAXForTheStrength": {"en": "1000 Is The MAX For The Strength", "ar": "ألف هو القيمة الأعلى"}, + "strengthCanNotBeZero": {"en": "Strength Can't Be Zero", "ar": "القوة لا يمكن أن تكون صفر "}, + "old": {"en": "Old", "ar":"القديمه"}, + "orderTypeDescription": {"en": "Order Type Description", "ar":"وصف نوع الطلب"}, + "doseDetails": {"en": "Dose Details", "ar":"تفاصيل الجرعة"}, + "selectCondition": {"en": "Select Condition", "ar":"قم بتحديد الشرط"}, + "yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"}, + "youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""}, + "conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"}, }; diff --git a/lib/core/model/Prescriptions/prescription_entity_model.dart b/lib/core/model/Prescriptions/prescription_entity_model.dart new file mode 100644 index 00000000..166cd599 --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_entity_model.dart @@ -0,0 +1,145 @@ +class PrescriptionEntityModel { + dynamic appointmentNo; + dynamic clinicName; + dynamic createdBy; + dynamic createdOn; + dynamic doctorName; + dynamic doseDailyQuantity; + dynamic doseDailyUnitID; + dynamic doseDetail; + dynamic doseDurationDays; + dynamic doseTimingID; + dynamic episodeID; + dynamic frequencyID; + dynamic icdCode10ID; + dynamic indication; + dynamic isDispensed; + dynamic isMedicineCovered; + dynamic isSIG; + dynamic medicationName; + dynamic medicationPrice; + dynamic medicineCode; + dynamic orderTypeDescription; + dynamic qty; + dynamic quantity; + dynamic remarks; + dynamic routeID; + dynamic startDate; + dynamic status; + dynamic stopDate; + dynamic uom; + dynamic pharmacistRemarks; + dynamic pharmacyInervention; + dynamic refill; + dynamic mediSpanGPICode; + + PrescriptionEntityModel( + {this.appointmentNo, + this.clinicName, + this.createdBy, + this.createdOn, + this.doctorName, + this.doseDailyQuantity, + this.doseDailyUnitID, + this.doseDetail, + this.doseDurationDays, + this.doseTimingID, + this.episodeID, + this.frequencyID, + this.icdCode10ID, + this.indication, + this.isDispensed, + this.isMedicineCovered, + this.isSIG, + this.medicationName, + this.medicationPrice, + this.medicineCode, + this.orderTypeDescription, + this.qty, + this.quantity, + this.remarks, + this.routeID, + this.startDate, + this.status, + this.stopDate, + this.uom, + this.pharmacistRemarks, + this.mediSpanGPICode, + this.pharmacyInervention, + this.refill}); + + PrescriptionEntityModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + clinicName = json['clinicName']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorName = json['doctorName']; + doseDailyQuantity = json['doseDailyQuantity']; + doseDailyUnitID = json['doseDailyUnitID']; + doseDetail = json['doseDetail']; + doseDurationDays = json['doseDurationDays']; + doseTimingID = json['doseTimingID']; + episodeID = json['episodeID']; + frequencyID = json['frequencyID']; + icdCode10ID = json['icdCode10ID']; + indication = json['indication']; + isDispensed = json['isDispensed']; + isMedicineCovered = json['isMedicineCovered']; + isSIG = json['isSIG']; + medicationName = json['medicationName']; + medicationPrice = json['medicationPrice']; + medicineCode = json['medicineCode']; + orderTypeDescription = json['orderTypeDescription']; + qty = json['qty']; + quantity = json['quantity']; + remarks = json['remarks']; + routeID = json['routeID']; + startDate = json['startDate']; + status = json['status']; + stopDate = json['stopDate']; + uom = json['uom']; + pharmacistRemarks = json['pharmacistRemarks']; + mediSpanGPICode = json['mediSpanGPICode']; + refill = json['refill']; + pharmacyInervention = json['interventionID']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['clinicName'] = this.clinicName; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorName'] = this.doctorName; + data['doseDailyQuantity'] = this.doseDailyQuantity; + data['doseDailyUnitID'] = this.doseDailyUnitID; + data['doseDetail'] = this.doseDetail; + data['doseDurationDays'] = this.doseDurationDays; + data['doseTimingID'] = this.doseTimingID; + data['episodeID'] = this.episodeID; + data['frequencyID'] = this.frequencyID; + data['icdCode10ID'] = this.icdCode10ID; + data['indication'] = this.indication; + data['isDispensed'] = this.isDispensed; + data['isMedicineCovered'] = this.isMedicineCovered; + data['isSIG'] = this.isSIG; + data['medicationName'] = this.medicationName; + data['medicationPrice'] = this.medicationPrice; + data['medicineCode'] = this.medicineCode; + data['orderTypeDescription'] = this.orderTypeDescription; + data['qty'] = this.qty; + data['quantity'] = this.quantity; + data['remarks'] = this.remarks; + data['routeID'] = this.routeID; + data['startDate'] = this.startDate; + data['status'] = this.status; + data['stopDate'] = this.stopDate; + data['uom'] = this.uom; + data['pharmacistRemarks'] = this.pharmacistRemarks; + data['mediSpanGPICode'] = this.mediSpanGPICode; + data['refill'] = this.refill; + data['interventionID'] = this.pharmacyInervention; + + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/Prescriptions/prescription_model.dart b/lib/core/model/Prescriptions/prescription_model.dart index 52c3edec..a286908f 100644 --- a/lib/core/model/Prescriptions/prescription_model.dart +++ b/lib/core/model/Prescriptions/prescription_model.dart @@ -1,5 +1,7 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; + class PrescriptionModel { - List entityList; + List entityList; dynamic rowcount; dynamic statusMessage; @@ -7,9 +9,9 @@ class PrescriptionModel { PrescriptionModel.fromJson(Map json) { if (json['entityList'] != null) { - entityList = new List(); + entityList = new List(); json['entityList'].forEach((v) { - entityList.add(new EntityList.fromJson(v)); + entityList.add(new PrescriptionEntityModel.fromJson(v)); }); } rowcount = json['rowcount']; @@ -26,149 +28,3 @@ class PrescriptionModel { return data; } } - -class EntityList { - dynamic appointmentNo; - dynamic clinicName; - dynamic createdBy; - dynamic createdOn; - dynamic doctorName; - dynamic doseDailyQuantity; - dynamic doseDailyUnitID; - dynamic doseDetail; - dynamic doseDurationDays; - dynamic doseTimingID; - dynamic episodeID; - dynamic frequencyID; - dynamic icdCode10ID; - dynamic indication; - dynamic isDispensed; - dynamic isMedicineCovered; - dynamic isSIG; - dynamic medicationName; - dynamic medicationPrice; - dynamic medicineCode; - dynamic orderTypeDescription; - dynamic qty; - dynamic quantity; - dynamic remarks; - dynamic routeID; - dynamic startDate; - dynamic status; - dynamic stopDate; - dynamic uom; - dynamic pharmacistRemarks; - dynamic pharmacyInervention; - dynamic refill; - dynamic mediSpanGPICode; - - EntityList( - {this.appointmentNo, - this.clinicName, - this.createdBy, - this.createdOn, - this.doctorName, - this.doseDailyQuantity, - this.doseDailyUnitID, - this.doseDetail, - this.doseDurationDays, - this.doseTimingID, - this.episodeID, - this.frequencyID, - this.icdCode10ID, - this.indication, - this.isDispensed, - this.isMedicineCovered, - this.isSIG, - this.medicationName, - this.medicationPrice, - this.medicineCode, - this.orderTypeDescription, - this.qty, - this.quantity, - this.remarks, - this.routeID, - this.startDate, - this.status, - this.stopDate, - this.uom, - this.pharmacistRemarks, - this.mediSpanGPICode, - this.pharmacyInervention, - this.refill}); - - EntityList.fromJson(Map json) { - appointmentNo = json['appointmentNo']; - clinicName = json['clinicName']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - doctorName = json['doctorName']; - doseDailyQuantity = json['doseDailyQuantity']; - doseDailyUnitID = json['doseDailyUnitID']; - doseDetail = json['doseDetail']; - doseDurationDays = json['doseDurationDays']; - doseTimingID = json['doseTimingID']; - episodeID = json['episodeID']; - frequencyID = json['frequencyID']; - icdCode10ID = json['icdCode10ID']; - indication = json['indication']; - isDispensed = json['isDispensed']; - isMedicineCovered = json['isMedicineCovered']; - isSIG = json['isSIG']; - medicationName = json['medicationName']; - medicationPrice = json['medicationPrice']; - medicineCode = json['medicineCode']; - orderTypeDescription = json['orderTypeDescription']; - qty = json['qty']; - quantity = json['quantity']; - remarks = json['remarks']; - routeID = json['routeID']; - startDate = json['startDate']; - status = json['status']; - stopDate = json['stopDate']; - uom = json['uom']; - pharmacistRemarks = json['pharmacistRemarks']; - mediSpanGPICode = json['mediSpanGPICode']; - refill = json['refill']; - pharmacyInervention = json['interventionID']; - } - - Map toJson() { - final Map data = new Map(); - data['appointmentNo'] = this.appointmentNo; - data['clinicName'] = this.clinicName; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['doctorName'] = this.doctorName; - data['doseDailyQuantity'] = this.doseDailyQuantity; - data['doseDailyUnitID'] = this.doseDailyUnitID; - data['doseDetail'] = this.doseDetail; - data['doseDurationDays'] = this.doseDurationDays; - data['doseTimingID'] = this.doseTimingID; - data['episodeID'] = this.episodeID; - data['frequencyID'] = this.frequencyID; - data['icdCode10ID'] = this.icdCode10ID; - data['indication'] = this.indication; - data['isDispensed'] = this.isDispensed; - data['isMedicineCovered'] = this.isMedicineCovered; - data['isSIG'] = this.isSIG; - data['medicationName'] = this.medicationName; - data['medicationPrice'] = this.medicationPrice; - data['medicineCode'] = this.medicineCode; - data['orderTypeDescription'] = this.orderTypeDescription; - data['qty'] = this.qty; - data['quantity'] = this.quantity; - data['remarks'] = this.remarks; - data['routeID'] = this.routeID; - data['startDate'] = this.startDate; - data['status'] = this.status; - data['stopDate'] = this.stopDate; - data['uom'] = this.uom; - data['pharmacistRemarks'] = this.pharmacistRemarks; - data['mediSpanGPICode'] = this.mediSpanGPICode; - data['refill'] = this.refill; - data['interventionID'] = this.pharmacyInervention; - - return data; - } -} diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index a45878d8..ec69ca33 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,26 +1,20 @@ class PrescriptionReqModel { - String vidaAuthTokenID; dynamic patientMRN; dynamic appNo; - dynamic admissionNo; PrescriptionReqModel( - {this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); + { this.patientMRN, this.appNo}); PrescriptionReqModel.fromJson(Map json) { - vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; appNo = json['AppointmentNo']; - admissionNo = json['AdmissionNo']; + } Map toJson() { final Map data = new Map(); - data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appNo; - data['AdmissionNo'] = this.admissionNo; - return data; } } diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/core/model/SOAP/Allergy_model.dart similarity index 100% rename from lib/models/SOAP/Allergy_model.dart rename to lib/core/model/SOAP/Allergy_model.dart diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart similarity index 100% rename from lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart rename to lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart similarity index 100% rename from lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart rename to lib/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/core/model/SOAP/GeneralGetReqForSOAP.dart similarity index 100% rename from lib/models/SOAP/GeneralGetReqForSOAP.dart rename to lib/core/model/SOAP/GeneralGetReqForSOAP.dart diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/core/model/SOAP/GetAllergiesResModel.dart similarity index 100% rename from lib/models/SOAP/GetAllergiesResModel.dart rename to lib/core/model/SOAP/GetAllergiesResModel.dart diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/core/model/SOAP/GetAssessmentReqModel.dart similarity index 100% rename from lib/models/SOAP/GetAssessmentReqModel.dart rename to lib/core/model/SOAP/GetAssessmentReqModel.dart diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/core/model/SOAP/GetAssessmentResModel.dart similarity index 100% rename from lib/models/SOAP/GetAssessmentResModel.dart rename to lib/core/model/SOAP/GetAssessmentResModel.dart diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/core/model/SOAP/GetGetProgressNoteReqModel.dart similarity index 100% rename from lib/models/SOAP/GetGetProgressNoteReqModel.dart rename to lib/core/model/SOAP/GetGetProgressNoteReqModel.dart diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/core/model/SOAP/GetGetProgressNoteResModel.dart similarity index 100% rename from lib/models/SOAP/GetGetProgressNoteResModel.dart rename to lib/core/model/SOAP/GetGetProgressNoteResModel.dart diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/core/model/SOAP/GetHistoryReqModel.dart similarity index 100% rename from lib/models/SOAP/GetHistoryReqModel.dart rename to lib/core/model/SOAP/GetHistoryReqModel.dart diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/core/model/SOAP/GetHistoryResModel.dart similarity index 100% rename from lib/models/SOAP/GetHistoryResModel.dart rename to lib/core/model/SOAP/GetHistoryResModel.dart diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/core/model/SOAP/GetPhysicalExamListResModel.dart similarity index 100% rename from lib/models/SOAP/GetPhysicalExamListResModel.dart rename to lib/core/model/SOAP/GetPhysicalExamListResModel.dart diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/core/model/SOAP/GetPhysicalExamReqModel.dart similarity index 100% rename from lib/models/SOAP/GetPhysicalExamReqModel.dart rename to lib/core/model/SOAP/GetPhysicalExamReqModel.dart diff --git a/lib/models/SOAP/PatchAssessmentReqModel.dart b/lib/core/model/SOAP/PatchAssessmentReqModel.dart similarity index 100% rename from lib/models/SOAP/PatchAssessmentReqModel.dart rename to lib/core/model/SOAP/PatchAssessmentReqModel.dart diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/core/model/SOAP/PostEpisodeReqModel.dart similarity index 100% rename from lib/models/SOAP/PostEpisodeReqModel.dart rename to lib/core/model/SOAP/PostEpisodeReqModel.dart diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/core/model/SOAP/get_Allergies_request_model.dart similarity index 100% rename from lib/models/SOAP/get_Allergies_request_model.dart rename to lib/core/model/SOAP/get_Allergies_request_model.dart diff --git a/lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart b/lib/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart similarity index 100% rename from lib/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart rename to lib/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart diff --git a/lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart b/lib/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart similarity index 100% rename from lib/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart rename to lib/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart diff --git a/lib/models/SOAP/master_key_model.dart b/lib/core/model/SOAP/master_key_model.dart similarity index 100% rename from lib/models/SOAP/master_key_model.dart rename to lib/core/model/SOAP/master_key_model.dart diff --git a/lib/models/SOAP/order-procedure.dart b/lib/core/model/SOAP/order-procedure.dart similarity index 100% rename from lib/models/SOAP/order-procedure.dart rename to lib/core/model/SOAP/order-procedure.dart diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/core/model/SOAP/post_allergy_request_model.dart similarity index 100% rename from lib/models/SOAP/post_allergy_request_model.dart rename to lib/core/model/SOAP/post_allergy_request_model.dart diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/core/model/SOAP/post_assessment_request_model.dart similarity index 100% rename from lib/models/SOAP/post_assessment_request_model.dart rename to lib/core/model/SOAP/post_assessment_request_model.dart diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/core/model/SOAP/post_chief_complaint_request_model.dart similarity index 100% rename from lib/models/SOAP/post_chief_complaint_request_model.dart rename to lib/core/model/SOAP/post_chief_complaint_request_model.dart diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/core/model/SOAP/post_histories_request_model.dart similarity index 100% rename from lib/models/SOAP/post_histories_request_model.dart rename to lib/core/model/SOAP/post_histories_request_model.dart diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/core/model/SOAP/post_physical_exam_request_model.dart similarity index 100% rename from lib/models/SOAP/post_physical_exam_request_model.dart rename to lib/core/model/SOAP/post_physical_exam_request_model.dart diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/core/model/SOAP/post_progress_note_request_model.dart similarity index 100% rename from lib/models/SOAP/post_progress_note_request_model.dart rename to lib/core/model/SOAP/post_progress_note_request_model.dart diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/core/model/SOAP/selected_items/my_selected_allergy.dart similarity index 86% rename from lib/models/SOAP/selected_items/my_selected_allergy.dart rename to lib/core/model/SOAP/selected_items/my_selected_allergy.dart index be022adc..86fad1ec 100644 --- a/lib/models/SOAP/selected_items/my_selected_allergy.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_allergy.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedAllergy { MasterKeyModel selectedAllergySeverity; diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/core/model/SOAP/selected_items/my_selected_assement.dart similarity index 88% rename from lib/models/SOAP/selected_items/my_selected_assement.dart rename to lib/core/model/SOAP/selected_items/my_selected_assement.dart index 7ac3d979..ab4c9965 100644 --- a/lib/models/SOAP/selected_items/my_selected_assement.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_assement.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedAssessment { MasterKeyModel selectedICD; diff --git a/lib/models/SOAP/selected_items/my_selected_examination.dart b/lib/core/model/SOAP/selected_items/my_selected_examination.dart similarity index 87% rename from lib/models/SOAP/selected_items/my_selected_examination.dart rename to lib/core/model/SOAP/selected_items/my_selected_examination.dart index 75f67ae2..1e8a128f 100644 --- a/lib/models/SOAP/selected_items/my_selected_examination.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_examination.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedExamination { MasterKeyModel selectedExamination; diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/core/model/SOAP/selected_items/my_selected_history.dart similarity index 74% rename from lib/models/SOAP/selected_items/my_selected_history.dart rename to lib/core/model/SOAP/selected_items/my_selected_history.dart index 3769c418..2aa0b3e3 100644 --- a/lib/models/SOAP/selected_items/my_selected_history.dart +++ b/lib/core/model/SOAP/selected_items/my_selected_history.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; class MySelectedHistory { MasterKeyModel selectedHistory; diff --git a/lib/models/admisson_orders/admission_orders_model.dart b/lib/core/model/admisson_orders/admission_orders_model.dart similarity index 100% rename from lib/models/admisson_orders/admission_orders_model.dart rename to lib/core/model/admisson_orders/admission_orders_model.dart diff --git a/lib/models/admisson_orders/admission_orders_request_model.dart b/lib/core/model/admisson_orders/admission_orders_request_model.dart similarity index 100% rename from lib/models/admisson_orders/admission_orders_request_model.dart rename to lib/core/model/admisson_orders/admission_orders_request_model.dart diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index e39518e6..6fb7eb70 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { String authenticationTokenID; diff --git a/lib/models/chart_axis_model.dart b/lib/core/model/chart_axis_model.dart similarity index 100% rename from lib/models/chart_axis_model.dart rename to lib/core/model/chart_axis_model.dart diff --git a/lib/models/countriesModel.dart b/lib/core/model/countriesModel.dart similarity index 100% rename from lib/models/countriesModel.dart rename to lib/core/model/countriesModel.dart diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/core/model/dashboard/dashboard_model.dart similarity index 100% rename from lib/models/dashboard/dashboard_model.dart rename to lib/core/model/dashboard/dashboard_model.dart diff --git a/lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart b/lib/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart similarity index 100% rename from lib/models/dashboard/get_special_clinical_care_List_Respose_Model.dart rename to lib/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart diff --git a/lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart b/lib/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart similarity index 100% rename from lib/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart rename to lib/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart diff --git a/lib/models/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart similarity index 100% rename from lib/models/discharge_summary/GetDischargeSummaryReqModel.dart rename to lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/core/model/discharge_summary/GetDischargeSummaryResModel.dart similarity index 100% rename from lib/models/discharge_summary/GetDischargeSummaryResModel.dart rename to lib/core/model/discharge_summary/GetDischargeSummaryResModel.dart diff --git a/lib/models/doctor/clinic_model.dart b/lib/core/model/doctor/clinic_model.dart similarity index 100% rename from lib/models/doctor/clinic_model.dart rename to lib/core/model/doctor/clinic_model.dart diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/core/model/doctor/doctor_profile_model.dart similarity index 100% rename from lib/models/doctor/doctor_profile_model.dart rename to lib/core/model/doctor/doctor_profile_model.dart diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/core/model/doctor/list_doctor_working_hours_table_model.dart similarity index 100% rename from lib/models/doctor/list_doctor_working_hours_table_model.dart rename to lib/core/model/doctor/list_doctor_working_hours_table_model.dart diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/core/model/doctor/list_gt_my_patients_question_model.dart similarity index 100% rename from lib/models/doctor/list_gt_my_patients_question_model.dart rename to lib/core/model/doctor/list_gt_my_patients_question_model.dart diff --git a/lib/models/doctor/profile_req_Model.dart b/lib/core/model/doctor/profile_req_Model.dart similarity index 100% rename from lib/models/doctor/profile_req_Model.dart rename to lib/core/model/doctor/profile_req_Model.dart diff --git a/lib/models/doctor/replay/request_create_doctor_response.dart b/lib/core/model/doctor/replay/request_create_doctor_response.dart similarity index 100% rename from lib/models/doctor/replay/request_create_doctor_response.dart rename to lib/core/model/doctor/replay/request_create_doctor_response.dart diff --git a/lib/models/doctor/replay/request_doctor_reply.dart b/lib/core/model/doctor/replay/request_doctor_reply.dart similarity index 100% rename from lib/models/doctor/replay/request_doctor_reply.dart rename to lib/core/model/doctor/replay/request_doctor_reply.dart diff --git a/lib/models/doctor/request_add_referred_doctor_remarks.dart b/lib/core/model/doctor/request_add_referred_doctor_remarks.dart similarity index 100% rename from lib/models/doctor/request_add_referred_doctor_remarks.dart rename to lib/core/model/doctor/request_add_referred_doctor_remarks.dart diff --git a/lib/models/doctor/request_schedule.dart b/lib/core/model/doctor/request_schedule.dart similarity index 100% rename from lib/models/doctor/request_schedule.dart rename to lib/core/model/doctor/request_schedule.dart diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/core/model/doctor/statstics_for_certain_doctor_request.dart similarity index 100% rename from lib/models/doctor/statstics_for_certain_doctor_request.dart rename to lib/core/model/doctor/statstics_for_certain_doctor_request.dart diff --git a/lib/models/doctor/user_model.dart b/lib/core/model/doctor/user_model.dart similarity index 100% rename from lib/models/doctor/user_model.dart rename to lib/core/model/doctor/user_model.dart diff --git a/lib/models/doctor/verify_referral_doctor_remarks.dart b/lib/core/model/doctor/verify_referral_doctor_remarks.dart similarity index 100% rename from lib/models/doctor/verify_referral_doctor_remarks.dart rename to lib/core/model/doctor/verify_referral_doctor_remarks.dart diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index a3a8d1ac..0aa732a5 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -26,6 +26,7 @@ class PatientLabOrders { String nationalityFlagURL; int noOfPatientsRate; DateTime orderDate; + DateTime createdOn; String orderNo; String patientID; String projectID; @@ -98,6 +99,7 @@ class PatientLabOrders { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); + createdOn = AppDateUtils.convertStringToDate(json['CreatedOn']); orderNo = json['OrderNo'].toString(); patientID = json['PatientID'].toString(); projectID = json['ProjectID'].toString(); diff --git a/lib/models/livecare/end_call_req.dart b/lib/core/model/livecare/end_call_req.dart similarity index 100% rename from lib/models/livecare/end_call_req.dart rename to lib/core/model/livecare/end_call_req.dart diff --git a/lib/models/livecare/get_panding_req_list.dart b/lib/core/model/livecare/get_panding_req_list.dart similarity index 100% rename from lib/models/livecare/get_panding_req_list.dart rename to lib/core/model/livecare/get_panding_req_list.dart diff --git a/lib/models/livecare/get_pending_res_list.dart b/lib/core/model/livecare/get_pending_res_list.dart similarity index 100% rename from lib/models/livecare/get_pending_res_list.dart rename to lib/core/model/livecare/get_pending_res_list.dart diff --git a/lib/models/livecare/session_status_model.dart b/lib/core/model/livecare/session_status_model.dart similarity index 100% rename from lib/models/livecare/session_status_model.dart rename to lib/core/model/livecare/session_status_model.dart diff --git a/lib/models/livecare/start_call_req.dart b/lib/core/model/livecare/start_call_req.dart similarity index 100% rename from lib/models/livecare/start_call_req.dart rename to lib/core/model/livecare/start_call_req.dart diff --git a/lib/models/livecare/start_call_res.dart b/lib/core/model/livecare/start_call_res.dart similarity index 100% rename from lib/models/livecare/start_call_res.dart rename to lib/core/model/livecare/start_call_res.dart diff --git a/lib/models/livecare/transfer_to_admin.dart b/lib/core/model/livecare/transfer_to_admin.dart similarity index 100% rename from lib/models/livecare/transfer_to_admin.dart rename to lib/core/model/livecare/transfer_to_admin.dart diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index db672fcf..20e27289 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -18,6 +18,7 @@ class CreateNoteModel { String sessionID; bool isLoginForDoctorApp; bool patientOutSA; + int conditionId; CreateNoteModel( {this.visitType, @@ -38,7 +39,8 @@ class CreateNoteModel { this.tokenID, this.sessionID, this.isLoginForDoctorApp, - this.patientOutSA}); + this.patientOutSA, + this.conditionId}); CreateNoteModel.fromJson(Map json) { visitType = json['VisitType']; @@ -60,6 +62,7 @@ class CreateNoteModel { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; + conditionId = json['ConditionId']; } Map toJson() { @@ -83,6 +86,7 @@ class CreateNoteModel { data['SessionID'] = this.sessionID; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; + data['ConditionId'] = this.conditionId; return data; } } diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 29a891fa..bef3a973 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -19,6 +19,8 @@ class NoteModel { Null doctorClinicName; String doctorName; String visitTypeDesc; + int condition; + String conditionDescription; NoteModel( {this.setupID, @@ -40,7 +42,10 @@ class NoteModel { this.admissionClinicName, this.doctorClinicName, this.doctorName, - this.visitTypeDesc}); + this.visitTypeDesc, + this.condition, + this.conditionDescription, + }); NoteModel.fromJson(Map json) { setupID = json['SetupID']; @@ -63,6 +68,8 @@ class NoteModel { doctorClinicName = json['DoctorClinicName']; doctorName = json['DoctorName']; visitTypeDesc = json['VisitTypeDesc']; + condition = json['Condition']; + conditionDescription = json['ConditionDescription']; } Map toJson() { @@ -87,6 +94,8 @@ class NoteModel { data['DoctorClinicName'] = this.doctorClinicName; data['DoctorName'] = this.doctorName; data['VisitTypeDesc'] = this.visitTypeDesc; + data['Condition'] = this.condition; + data['ConditionDescription'] = this.conditionDescription; return data; } } diff --git a/lib/core/model/note/stp_master_list_req_model.dart b/lib/core/model/note/stp_master_list_req_model.dart new file mode 100644 index 00000000..067a1623 --- /dev/null +++ b/lib/core/model/note/stp_master_list_req_model.dart @@ -0,0 +1,32 @@ +class StpMasterListRequestModel { + bool isDentalAllowedBackend; + int languageID; + int projectID; + int parameterGroup; + int parameterType; + + StpMasterListRequestModel( + {this.isDentalAllowedBackend, + this.languageID, + this.projectID, + this.parameterGroup, + this.parameterType}); + + StpMasterListRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + projectID = json['ProjectID']; + parameterGroup = json['parameterGroup']; + parameterType = json['parameterType']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['ProjectID'] = this.projectID; + data['parameterGroup'] = this.parameterGroup; + data['parameterType'] = this.parameterType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/note/stp_master_list_res_model.dart b/lib/core/model/note/stp_master_list_res_model.dart new file mode 100644 index 00000000..2533605a --- /dev/null +++ b/lib/core/model/note/stp_master_list_res_model.dart @@ -0,0 +1,22 @@ +class StpMasterListResponseModel { + int parameterCode; + String description; + Null descriptionN; + + StpMasterListResponseModel( + {this.parameterCode, this.description, this.descriptionN}); + + StpMasterListResponseModel.fromJson(Map json) { + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index f2d845ff..faedb6f7 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -16,6 +16,7 @@ class UpdateNoteReqModel { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; + int conditionId; UpdateNoteReqModel( {this.projectID, @@ -34,7 +35,8 @@ class UpdateNoteReqModel { this.sessionID, this.isLoginForDoctorApp, this.patientOutSA, - this.patientTypeID}); + this.patientTypeID, + this.conditionId}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -54,6 +56,7 @@ class UpdateNoteReqModel { isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; patientTypeID = json['PatientTypeID']; + conditionId = json['ConditionId']; } Map toJson() { @@ -75,6 +78,7 @@ class UpdateNoteReqModel { data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; data['PatientTypeID'] = this.patientTypeID; + data['ConditionId'] = this.conditionId; return data; } } diff --git a/lib/models/operation_report/create_update_operation_report_request_model.dart b/lib/core/model/operation_report/create_update_operation_report_request_model.dart similarity index 100% rename from lib/models/operation_report/create_update_operation_report_request_model.dart rename to lib/core/model/operation_report/create_update_operation_report_request_model.dart diff --git a/lib/models/operation_report/get_operation_details_request_modle.dart b/lib/core/model/operation_report/get_operation_details_request_modle.dart similarity index 100% rename from lib/models/operation_report/get_operation_details_request_modle.dart rename to lib/core/model/operation_report/get_operation_details_request_modle.dart diff --git a/lib/models/operation_report/get_operation_details_response_modle.dart b/lib/core/model/operation_report/get_operation_details_response_modle.dart similarity index 100% rename from lib/models/operation_report/get_operation_details_response_modle.dart rename to lib/core/model/operation_report/get_operation_details_response_modle.dart diff --git a/lib/models/operation_report/get_reservations_request_model.dart b/lib/core/model/operation_report/get_reservations_request_model.dart similarity index 100% rename from lib/models/operation_report/get_reservations_request_model.dart rename to lib/core/model/operation_report/get_reservations_request_model.dart diff --git a/lib/models/operation_report/get_reservations_response_model.dart b/lib/core/model/operation_report/get_reservations_response_model.dart similarity index 100% rename from lib/models/operation_report/get_reservations_response_model.dart rename to lib/core/model/operation_report/get_reservations_response_model.dart diff --git a/lib/models/patient/MedicalReport/MedicalReportTemplate.dart b/lib/core/model/patient/MedicalReport/MedicalReportTemplate.dart similarity index 100% rename from lib/models/patient/MedicalReport/MedicalReportTemplate.dart rename to lib/core/model/patient/MedicalReport/MedicalReportTemplate.dart diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart similarity index 100% rename from lib/models/patient/MedicalReport/MeidcalReportModel.dart rename to lib/core/model/patient/MedicalReport/MeidcalReportModel.dart diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/core/model/patient/PatientArrivalEntity.dart similarity index 100% rename from lib/models/patient/PatientArrivalEntity.dart rename to lib/core/model/patient/PatientArrivalEntity.dart diff --git a/lib/models/patient/get_clinic_by_project_id_request.dart b/lib/core/model/patient/get_clinic_by_project_id_request.dart similarity index 100% rename from lib/models/patient/get_clinic_by_project_id_request.dart rename to lib/core/model/patient/get_clinic_by_project_id_request.dart diff --git a/lib/models/patient/get_doctor_by_clinic_id_request.dart b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart similarity index 100% rename from lib/models/patient/get_doctor_by_clinic_id_request.dart rename to lib/core/model/patient/get_doctor_by_clinic_id_request.dart diff --git a/lib/models/patient/get_list_stp_referral_frequency_request.dart b/lib/core/model/patient/get_list_stp_referral_frequency_request.dart similarity index 100% rename from lib/models/patient/get_list_stp_referral_frequency_request.dart rename to lib/core/model/patient/get_list_stp_referral_frequency_request.dart diff --git a/lib/models/patient/get_pending_patient_er_model.dart b/lib/core/model/patient/get_pending_patient_er_model.dart similarity index 100% rename from lib/models/patient/get_pending_patient_er_model.dart rename to lib/core/model/patient/get_pending_patient_er_model.dart diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/core/model/patient/insurance_aprovals_request.dart similarity index 100% rename from lib/models/patient/insurance_aprovals_request.dart rename to lib/core/model/patient/insurance_aprovals_request.dart diff --git a/lib/models/patient/lab_orders/lab_orders_req_model.dart b/lib/core/model/patient/lab_orders/lab_orders_req_model.dart similarity index 100% rename from lib/models/patient/lab_orders/lab_orders_req_model.dart rename to lib/core/model/patient/lab_orders/lab_orders_req_model.dart diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/core/model/patient/lab_orders/lab_orders_res_model.dart similarity index 100% rename from lib/models/patient/lab_orders/lab_orders_res_model.dart rename to lib/core/model/patient/lab_orders/lab_orders_res_model.dart diff --git a/lib/models/patient/lab_result/lab_result.dart b/lib/core/model/patient/lab_result/lab_result.dart similarity index 100% rename from lib/models/patient/lab_result/lab_result.dart rename to lib/core/model/patient/lab_result/lab_result.dart diff --git a/lib/models/patient/lab_result/lab_result_req_model.dart b/lib/core/model/patient/lab_result/lab_result_req_model.dart similarity index 100% rename from lib/models/patient/lab_result/lab_result_req_model.dart rename to lib/core/model/patient/lab_result/lab_result_req_model.dart diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/core/model/patient/my_referral/PendingReferral.dart similarity index 100% rename from lib/models/patient/my_referral/PendingReferral.dart rename to lib/core/model/patient/my_referral/PendingReferral.dart diff --git a/lib/models/patient/my_referral/clinic-doctor.dart b/lib/core/model/patient/my_referral/clinic-doctor.dart similarity index 100% rename from lib/models/patient/my_referral/clinic-doctor.dart rename to lib/core/model/patient/my_referral/clinic-doctor.dart diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/core/model/patient/my_referral/my_referral_patient_model.dart similarity index 100% rename from lib/models/patient/my_referral/my_referral_patient_model.dart rename to lib/core/model/patient/my_referral/my_referral_patient_model.dart diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/core/model/patient/my_referral/my_referred_patient_model.dart similarity index 100% rename from lib/models/patient/my_referral/my_referred_patient_model.dart rename to lib/core/model/patient/my_referral/my_referred_patient_model.dart diff --git a/lib/models/patient/orders_request.dart b/lib/core/model/patient/orders_request.dart similarity index 100% rename from lib/models/patient/orders_request.dart rename to lib/core/model/patient/orders_request.dart diff --git a/lib/models/patient/patiant_info_model.dart b/lib/core/model/patient/patiant_info_model.dart similarity index 99% rename from lib/models/patient/patiant_info_model.dart rename to lib/core/model/patient/patiant_info_model.dart index 9e4ebeb2..99127cc9 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/core/model/patient/patiant_info_model.dart @@ -1,6 +1,7 @@ // TODO = it have to be changed. import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; class PatiantInformtion { PatiantInformtion patientDetails; @@ -199,8 +200,8 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescription = Helpers.convertToTitleCase( + json["ClinicDescription"] ?? json["clinicDescription"]??''); clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; nationalityName = json["NationalityName"] ?? diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/core/model/patient/patient_arrival/get_patient_arrival_list_request_model.dart similarity index 100% rename from lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart rename to lib/core/model/patient/patient_arrival/get_patient_arrival_list_request_model.dart diff --git a/lib/models/patient/patient_model.dart b/lib/core/model/patient/patient_model.dart similarity index 100% rename from lib/models/patient/patient_model.dart rename to lib/core/model/patient/patient_model.dart diff --git a/lib/models/patient/prescription/prescription_report.dart b/lib/core/model/patient/prescription/prescription_report.dart similarity index 100% rename from lib/models/patient/prescription/prescription_report.dart rename to lib/core/model/patient/prescription/prescription_report.dart diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/core/model/patient/prescription/prescription_report_for_in_patient.dart similarity index 100% rename from lib/models/patient/prescription/prescription_report_for_in_patient.dart rename to lib/core/model/patient/prescription/prescription_report_for_in_patient.dart diff --git a/lib/models/patient/prescription/prescription_req_model.dart b/lib/core/model/patient/prescription/prescription_req_model.dart similarity index 100% rename from lib/models/patient/prescription/prescription_req_model.dart rename to lib/core/model/patient/prescription/prescription_req_model.dart diff --git a/lib/models/patient/prescription/prescription_res_model.dart b/lib/core/model/patient/prescription/prescription_res_model.dart similarity index 97% rename from lib/models/patient/prescription/prescription_res_model.dart rename to lib/core/model/patient/prescription/prescription_res_model.dart index 9c7e296d..eed34296 100644 --- a/lib/models/patient/prescription/prescription_res_model.dart +++ b/lib/core/model/patient/prescription/prescription_res_model.dart @@ -16,7 +16,6 @@ class PrescriptionResModel { String name; int episodeID; int actualDoctorRate; - int admission; int clinicID; String companyName; String despensedStatus; @@ -51,7 +50,6 @@ class PrescriptionResModel { this.name, this.episodeID, this.actualDoctorRate, - this.admission, this.clinicID, this.companyName, this.despensedStatus, @@ -86,7 +84,6 @@ class PrescriptionResModel { name = json['Name']; episodeID = json['EpisodeID']; actualDoctorRate = json['ActualDoctorRate']; - admission = json['Admission']; clinicID = json['ClinicID']; companyName = json['CompanyName']; despensedStatus = json['Despensed_Status']; @@ -123,7 +120,6 @@ class PrescriptionResModel { data['Name'] = this.name; data['EpisodeID'] = this.episodeID; data['ActualDoctorRate'] = this.actualDoctorRate; - data['Admission'] = this.admission; data['ClinicID'] = this.clinicID; data['CompanyName'] = this.companyName; data['Despensed_Status'] = this.despensedStatus; diff --git a/lib/models/patient/prescription/request_prescription_report.dart b/lib/core/model/patient/prescription/request_prescription_report.dart similarity index 100% rename from lib/models/patient/prescription/request_prescription_report.dart rename to lib/core/model/patient/prescription/request_prescription_report.dart diff --git a/lib/models/patient/progress_note_request.dart b/lib/core/model/patient/progress_note_request.dart similarity index 100% rename from lib/models/patient/progress_note_request.dart rename to lib/core/model/patient/progress_note_request.dart diff --git a/lib/models/patient/radiology/radiology_req_model.dart b/lib/core/model/patient/radiology/radiology_req_model.dart similarity index 100% rename from lib/models/patient/radiology/radiology_req_model.dart rename to lib/core/model/patient/radiology/radiology_req_model.dart diff --git a/lib/models/patient/radiology/radiology_res_model.dart b/lib/core/model/patient/radiology/radiology_res_model.dart similarity index 100% rename from lib/models/patient/radiology/radiology_res_model.dart rename to lib/core/model/patient/radiology/radiology_res_model.dart diff --git a/lib/models/patient/reauest_prescription_report_for_in_patient.dart b/lib/core/model/patient/reauest_prescription_report_for_in_patient.dart similarity index 100% rename from lib/models/patient/reauest_prescription_report_for_in_patient.dart rename to lib/core/model/patient/reauest_prescription_report_for_in_patient.dart diff --git a/lib/models/patient/refer_to_doctor_request.dart b/lib/core/model/patient/refer_to_doctor_request.dart similarity index 100% rename from lib/models/patient/refer_to_doctor_request.dart rename to lib/core/model/patient/refer_to_doctor_request.dart diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/core/model/patient/request_my_referral_patient_model.dart similarity index 100% rename from lib/models/patient/request_my_referral_patient_model.dart rename to lib/core/model/patient/request_my_referral_patient_model.dart diff --git a/lib/models/patient/topten_users_res_model.dart b/lib/core/model/patient/topten_users_res_model.dart similarity index 87% rename from lib/models/patient/topten_users_res_model.dart rename to lib/core/model/patient/topten_users_res_model.dart index ac603cdb..cc47a2f8 100644 --- a/lib/models/patient/topten_users_res_model.dart +++ b/lib/core/model/patient/topten_users_res_model.dart @@ -6,7 +6,7 @@ *@desc: */ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; //ModelResponse class ModelResponse { diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart similarity index 100% rename from lib/models/patient/vital_sign/patient-vital-sign-data.dart rename to lib/core/model/patient/vital_sign/patient-vital-sign-data.dart diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-history.dart similarity index 100% rename from lib/models/patient/vital_sign/patient-vital-sign-history.dart rename to lib/core/model/patient/vital_sign/patient-vital-sign-history.dart diff --git a/lib/models/patient/vital_sign/vital_sign_req_model.dart b/lib/core/model/patient/vital_sign/vital_sign_req_model.dart similarity index 100% rename from lib/models/patient/vital_sign/vital_sign_req_model.dart rename to lib/core/model/patient/vital_sign/vital_sign_req_model.dart diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/core/model/patient/vital_sign/vital_sign_res_model.dart similarity index 100% rename from lib/models/patient/vital_sign/vital_sign_res_model.dart rename to lib/core/model/patient/vital_sign/vital_sign_res_model.dart diff --git a/lib/models/pending_orders/pending_order_request_model.dart b/lib/core/model/pending_orders/pending_order_request_model.dart similarity index 100% rename from lib/models/pending_orders/pending_order_request_model.dart rename to lib/core/model/pending_orders/pending_order_request_model.dart diff --git a/lib/models/pending_orders/pending_orders_model.dart b/lib/core/model/pending_orders/pending_orders_model.dart similarity index 100% rename from lib/models/pending_orders/pending_orders_model.dart rename to lib/core/model/pending_orders/pending_orders_model.dart diff --git a/lib/models/pharmacies/pharmacies_List_request_model.dart b/lib/core/model/pharmacies/pharmacies_List_request_model.dart similarity index 100% rename from lib/models/pharmacies/pharmacies_List_request_model.dart rename to lib/core/model/pharmacies/pharmacies_List_request_model.dart diff --git a/lib/models/pharmacies/pharmacies_items_request_model.dart b/lib/core/model/pharmacies/pharmacies_items_request_model.dart similarity index 100% rename from lib/models/pharmacies/pharmacies_items_request_model.dart rename to lib/core/model/pharmacies/pharmacies_items_request_model.dart diff --git a/lib/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart b/lib/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart new file mode 100644 index 00000000..67b234de --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart @@ -0,0 +1,66 @@ +class AcceptOrRejectReqModel { + int patientID; + int projectID; + int admissionNo; + int prescriptionNo; + int orderNo; + String remarks; + int memberID; + int accessLevel; + int languageID; + int lineItemNo; + bool patientOutSA; + int interventionStatus; + int status; + + AcceptOrRejectReqModel( + {this.patientID, + this.projectID, + this.admissionNo, + this.prescriptionNo, + this.orderNo, + this.remarks, + this.memberID, + this.accessLevel, + this.languageID, + this.lineItemNo, + this.patientOutSA, + this.interventionStatus, + this.status + }); + + AcceptOrRejectReqModel.fromJson(Map json) { + patientID = json['PatientID']; + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + prescriptionNo = json['PrescriptionNo']; + orderNo = json['OrderNo']; + remarks = json['Remarks']; + memberID = json['MemberID']; + accessLevel = json['AccessLevel']; + languageID = json['LanguageID']; + lineItemNo = json['LineItemNo']; + patientOutSA = json['PatientOutSA']; + interventionStatus = json['InterventionStatus']; + status = json['Status']; + + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['OrderNo'] = this.orderNo; + data['Remarks'] = this.remarks; + data['MemberID'] = this.memberID; + data['AccessLevel'] = this.accessLevel; + data['LanguageID'] = this.languageID; + data['LineItemNo'] = this.lineItemNo; + data['PatientOutSA'] = this.patientOutSA; + data['InterventionStatus'] = this.interventionStatus; + data['Status'] = this.status; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/accept_or_reject_res_model.dart b/lib/core/model/pharmacy-intervention-model/accept_or_reject_res_model.dart new file mode 100644 index 00000000..7e2448f6 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/accept_or_reject_res_model.dart @@ -0,0 +1,4 @@ +class AcceptOrRejectResModel { + + +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart new file mode 100644 index 00000000..122212b7 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart @@ -0,0 +1,32 @@ +class InterventionMedicationHistoryReqModel { + int projectID; + int patientID; + int admissionNo; + int orderNo; + int prescriptionNo; + + InterventionMedicationHistoryReqModel( + {this.projectID, + this.patientID, + this.admissionNo, + this.orderNo, + this.prescriptionNo}); + + InterventionMedicationHistoryReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart new file mode 100644 index 00000000..451cccb8 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart @@ -0,0 +1,96 @@ +class InterventionMedicationHistoryResModel { + String setupId; + String projectId; + int patientId; + int admissionNo; + int prescriptionId; + int orderNo; + int id; + int interventionId; + Null intervention; + String remark; + int commentedBy; + bool isDoctor; + bool isActive; + int createdBy; + String createdByName; + String createdByNameN; + String createdOn; + Null editedBy; + Null editedByName; + Null editedByNameN; + Null editedOn; + + InterventionMedicationHistoryResModel( + {this.setupId, + this.projectId, + this.patientId, + this.admissionNo, + this.prescriptionId, + this.orderNo, + this.id, + this.interventionId, + this.intervention, + this.remark, + this.commentedBy, + this.isDoctor, + this.isActive, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn}); + + InterventionMedicationHistoryResModel.fromJson(Map json) { + setupId = json['SetupId']; + projectId = json['ProjectId']; + patientId = json['PatientId']; + admissionNo = json['AdmissionNo']; + prescriptionId = json['PrescriptionId']; + orderNo = json['OrderNo']; + id = json['Id']; + interventionId = json['InterventionId']; + intervention = json['Intervention']; + remark = json['Remark']; + commentedBy = json['CommentedBy']; + isDoctor = json['IsDoctor']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + editedOn = json['EditedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectId'] = this.projectId; + data['PatientId'] = this.patientId; + data['AdmissionNo'] = this.admissionNo; + data['PrescriptionId'] = this.prescriptionId; + data['OrderNo'] = this.orderNo; + data['Id'] = this.id; + data['InterventionId'] = this.interventionId; + data['Intervention'] = this.intervention; + data['Remark'] = this.remark; + data['CommentedBy'] = this.commentedBy; + data['IsDoctor'] = this.isDoctor; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + data['EditedOn'] = this.editedOn; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/new_medication_req_model.dart b/lib/core/model/pharmacy-intervention-model/new_medication_req_model.dart new file mode 100644 index 00000000..92cde706 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/new_medication_req_model.dart @@ -0,0 +1,25 @@ +class InterventionMedicationReqModel { + int projectID; + int patientID; + String fromDate; + String toDate; + + InterventionMedicationReqModel( + {this.projectID, this.patientID, this.fromDate, this.toDate}); + + InterventionMedicationReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + fromDate = json['FromDate']; + toDate = json['ToDate']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['FromDate'] = this.fromDate; + data['ToDate'] = this.toDate; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacy-intervention-model/new_medication_res_model.dart b/lib/core/model/pharmacy-intervention-model/new_medication_res_model.dart new file mode 100644 index 00000000..5d3dca39 --- /dev/null +++ b/lib/core/model/pharmacy-intervention-model/new_medication_res_model.dart @@ -0,0 +1,100 @@ +class InterventionMedicationResModel { + String cS; + String iHR; + String setupID; + int projectID; + int accessLevel; + int patientID; + String patientName; + String description; + int admissionNo; + int orderNo; + int prescriptionNo; + int lineItemNo; + int itemID; + String medication; + String doctorComments; + String startDatetime; + String stopDatetime; + int status; + int createdBy; + int authorizedby; + Null pharmacyRemarks; + String statusDescription; + + InterventionMedicationResModel( + {this.cS, + this.iHR, + this.setupID, + this.projectID, + this.accessLevel, + this.patientID, + this.patientName, + this.description, + this.admissionNo, + this.orderNo, + this.prescriptionNo, + this.lineItemNo, + this.itemID, + this.medication, + this.doctorComments, + this.startDatetime, + this.stopDatetime, + this.status, + this.createdBy, + this.authorizedby, + this.pharmacyRemarks, + this.statusDescription}); + + InterventionMedicationResModel.fromJson(Map json) { + cS = json['CS']; + iHR = json['IHR']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + accessLevel = json['AccessLevel']; + patientID = json['PatientID']; + patientName = json['PatientName']; + description = json['Description']; + admissionNo = json['AdmissionNo']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + lineItemNo = json['LineItemNo']; + itemID = json['ItemID']; + medication = json['Medication']; + doctorComments = json['DoctorComments']; + startDatetime = json['StartDatetime']; + stopDatetime = json['StopDatetime']; + status = json['Status']; + createdBy = json['CreatedBy']; + authorizedby = json['Authorizedby']; + pharmacyRemarks = json['PharmacyRemarks']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['CS'] = this.cS; + data['IHR'] = this.iHR; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AccessLevel'] = this.accessLevel; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['Description'] = this.description; + data['AdmissionNo'] = this.admissionNo; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['LineItemNo'] = this.lineItemNo; + data['ItemID'] = this.itemID; + data['Medication'] = this.medication; + data['DoctorComments'] = this.doctorComments; + data['StartDatetime'] = this.startDatetime; + data['StopDatetime'] = this.stopDatetime; + data['Status'] = this.status; + data['CreatedBy'] = this.createdBy; + data['Authorizedby'] = this.authorizedby; + data['PharmacyRemarks'] = this.pharmacyRemarks; + data['StatusDescription'] = this.statusDescription; + return data; + } +} \ No newline at end of file diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/core/model/sickleave/add_sickleave_request.dart similarity index 100% rename from lib/models/sickleave/add_sickleave_request.dart rename to lib/core/model/sickleave/add_sickleave_request.dart diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/core/model/sickleave/extend_sick_leave_request.dart similarity index 100% rename from lib/models/sickleave/extend_sick_leave_request.dart rename to lib/core/model/sickleave/extend_sick_leave_request.dart diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/core/model/sickleave/get_all_sickleave_response.dart similarity index 100% rename from lib/models/sickleave/get_all_sickleave_response.dart rename to lib/core/model/sickleave/get_all_sickleave_response.dart diff --git a/lib/models/sickleave/sick_leave_statisitics_model.dart b/lib/core/model/sickleave/sick_leave_statisitics_model.dart similarity index 100% rename from lib/models/sickleave/sick_leave_statisitics_model.dart rename to lib/core/model/sickleave/sick_leave_statisitics_model.dart diff --git a/lib/core/model/vte_assessment/vte_assessment_req_model.dart b/lib/core/model/vte_assessment/vte_assessment_req_model.dart new file mode 100644 index 00000000..1f0bd1fa --- /dev/null +++ b/lib/core/model/vte_assessment/vte_assessment_req_model.dart @@ -0,0 +1,22 @@ +class VteAssessmentRequestModel { + String setupID; + int parameterGroup; + int transactionNo; + + VteAssessmentRequestModel( + {this.setupID = "010266", this.parameterGroup = 7, this.transactionNo}); + + VteAssessmentRequestModel.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + transactionNo = json['TransactionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['TransactionNo'] = this.transactionNo; + return data; + } +} diff --git a/lib/core/model/vte_assessment/vte_assessment_res_model.dart b/lib/core/model/vte_assessment/vte_assessment_res_model.dart new file mode 100644 index 00000000..8bd2c441 --- /dev/null +++ b/lib/core/model/vte_assessment/vte_assessment_res_model.dart @@ -0,0 +1,48 @@ +class VteAssessmentResponseModel { + int lineItemNo; + String vTEType; + String ambulationProtocol; + String pharmacology; + String reasonsThrombo; + String riskScore; + int totalScore; + int createdBy; + String createdOn; + + VteAssessmentResponseModel( + {this.lineItemNo, + this.vTEType, + this.ambulationProtocol, + this.pharmacology, + this.reasonsThrombo, + this.riskScore, + this.totalScore, + this.createdBy, + this.createdOn}); + + VteAssessmentResponseModel.fromJson(Map json) { + lineItemNo = json['LineItemNo']; + vTEType = json['VTE_Type']; + ambulationProtocol = json['AmbulationProtocol']; + pharmacology = json['Pharmacology']; + reasonsThrombo = json['ReasonsThrombo']; + riskScore = json['Risk_Score']; + totalScore = json['Total_Score']; + createdBy = json['Created_By']; + createdOn = json['Created_On']; + } + + Map toJson() { + final Map data = new Map(); + data['LineItemNo'] = this.lineItemNo; + data['VTE_Type'] = this.vTEType; + data['AmbulationProtocol'] = this.ambulationProtocol; + data['Pharmacology'] = this.pharmacology; + data['ReasonsThrombo'] = this.reasonsThrombo; + data['Risk_Score'] = this.riskScore; + data['Total_Score'] = this.totalScore; + data['Created_By'] = this.createdBy; + data['Created_On'] = this.createdOn; + return data; + } +} diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 288db1d5..6fdbf045 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index cb2879a6..4de0a7e4 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -8,9 +8,9 @@ import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/doctor/user_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; class AuthenticationService extends BaseService { List _imeiDetails = []; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index ce588b88..9334a61b 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 6c8a32e9..f68aa01a 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'base_service.dart'; diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 8825fb7a..43d76c80 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; class DashboardService extends BaseService { List _dashboardItemsList = []; diff --git a/lib/core/service/home/doctor_reply_service.dart b/lib/core/service/home/doctor_reply_service.dart index dd502e3e..c9561bf7 100644 --- a/lib/core/service/home/doctor_reply_service.dart +++ b/lib/core/service/home/doctor_reply_service.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; class DoctorReplyService extends BaseService { List get listDoctorWorkingHoursTable => diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index bfbee1c2..dac56e17 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class ScanQrService extends BaseService { List myInPatientList = List(); diff --git a/lib/core/service/home/schedule_service.dart b/lib/core/service/home/schedule_service.dart index 0aac1e88..f884516f 100644 --- a/lib/core/service/home/schedule_service.dart +++ b/lib/core/service/home/schedule_service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; -import 'package:doctor_app_flutter/models/doctor/request_schedule.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/request_schedule.dart'; class ScheduleService extends BaseService { List get listDoctorWorkingHoursTable => diff --git a/lib/core/service/patient/DischargedPatientService.dart b/lib/core/service/patient/DischargedPatientService.dart index 2b353016..c270be8e 100644 --- a/lib/core/service/patient/DischargedPatientService.dart +++ b/lib/core/service/patient/DischargedPatientService.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class DischargedPatientService extends BaseService { List myDischargedPatients = List(); diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 669621ae..bdf8d1b5 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDocto import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart'; import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class LiveCarePatientServices extends BaseService { List _patientList = []; diff --git a/lib/core/service/patient/MyReferralPatientService.dart b/lib/core/service/patient/MyReferralPatientService.dart index 2e8d9f7c..18146986 100644 --- a/lib/core/service/patient/MyReferralPatientService.dart +++ b/lib/core/service/patient/MyReferralPatientService.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.da import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/referral/add_referred_remarks_request.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; +import 'package:doctor_app_flutter/core/model/doctor/request_add_referred_doctor_remarks.dart'; class MyReferralInPatientService extends BaseService { List myReferralPatients = List(); diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 304b5f96..74db4453 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class OutPatientService extends BaseService { List _patientList = []; diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 200734fd..b61e18b9 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/clinic-doctor.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/request_my_referral_patient_model.dart'; import '../base/lookup-service.dart'; diff --git a/lib/core/service/patient/patientInPatientService.dart b/lib/core/service/patient/patientInPatientService.dart index 4a5774fb..86e7d236 100644 --- a/lib/core/service/patient/patientInPatientService.dart +++ b/lib/core/service/patient/patientInPatientService.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { List inPatientList = List(); diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 198905ed..7db9fd1b 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -5,27 +5,29 @@ import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartVal import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/stp_master_list_req_model.dart'; +import 'package:doctor_app_flutter/core/model/note/stp_master_list_res_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/get_list_stp_referral_frequency_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/radiology/radiology_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/refer_to_doctor_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; -import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart'; -import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; class PatientService extends BaseService { List _patientVitalSignList = []; @@ -78,6 +80,8 @@ class PatientService extends BaseService { List get diabeticChartValuesList => _diabeticChartValuesList; + List stpMasterList = []; + // TODO: replace var with model var _insuranceApporvalsList = []; @@ -270,7 +274,7 @@ class PatientService extends BaseService { Future getPatientRadiology(patient) async { hasError = false; await baseAppClient.post( - GET_RADIOLOGY, + GET_IN_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { _patientRadiologyList = []; response['List_GetRadOreders'].forEach((v) { @@ -558,4 +562,22 @@ class PatientService extends BaseService { body: getDiabeticChartValuesRequestModel.toJson(), ); } + + Future getStpMasterList( + StpMasterListRequestModel stpMasterListRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_STP_MASTER_LIST, + onSuccess: (dynamic response, int statusCode) { + stpMasterList = []; + stpMasterList = response['List_STPMasterList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: stpMasterListRequestModel.toJson(), + ); + } } diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index f43a5c2f..2b3476a3 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; class DischargeSummaryService extends BaseService { List _pendingDischargeSummaryList = []; diff --git a/lib/core/service/patient/profile/intervention_medication_service.dart b/lib/core/service/patient/profile/intervention_medication_service.dart new file mode 100644 index 00000000..a48a560e --- /dev/null +++ b/lib/core/service/patient/profile/intervention_medication_service.dart @@ -0,0 +1,66 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_res_model.dart'; +class InterventionMedicationService extends BaseService { + + List _allInterventionList = []; + + List _allInterventionHistoryList = []; + + List get allInterventionList => + _allInterventionList; + + List get allInterventionHistoryList => + _allInterventionHistoryList; + + Future getInterventionMedication( + {InterventionMedicationReqModel interventionMedicationReqModel}) async { + hasError = false; + await baseAppClient.post(GET_INTERVENTION_MEDICATION, + onSuccess: (dynamic response, int statusCode) { + _allInterventionList.clear(); + response['List_InterventionMedications'].forEach( + (v) { + _allInterventionList.add(InterventionMedicationResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: interventionMedicationReqModel.toJson()); + } + + Future getInterventionMedicationHistory( + {InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel}) async { + hasError = false; + await baseAppClient.post(GET_INTERVENTION_MEDICATION_HISTORY, + onSuccess: (dynamic response, int statusCode) { + _allInterventionHistoryList.clear(); + response['List_InterventionHistory'].forEach( + (v) { + _allInterventionHistoryList.add(InterventionMedicationHistoryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: interventionMedicationHistoryReqModel.toJson()); + } + + Future setAcceptedOrRejected( + {AcceptOrRejectReqModel acceptOrRejectReqModel}) async { + hasError = false; + await baseAppClient.post(SET_ACCEPTED_OR_REJECTED, + onSuccess: (dynamic response, int statusCode) { + _allInterventionHistoryList.clear(); + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: acceptOrRejectReqModel.toJson()); + } +} diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 1ff58d4d..0ef6a503 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_request_model.dart'; class OperationReportService extends BaseService { List _reservationList = []; diff --git a/lib/core/service/patient/profile/vte_assessment_service.dart b/lib/core/service/patient/profile/vte_assessment_service.dart new file mode 100644 index 00000000..651f2b50 --- /dev/null +++ b/lib/core/service/patient/profile/vte_assessment_service.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; + +class VteAssessmentService extends BaseService { + + List _allVteHistoryList = []; + + List get allVteHistoryList => + _allVteHistoryList; + Future getVteAssessment( + {VteAssessmentRequestModel vteAssessmentRequestModel}) async { + hasError = false; + await baseAppClient.post(VTE_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + _allVteHistoryList.clear(); + response['INP_VTEHistoryByTransactionNo_List'].forEach( + (v) { + _allVteHistoryList.add(VteAssessmentResponseModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: vteAssessmentRequestModel.toJson()); + } +} diff --git a/lib/core/service/patient/referral_patient_service.dart b/lib/core/service/patient/referral_patient_service.dart index 3aa9e0e8..2e79d41e 100644 --- a/lib/core/service/patient/referral_patient_service.dart +++ b/lib/core/service/patient/referral_patient_service.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/request_add_referred_doctor_remarks.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/request_my_referral_patient_model.dart'; class ReferralPatientService extends BaseService { List _listMyReferralPatientModel = []; diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 865e5086..1fcc4f78 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart'; import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart'; import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( @@ -34,7 +34,7 @@ class InsuranceCardService extends BaseService { hasError = false; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, + await baseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 060de1ca..a7772e4d 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index eb8a10fb..f36959f1 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MedicalReportTemplate.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class PatientMedicalReportService extends BaseService { List medicalReportList = []; diff --git a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart index 8a85fa4f..19eda72e 100644 --- a/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart +++ b/lib/core/service/patient_medical_file/medical_report/medical_file_service.dart @@ -9,10 +9,7 @@ class MedicalFileService extends BaseService { List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( - //patientMRN: 1231755, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", - ); + ); Future getMedicalFile({int mrn}) async { _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); diff --git a/lib/core/service/patient_medical_file/prescription/medicine_service.dart b/lib/core/service/patient_medical_file/prescription/medicine_service.dart index 323bc2bd..5d059f99 100644 --- a/lib/core/service/patient_medical_file/prescription/medicine_service.dart +++ b/lib/core/service/patient_medical_file/prescription/medicine_service.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart'; -import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/pharmacies/pharmacies_List_request_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacies/pharmacies_items_request_model.dart'; class MedicineService extends BaseService { var _pharmacyItemsList = []; diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index f0594fe0..217a5c2f 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -1,24 +1,42 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:flutter/cupertino.dart'; class PrescriptionService extends LookupService { List _prescriptionList = List(); List get prescriptionList => _prescriptionList; + + List _prescriptionListNew = List(); + + List get prescriptionListNew => _prescriptionListNew; + List _drugsList = List(); List get drugsList => _drugsList; @@ -37,7 +55,6 @@ class PrescriptionService extends LookupService { ItemByMedicineRequestModel _itemByMedicineRequestModel = ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( - //search: ["Acetaminophen"], search: ["Amoxicillin"], ); @@ -81,16 +98,23 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescription({int mrn}) async { + Future getPrescriptionListNew({int mrn, int appNo }) async { _prescriptionReqModel = PrescriptionReqModel( patientMRN: mrn, + appNo:appNo ); hasError = false; _prescriptionList.clear(); + _prescriptionListNew.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { _prescriptionList .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + if(response['PrescriptionList']!=null){ + response['PrescriptionList']["entityList"].forEach((prescriptions) { + _prescriptionListNew.add(PrescriptionEntityModel.fromJson(prescriptions)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -167,56 +191,6 @@ class PrescriptionService extends LookupService { List allergy, PatiantInformtion patient, List prescription) async { - // Map request = { - // "Prescription": { - // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, - // "objVitalSign": {"Height": "180", "Weight": "37"}, - // "objPrescriptionItems": [ - // { - // "DrugId": "83-20-00-30-20-03-03", - // "DrugName": "WARFARIN 1 MG TAB 28'S (N)", - // "Dose": "1", - // "DoseType": "04", - // "Unit": "actuation(s)", - // "FrequencyType": "1/3/Day", - // "Duration": "3/Day", - // "IsScreen": "true" - // }, - // { - // "DrugId": "64-20-00-10-00-03-15", - // "DrugName": "PANADOL 500 MG TAB 24'S(DIS)", - // "Dose": "1", - // "DoseType": "04", - // "Unit": "MG", - // "FrequencyType": "3/1/Day", - // "Duration": "4/Day", - // "RouteID": "24", - // "IsScreen": "true" - // } - // ], - // "objAllergies": { - // "Allergy": { - // "objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"} - // } - // }, - // "objDiagnosis": { - // "Diagnosis": { - // "objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"} - // } - // }, - // "IsDoctor": "false", - // "IsPharmacist": "false" - // }, - // "IPAdress": "10.10.10.10", - // "Channel": 9, - // "LanguageID": 2, - // "VersionID": 5.3, - // "SessionID": "BlUSkYymTt", - // "IsLoginForDoctorApp": true, - // "PatientOutSA": 0, - // "TokenID": "@dm!n", - // "OutSA": true - // }; Map request = { "Prescription": { "objPatientInfo": { @@ -286,4 +260,186 @@ class PrescriptionService extends LookupService { }); return lstAssessmentsObj; } + + + + List prescriptionsList = List(); + List medicationForInPatient = List(); + List prescriptionsOrderList = List(); + List prescriptionInPatientList = List(); + + GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = + GetMedicationForInPatientRequestModel(); + + Future getPrescriptions(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.postPatient(GET_PRESCRIPTION, patient: patient, + onSuccess: (dynamic response, int statusCode) { + prescriptionsList.clear(); + response['PatientPrescriptionList'].forEach((prescriptions) { + prescriptionsList.add(Prescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPrescriptionReport _requestPrescriptionReport = + RequestPrescriptionReport( + appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = List(); + + Future getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { + hasError = false; + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.projectID = prescriptions.projectID; + _requestPrescriptionReport.clinicID = prescriptions.clinicID; + _requestPrescriptionReport.setupID = prescriptions.setupID; + _requestPrescriptionReport.episodeID = prescriptions.episodeID; + _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; + + await baseAppClient.postPatient( + prescriptions.isInOutPatient + ? GET_PRESCRIPTION_REPORT_ENH + : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptionReportList.clear(); + prescriptionReportEnhList.clear(); + if (prescriptions.isInOutPatient) { + response['ListPRM'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList + .add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReport.toJson()); + } + + RequestGetListPharmacyForPrescriptions + requestGetListPharmacyForPrescriptions = + RequestGetListPharmacyForPrescriptions( + latitude: 0, + longitude: 0, + isDentalAllowedBackend: false, + ); + List pharmacyPrescriptionsList = List(); + + + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = + RequestPrescriptionReportEnh( + isDentalAllowedBackend: false, + ); + + List prescriptionReportEnhList = List(); + + Future getPrescriptionReportEnh( + {PrescriptionsOrder prescriptionsOrder, + @required PatiantInformtion patient}) async { + ///This logic copy from the old app from class [order-history.component.ts] in line 45 + bool isInPatient = false; + prescriptionsList.forEach((element) { + if (prescriptionsOrder.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + } + } else { + if (int.parse(prescriptionsOrder.appointmentNo) == + element.appointmentNo) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + + ///call inpGetPrescriptionReport + } + } + }); + + hasError = false; + + await baseAppClient.postPatient( + isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, onSuccess: (dynamic response, int statusCode) { + prescriptionReportEnhList.clear(); + + if (isInPatient) { + response['ListPRM'].forEach((prescriptions) { + prescriptionReportEnhList + .add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + PrescriptionReportEnh reportEnh = + PrescriptionReportEnh.fromJson(prescriptions); + reportEnh.itemDescription = prescriptions['ItemDescriptionN']; + prescriptionReportEnhList.add(reportEnh); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReportEnh.toJson()); + } + + Future getPrescriptionsOrders() async { + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, + onSuccess: (dynamic response, int statusCode) { + prescriptionsOrderList.clear(); + response['PatientER_GetPatientAllPresOrdersList'] + .forEach((prescriptionsOrder) { + prescriptionsOrderList + .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getMedicationForInPatient(PatiantInformtion patient) async { + hasError = false; + _getMedicationForInPatientRequestModel = + GetMedicationForInPatientRequestModel( + isDentalAllowedBackend: false, + admissionNo: int.parse(patient.admissionNo), + tokenID: "@dm!n", + projectID: patient.projectId, + ); + await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, + patient: patient, onSuccess: (dynamic response, int statusCode) { + medicationForInPatient.clear(); + response['List_GetMedicationForInpatient'].forEach((prescriptions) { + medicationForInPatient + .add(GetMedicationForInPatientModel.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _getMedicationForInPatientRequestModel.toJson()); + } } diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart deleted file mode 100644 index 39b0c828..00000000 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ /dev/null @@ -1,238 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/in_patient_prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/cupertino.dart'; - -import '../../base/base_service.dart'; - -class PrescriptionsService extends BaseService { - List prescriptionsList = List(); - List medicationForInPatient = List(); - List prescriptionsOrderList = List(); - List prescriptionInPatientList = List(); - - InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = - InPatientPrescriptionRequestModel(); - GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel = - GetMedicationForInPatientRequestModel(); - - Future getPrescriptionInPatient({int mrn, String adn}) async { - _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( - patientMRN: mrn, - admissionNo: adn, - ); - hasError = false; - prescriptionInPatientList.clear(); - - await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, - onSuccess: (dynamic response, int statusCode) { - prescriptionsList.clear(); - response['List_PrescriptionReportForInPatient'].forEach((prescriptions) { - prescriptionInPatientList - .add(PrescriotionInPatient.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _inPatientPrescriptionRequestModel.toJson()); - } - - Future getPrescriptions(PatiantInformtion patient) async { - hasError = false; - Map body = Map(); - body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, - onSuccess: (dynamic response, int statusCode) { - prescriptionsList.clear(); - response['PatientPrescriptionList'].forEach((prescriptions) { - prescriptionsList.add(Prescriptions.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - - RequestPrescriptionReport _requestPrescriptionReport = - RequestPrescriptionReport( - appointmentNo: 0, isDentalAllowedBackend: false); - List prescriptionReportList = List(); - - Future getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { - hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; - _requestPrescriptionReport.projectID = prescriptions.projectID; - _requestPrescriptionReport.clinicID = prescriptions.clinicID; - _requestPrescriptionReport.setupID = prescriptions.setupID; - _requestPrescriptionReport.episodeID = prescriptions.episodeID; - _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; - - await baseAppClient.postPatient( - prescriptions.isInOutPatient - ? GET_PRESCRIPTION_REPORT_ENH - : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { - prescriptionReportList.clear(); - prescriptionReportEnhList.clear(); - if (prescriptions.isInOutPatient) { - response['ListPRM'].forEach((prescriptions) { - prescriptionReportList - .add(PrescriptionReport.fromJson(prescriptions)); - prescriptionReportEnhList - .add(PrescriptionReportEnh.fromJson(prescriptions)); - }); - } else { - response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - prescriptionReportList - .add(PrescriptionReport.fromJson(prescriptions)); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestPrescriptionReport.toJson()); - } - - RequestGetListPharmacyForPrescriptions - requestGetListPharmacyForPrescriptions = - RequestGetListPharmacyForPrescriptions( - latitude: 0, - longitude: 0, - isDentalAllowedBackend: false, - ); - List pharmacyPrescriptionsList = List(); - - Future getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { - hasError = false; - requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, - onSuccess: (dynamic response, int statusCode) { - pharmacyPrescriptionsList.clear(); - response['PharmList'].forEach((prescriptions) { - pharmacyPrescriptionsList - .add(PharmacyPrescriptions.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: requestGetListPharmacyForPrescriptions.toJson()); - } - - RequestPrescriptionReportEnh _requestPrescriptionReportEnh = - RequestPrescriptionReportEnh( - isDentalAllowedBackend: false, - ); - - List prescriptionReportEnhList = List(); - - Future getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { - ///This logic copy from the old app from class [order-history.component.ts] in line 45 - bool isInPatient = false; - prescriptionsList.forEach((element) { - if (prescriptionsOrder.appointmentNo == "0") { - if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { - _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; - _requestPrescriptionReportEnh.clinicID = element.clinicID; - _requestPrescriptionReportEnh.projectID = element.projectID; - _requestPrescriptionReportEnh.episodeID = element.episodeID; - _requestPrescriptionReportEnh.setupID = element.setupID; - _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; - } - } else { - if (int.parse(prescriptionsOrder.appointmentNo) == - element.appointmentNo) { - _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; - _requestPrescriptionReportEnh.clinicID = element.clinicID; - _requestPrescriptionReportEnh.projectID = element.projectID; - _requestPrescriptionReportEnh.episodeID = element.episodeID; - _requestPrescriptionReportEnh.setupID = element.setupID; - _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; - isInPatient = element.isInOutPatient; - - ///call inpGetPrescriptionReport - } - } - }); - - hasError = false; - - await baseAppClient.postPatient( - isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, onSuccess: (dynamic response, int statusCode) { - prescriptionReportEnhList.clear(); - - if (isInPatient) { - response['ListPRM'].forEach((prescriptions) { - prescriptionReportEnhList - .add(PrescriptionReportEnh.fromJson(prescriptions)); - }); - } else { - response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - PrescriptionReportEnh reportEnh = - PrescriptionReportEnh.fromJson(prescriptions); - reportEnh.itemDescription = prescriptions['ItemDescriptionN']; - prescriptionReportEnhList.add(reportEnh); - }); - } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _requestPrescriptionReportEnh.toJson()); - } - - Future getPrescriptionsOrders() async { - Map body = Map(); - body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, - onSuccess: (dynamic response, int statusCode) { - prescriptionsOrderList.clear(); - response['PatientER_GetPatientAllPresOrdersList'] - .forEach((prescriptionsOrder) { - prescriptionsOrderList - .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - - Future getMedicationForInPatient(PatiantInformtion patient) async { - hasError = false; - _getMedicationForInPatientRequestModel = - GetMedicationForInPatientRequestModel( - isDentalAllowedBackend: false, - admissionNo: int.parse(patient.admissionNo), - tokenID: "@dm!n", - projectID: patient.projectId, - ); - await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, - patient: patient, onSuccess: (dynamic response, int statusCode) { - medicationForInPatient.clear(); - response['List_GetMedicationForInpatient'].forEach((prescriptions) { - medicationForInPatient - .add(GetMedicationForInPatientModel.fromJson(prescriptions)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _getMedicationForInPatientRequestModel.toJson()); - } -} diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index be674540..8370e968 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -43,15 +43,6 @@ class ProcedureService extends BaseService { ProcedureTempleteDetailsRequestModel(); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( - // clinicId: 17, - // pageSize: 10, - // pageIndex: 1, - // //patientMRN: 3120725, - // //categoryId: null, - // vidaAuthTokenID: - // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", - // - // search: ["lab"], ); GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( @@ -59,20 +50,16 @@ class ProcedureService extends BaseService { pageSize: 100, pageIndex: 1, patientMRN: 0, - //categoryId: null, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", - - //search: ["DENTAL"], ); Future getProcedureTemplate( - {int doctorId, int projectId, int clinicId, String categoryID}) async { + {int doctorId, int projectId, int clinicId, String categoryID, bool isLocalBusy}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( // tokenID: "@dm!n", patientID: 0, searchType: 1, ); + hasError = false; await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/, diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 4a77fc31..965fa03b 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 9eb0777c..333ffeea 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -4,10 +4,10 @@ import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_mode import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/models/sickleave/sick_leave_statisitics_model.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/extend_sick_leave_request.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/sick_leave_statisitics_model.dart'; class SickLeaveService extends BaseService { SickLeaveStatisticsModel get sickLeavestatisitics => _statistics; @@ -186,7 +186,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( - GET_OFFTIME, + GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { offTime = []; response['MasterLookUpList']['entityList'].forEach((item) => { @@ -208,7 +208,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( - GET_OFFTIME, + GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { reasonse = []; reasonse = response['MasterLookUpList']['entityList']; diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index aedf5683..b8c187a3 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -1,28 +1,28 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamListResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_progress_note_request_model.dart'; import '../../base/lookup-service.dart'; @@ -229,7 +229,7 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, + await baseAppClient.post(GET_ALLERGIES, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 53fa257e..4305dbec 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { List patientChiefComplaintList; @@ -159,7 +159,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, + await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); diff --git a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart index af6c46b4..a74969d1 100644 --- a/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart +++ b/lib/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; class VitalSignsService extends BaseService { VitalSignData patientVitalSigns; diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index ddc21269..17f6ea12 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart'; -import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_request_model.dart'; -import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_model.dart'; -import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_request_model.dart'; +import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_request_model.dart'; +import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { List _pendingOrderList = List(); diff --git a/lib/core/service/special_clinics/special_clinic_service.dart b/lib/core/service/special_clinics/special_clinic_service.dart index b6fdd1ed..6ee126d5 100644 --- a/lib/core/service/special_clinics/special_clinic_service.dart +++ b/lib/core/service/special_clinics/special_clinic_service.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; class SpecialClinicsService extends BaseService { List _specialClinicalCareList = []; diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 9df347e2..a9903f20 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index f7aea34f..7e9a4664 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/insurance/insurance_approval.dart' import 'package:doctor_app_flutter/core/model/insurance/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/insurance/InsuranceCardService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 6ffa036e..485fb795 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -6,10 +6,10 @@ import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_ import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 7392cdd4..f42524b5 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MedicalReportTemplate.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 5acc6f07..656a077f 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestM import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; @@ -126,7 +126,7 @@ class PatientSearchViewModel extends BaseViewModel { } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), + DateTime.now().day + 7), 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat( diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index b11f3d5f..654906a2 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -3,34 +3,34 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetHistoryResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamListResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/GetEpisodeForInpatientReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index b0f93602..5671aa55 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -17,10 +17,10 @@ import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/doctor/user_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index ecad0436..33467e06 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/material.dart'; diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index dfe3c695..efeb65b0 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 8a4abb11..e89f96f9 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_create_doctor_response.dart'; -import 'package:doctor_app_flutter/models/doctor/replay/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart'; +import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 9dbb8b2f..aa2da342 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index 5a3ddd26..b0b47086 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart'; -import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; +import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/get_panding_req_list.dart'; +import 'package:doctor_app_flutter/core/model/livecare/get_pending_res_list.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 62e972ee..25916661 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,14 +1,22 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; - +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; +import 'package:flutter/cupertino.dart'; import '../../locator.dart'; +import '../../util/dr_app_toast_msg.dart'; +import '../../util/helpers.dart'; +import '../../widgets/shared/loader/gif_loader_dialog_utils.dart'; +import '../model/Prescriptions/post_prescrition_req_model.dart'; +import '../model/Prescriptions/prescription_model.dart'; import 'base_view_model.dart'; class MedicineViewModel extends BaseViewModel { @@ -17,6 +25,7 @@ class MedicineViewModel extends BaseViewModel { ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); + List get procedureTemplate => _procedureService.templateList; List templateList = List(); @@ -56,18 +65,22 @@ class MedicineViewModel extends BaseViewModel { List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; - Future getItem({int itemID}) async { - //hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); + + Future getItem({int itemID, bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } + setTemplateListDependOnId() { procedureTemplate.forEach((element) { List templateListData = templateList @@ -90,31 +103,133 @@ class MedicineViewModel extends BaseViewModel { print(templateList.length.toString()); } - Future getProcedureTemplate({String categoryID}) async { - hasError = false; - setState(ViewState.Busy); - await _procedureService.getProcedureTemplate(categoryID: categoryID); - if (_procedureService.hasError) { - error = _procedureService.error; - setState(ViewState.ErrorLocal); + + + + getPrescriptionForDrug( + List prescriptionList, + MedicineViewModel model, + ) { + var prescriptionDetails = []; + if (prescriptionList.length > 0) { + prescriptionList[0].entityList.forEach((element) { + if (element.mediSpanGPICode != null) { + prescriptionDetails.add({ + 'DrugId': element.mediSpanGPICode, + 'DrugName': element.medicationName, + 'Dose': element.doseDailyQuantity, + 'DoseType': element.doseDailyUnitID, + 'Unit': element.uom, + 'FrequencyType': element.frequencyID, + 'Duration': element.doseDurationDays, + 'RouteID': element.routeID, + 'IsScreen': element.isSIG + }); + } + }); + } + return prescriptionDetails; + } + + + postPrescription( + {String duration, + String doseTimeIn, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model, + DateTime doseTime, + String doseUnit, + String icdCode, + PatiantInformtion patient, + String patientType, + bool isLocalBusy = false, + BuildContext context, PrescriptionRequestModel prescriptionRequestModel}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + PostPrescriptionReqModel postProcedureReqModel = + new PostPrescriptionReqModel(); + List prescriptionList = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.clinicID = patient.clinicId; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + prescriptionList.add(PrescriptionRequestModel( + covered: true, + dose: double.parse(dose), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), + remarks: instruction, + approvalRequired: true, + icdcode10Id: icdCode.toString(), + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime.toIso8601String())); + postProcedureReqModel.prescriptionRequestModel = prescriptionList; + await _prescriptionService.postPrescription(postProcedureReqModel); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } } else { - setTemplateListDependOnId(); setState(ViewState.Idle); + // TODO Elham* to investigate why we are calling that + setTemplateListDependOnId(); } } - Future getPrescription({int mrn}) async { - //hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.getPrescription(mrn: mrn); + + + Future getAssessmentList ({PatiantInformtion patientInfo, bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: patientInfo.appointmentNo); + if (medicationStrengthList.length == 0) { + await getMedicationStrength(isLocalBusy: true); + } + if (medicationDurationList.length == 0) { + await getMedicationDuration(isLocalBusy: true); + } + if (medicationDoseTimeList.length == 0) { + await getMedicationDoseTime(isLocalBusy: true); + } + await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } + } else { setState(ViewState.Idle); + } } + Future getMedicineItem(String itemName) async { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); @@ -125,35 +240,93 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationList({String drug}) async { - setState(ViewState.Busy); + + getMedicationList( + {String drug, bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await getDoctorProfile(isGetProfile: true); await _prescriptionService.getMedicationList(drug: drug); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); - } else + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } + } else { setState(ViewState.Idle); + } } Future getPatientAssessment( - GetAssessmentReqModel getAssessmentReqModel) async { - setState(ViewState.Busy); + GetAssessmentReqModel getAssessmentReqModel ,{bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService.getPatientAssessment(getAssessmentReqModel); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - Future getMedicationStrength() async { - setState(ViewState.Busy); + Future onInitiateAllPrescription({ + PrescriptionViewModel model, + PatiantInformtion patient, + ProcedureTempleteDetailsModel groupProcedures, + BuildContext context, + bool isLocalBusy = true + } + ) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + model.getItem( + itemID: int.parse( + groupProcedures.aliasN.replaceAll("item code ;", ""))); + + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: patient.patientMRN, + episodeID: patient.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: patient.appointmentNo); + if (medicationStrengthList.length == 0) { + await getMedicationStrength(); + } + if (medicationDurationList.length == 0) { + await getMedicationDuration(); + } + if (medicationDoseTimeList.length == 0) { + await getMedicationDoseTime(); + } + await getPatientAssessment(getAssessmentReqModel); + } + + Future getMedicationStrength({bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService .getMasterLookup(MasterKeysService.MedicationStrength); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); - } else + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + }} else setState(ViewState.Idle); } @@ -179,9 +352,12 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationDoseTime() async { - setState(ViewState.Busy); - await _prescriptionService + Future getMedicationDoseTime({bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService .getMasterLookup(MasterKeysService.MedicationDoseTime); if (_prescriptionService.hasError) { error = _prescriptionService.error; @@ -201,13 +377,17 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationDuration() async { - setState(ViewState.Busy); + Future getMedicationDuration({bool isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } await _prescriptionService .getMasterLookup(MasterKeysService.MedicationDuration); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 861c110b..7e18df05 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/clinic-doctor.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; @@ -230,12 +230,12 @@ class PatientReferralViewModel extends BaseViewModel { Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _referralPatientService.makeReferral( patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 0b425ab8..de8bc2f5 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -4,12 +4,12 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:flutter/material.dart'; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index bab2ff9f..fc4bfec3 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 1d5f087a..242ba6c3 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -8,18 +8,20 @@ import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequest import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/radiology/radiology_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; -import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import '../../locator.dart'; +import '../model/note/stp_master_list_req_model.dart'; +import '../model/note/stp_master_list_res_model.dart'; import 'base_view_model.dart'; class PatientViewModel extends BaseViewModel { @@ -71,6 +73,9 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; + List get stpMasterList => + _patientService.stpMasterList; + Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async { var localRes; @@ -101,16 +106,6 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getOutPatientPrescriptions(patient) async { - setState(ViewState.Busy); - await _patientService.getOutPatientPrescriptions(patient); - if (_patientService.hasError) { - error = _patientService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - Future getInPatientPrescriptions(patient) async { setState(ViewState.Busy); await _patientService.getInPatientPrescriptions(patient); @@ -361,6 +356,32 @@ class PatientViewModel extends BaseViewModel { resultType: resultType, setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); + if (_patientService.hasError) { + error = _patientService.error; + if (isLocalBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getStpMasterList({bool isLocalBusy = false}) async { + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); + + StpMasterListRequestModel requestModel = StpMasterListRequestModel( + isDentalAllowedBackend: false, + languageID: 1, + projectID: 15, + parameterGroup: 7, + parameterType: 362); + + await _patientService.getStpMasterList(requestModel); + if (_patientService.hasError) { error = _patientService.error; if (isLocalBusy) diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index 3f3e92be..d2bac7be 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -2,8 +2,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart'; -import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart'; +import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; class PendingOrdersViewModel extends BaseViewModel { bool hasError = false; diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription/prescription_view_model.dart similarity index 53% rename from lib/core/viewModel/prescription_view_model.dart rename to lib/core/viewModel/prescription/prescription_view_model.dart index e329e31d..3c2b38a6 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription/prescription_view_model.dart @@ -4,86 +4,57 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:flutter/cupertino.dart'; class PrescriptionViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; bool hasError = false; + PrescriptionService _prescriptionService = locator(); - List get allMedicationList => - _prescriptionService.allMedicationList; List get medicationForInPatient => - _prescriptionsService.medicationForInPatient; + _prescriptionService.medicationForInPatient; List get prescriptionList => _prescriptionService.prescriptionList; - - List get drugsList => _prescriptionService.doctorsList; - - //List get allMedicationList => _prescriptionService.allMedicationList; - List get drugToDrug => _prescriptionService.drugToDrugList; - - List get itemMedicineList => _prescriptionService.itemMedicineList; - PrescriptionsService _prescriptionsService = locator(); - - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); + List get prescriptionListNew => + _prescriptionService.prescriptionListNew; List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; - - List get prescriptionsList => - _prescriptionsService.prescriptionsList; + _prescriptionService.prescriptionReportList; List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; + _prescriptionService.pharmacyPrescriptionsList; List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; + _prescriptionService.prescriptionReportEnhList; - List get prescriptionsOrderList => - filterType == FilterType.Clinic - ? _prescriptionsOrderListClinic - : _prescriptionsOrderListHospital; - List get inPatientPrescription => - _prescriptionsService.prescriptionInPatientList; - getPrescriptionsInPatient(PatiantInformtion patient) async { - setState(ViewState.Busy); - error = ""; - await _prescriptionsService.getPrescriptionInPatient( - mrn: patient.patientId, adn: patient.admissionNo); - if (_prescriptionsService.hasError) { - error = "No Prescription Found"; - setState(ViewState.Error); - } else { - _filterList(); - await _getPrescriptionsOrders(); + List get drugToDrug => _prescriptionService.drugToDrugList; + + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); - setState(ViewState.Idle); - } - } + + List get prescriptionsList => + _prescriptionService.prescriptionsList; Future getItem({int itemID}) async { hasError = false; - //_insuranceCardService.clearInsuranceCard(); setState(ViewState.BusyLocal); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { @@ -93,11 +64,11 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPrescription({int mrn}) async { + Future getPrescriptionListNew({int mrn,int appNo, bool isLocalBusy = false}) async { hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.getPrescription(mrn: mrn); + if(isLocalBusy) + setState(ViewState.BusyLocal); else setState(ViewState.Busy); + await _prescriptionService.getPrescriptionListNew(mrn: mrn, appNo:appNo ); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); @@ -108,54 +79,17 @@ class PrescriptionViewModel extends BaseViewModel { Future postPrescription( PostPrescriptionReqModel postProcedureReqModel, int mrn) async { hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _prescriptionService.postPrescription(postProcedureReqModel); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { - await getPrescription(mrn: mrn); + await getPrescriptionListNew(mrn: mrn); setState(ViewState.Idle); } } - Future getMedicationList({String drug}) async { - setState(ViewState.Busy); - await _prescriptionService.getMedicationList(drug: drug); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - - Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.updatePrescription(updatePrescriptionReqModel); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else { - await getPrescription(mrn: mrn); - setState(ViewState.Idle); - } - } - - Future getDrugs({String drugName}) async { - hasError = false; - //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.BusyLocal); - await _prescriptionService.getDrugs(drugName: drugName); - if (_prescriptionService.hasError) { - error = _prescriptionService.error; - setState(ViewState.ErrorLocal); - } else - setState(ViewState.Idle); - } Future getDrugToDrug( VitalSignData vital, @@ -164,7 +98,7 @@ class PrescriptionViewModel extends BaseViewModel { PatiantInformtion patient, List prescription) async { hasError = false; - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _prescriptionService.getDrugToDrug( vital, lstAssessments, allergy, patient, prescription); if (_prescriptionService.hasError) { @@ -174,40 +108,9 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } - setFilterType(FilterType filterType) { - this.filterType = filterType; - notifyListeners(); - } - - getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( - prescriptions: prescriptions, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( - itemId: itemId, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } void _filterList() { - _prescriptionsService.prescriptionsList.forEach((element) { + _prescriptionService.prescriptionsList.forEach((element) { /// PrescriptionsList list sort clinic List prescriptionsByClinic = _prescriptionsOrderListClinic @@ -245,39 +148,28 @@ class PrescriptionViewModel extends BaseViewModel { }); } - getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } _getPrescriptionsOrders() async { - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + await _prescriptionService.getPrescriptionsOrders(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } } - getPrescriptions(PatiantInformtion patient, {String patientType}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptions(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - if (patientType == "7") + getPrescriptions(PatiantInformtion patient, {String patientType, bool isLocalBusy = true}) async { + if(isLocalBusy) + setState(ViewState.BusyLocal); + else setState(ViewState.Busy); + await _prescriptionService.getPrescriptions(patient); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + if (isLocalBusy) setState(ViewState.ErrorLocal); else - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else { _filterList(); await _getPrescriptionsOrders(); @@ -288,9 +180,23 @@ class PrescriptionViewModel extends BaseViewModel { getMedicationForInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); - await _prescriptionsService.getMedicationForInPatient(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + await _prescriptionService.getMedicationForInPatient(patient); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionService.getPrescriptionReport( + prescriptions: prescriptions, patient: patient); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart deleted file mode 100644 index b0928430..00000000 --- a/lib/core/viewModel/prescriptions_view_model.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:flutter/material.dart'; - -import '../../locator.dart'; -import 'base_view_model.dart'; - -class PrescriptionsViewModel extends BaseViewModel { - FilterType filterType = FilterType.Clinic; - PrescriptionsService _prescriptionsService = locator(); - - List _prescriptionsOrderListClinic = List(); - List _prescriptionsOrderListHospital = List(); - - List get prescriptionReportList => - _prescriptionsService.prescriptionReportList; - - List get prescriptionsList => - _prescriptionsService.prescriptionsList; - - List get pharmacyPrescriptionsList => - _prescriptionsService.pharmacyPrescriptionsList; - - List get prescriptionReportEnhList => - _prescriptionsService.prescriptionReportEnhList; - - List get prescriptionsOrderList => - filterType == FilterType.Clinic - ? _prescriptionsOrderListClinic - : _prescriptionsOrderListHospital; - - List get medicationForInPatient => - _prescriptionsService.medicationForInPatient; - - List _medicationForInPatient = List(); - - getPrescriptions(PatiantInformtion patient) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptions(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - _filterList(); - await _getPrescriptionsOrders(); - - setState(ViewState.Idle); - } - } - - _getPrescriptionsOrders() async { - await _prescriptionsService.getPrescriptionsOrders(); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - void _filterList() { - _prescriptionsService.prescriptionsList.forEach((element) { - /// PrescriptionsList list sort clinic - List prescriptionsByClinic = - _prescriptionsOrderListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); - - if (prescriptionsByClinic.length != 0) { - _prescriptionsOrderListClinic[ - _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] - .prescriptionsList - .add(element); - } else { - _prescriptionsOrderListClinic.add(PrescriptionsList( - filterName: element.clinicDescription, prescriptions: element)); - } - - /// PrescriptionsList list sort via hospital - List prescriptionsByHospital = - _prescriptionsOrderListHospital - .where( - (elementClinic) => elementClinic.filterName == element.name, - ) - .toList(); - - if (prescriptionsByHospital.length != 0) { - _prescriptionsOrderListHospital[_prescriptionsOrderListHospital - .indexOf(prescriptionsByHospital[0])] - .prescriptionsList - .add(element); - } else { - _prescriptionsOrderListHospital.add(PrescriptionsList( - filterName: element.name, prescriptions: element)); - } - }); - } - - setFilterType(FilterType filterType) { - this.filterType = filterType; - notifyListeners(); - } - - getPrescriptionReport( - {Prescriptions prescriptions, - @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport( - prescriptions: prescriptions, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - getListPharmacyForPrescriptions( - {int itemId, @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getListPharmacyForPrescriptions( - itemId: itemId, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, - @required PatiantInformtion patient}) async { - setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReportEnh( - prescriptionsOrder: prescriptionsOrder, patient: patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - getMedicationForInPatient(PatiantInformtion patient) async { - await _prescriptionsService.getMedicationForInPatient(patient); - if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } -} diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 3466c373..2bcfad33 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -6,8 +6,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' - as cpe; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; @@ -20,11 +19,12 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/p import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:flutter/cupertino.dart'; +import '../../widgets/shared/loader/gif_loader_dialog_utils.dart'; class ProcedureViewModel extends BaseViewModel { //TODO Hussam clean it @@ -117,17 +117,19 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate({String categoryID}) async { - hasError = false; - setState(ViewState.Busy); - await _procedureService.getProcedureTemplate(categoryID: categoryID); + Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); - } else { + } else setTemplateListDependOnId(); setState(ViewState.Idle); - } } setTemplateListDependOnId() { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index a1c32787..d6b8aa77 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -2,8 +2,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; class DischargeSummaryViewModel extends BaseViewModel { bool hasError = false; diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart new file mode 100644 index 00000000..57e3be78 --- /dev/null +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -0,0 +1,147 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/accept_or_reject_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_req_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_res_model.dart'; + +import '../../../util/date-utils.dart'; +import '../../service/patient/profile/intervention_medication_service.dart'; +import '../../service/special_clinics/special_clinic_service.dart'; + +class InterventionMedicationViewModel extends BaseViewModel { + SpecialClinicsService _specialClinicsService = + locator(); + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; + + List filterData = []; + + DateTime selectedFromDate = DateTime.now(); + DateTime selectedToDate = DateTime.now().add(Duration(days: 1)); + + PatiantInformtion patient; + bool hasError = false; + InterventionMedicationService _interventionMedicationService = + locator(); + + List get allInterventionList => + _interventionMedicationService.allInterventionList; + + List get allInterventionHistoryList => + _interventionMedicationService.allInterventionHistoryList; + + Future getInterventionMedication({ + + int projectId, + int patientId, + DateTime fromDate, + DateTime toDate, + + }) async { + InterventionMedicationReqModel interventionMedicationReqModel = + InterventionMedicationReqModel( + + projectID: projectId, + patientID: patientId, + fromDate: AppDateUtils.convertDateToServerFormat(fromDate), + toDate: AppDateUtils.convertDateToServerFormat(toDate), + + ); + hasError = false; + setState(ViewState.Busy); + await _interventionMedicationService.getInterventionMedication( + interventionMedicationReqModel: interventionMedicationReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getInterventionMedicationHistory( + { + int projectId, + int patientId, + int admissionNo, + int prescriptionNo, + int orderNo, + + bool isBusyLocal = false}) async { + InterventionMedicationHistoryReqModel + interventionMedicationHistoryReqModel = + InterventionMedicationHistoryReqModel( + + projectID: projectId, + patientID: patientId, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + + ); + hasError = false; + if (isBusyLocal) + setState(ViewState.Busy); + else + setState(ViewState.Busy); + await _interventionMedicationService.getInterventionMedicationHistory( + interventionMedicationHistoryReqModel: + interventionMedicationHistoryReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + if (isBusyLocal) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future setAcceptedOrRejected({ + + String remarks, + int memberId, + int projectId, + int patientID, + int admissionNo, + int prescriptionNo, + int orderNo, + int interventionStatus, + int status, + + }) async { + AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( + + projectID: projectId, + patientID: patientID, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + accessLevel: 4, + lineItemNo: 1, + remarks: remarks, + memberID: memberId, + interventionStatus: interventionStatus, + status: status + + ); + hasError = false; + setState(ViewState.BusyLocal); + await _interventionMedicationService.setAcceptedOrRejected( + acceptOrRejectReqModel: acceptOrRejectReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index 72d3a073..d57af118 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/profile/operation_report_servive.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_request_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; class OperationReportViewModel extends BaseViewModel { bool hasError = false; diff --git a/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart b/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart new file mode 100644 index 00000000..bb0bd453 --- /dev/null +++ b/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; +import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + + + +class PharmacyInterventionViewModel extends BaseViewModel { + OutPatientService _outPatientService = locator(); + SpecialClinicsService _specialClinicsService = + locator(); + + List get patientList => _outPatientService.patientList; + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; + + List filterData = []; + + DateTime selectedFromDate; + DateTime selectedToDate; + + int firstSubsetIndex = 0; + int inPatientPageSize = 20; + int lastSubsetIndex = 20; + + List InpatientClinicList = []; + + + PatientInPatientService _inPatientService = + locator(); + + List get inPatientList => _inPatientService.inPatientList; + + List get myIinPatientList => + _inPatientService.myInPatientList; + + List filteredInPatientItems = List(); + List filteredMyInPatientItems = List(); + +} diff --git a/lib/core/viewModel/profile/vte_assessment_view_model.dart b/lib/core/viewModel/profile/vte_assessment_view_model.dart new file mode 100644 index 00000000..0ab3fa07 --- /dev/null +++ b/lib/core/viewModel/profile/vte_assessment_view_model.dart @@ -0,0 +1,37 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/vte_assessment_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; + +class VteAssessmentViewModel extends BaseViewModel { + bool hasError = false; + VteAssessmentService _VteAssessmentService = + locator(); + + List get allVteHistoryList => + _VteAssessmentService.allVteHistoryList; + + Future getVteAssessment({ + int patientId, + int admissionNo, + }) async { + VteAssessmentRequestModel vteAssessmentRequestModel = + VteAssessmentRequestModel( + transactionNo: admissionNo); + hasError = false; + setState(ViewState.Busy); + await _VteAssessmentService.getVteAssessment( + vteAssessmentRequestModel: vteAssessmentRequestModel); + if (_VteAssessmentService.hasError) { + error = _VteAssessmentService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 14d2a14b..ddf7c4ab 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -4,8 +4,8 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index d656de6c..98fbc59a 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:flutter/foundation.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/referral_view_model.dart b/lib/core/viewModel/referral_view_model.dart index 892284e2..61c6d930 100644 --- a/lib/core/viewModel/referral_view_model.dart +++ b/lib/core/viewModel/referral_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/referral_patient_service.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index a5bdfa39..680d871e 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestM import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; class ScanQrViewModel extends BaseViewModel { ScanQrService _scanQrService = locator(); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index 3ee64c9b..04d49f36 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/home/schedule_service.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 9a7ce4f2..7fe2ef9b 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; -import 'package:doctor_app_flutter/models/sickleave/sick_leave_statisitics_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/sick_leave_statisitics_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 89faeb0c..c069e7e7 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -49,16 +49,13 @@ class _LandingPageState extends State { backgroundColor: HexColor('#FFFFFF'), //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: currentTab != 0 - ? Padding( - padding: const EdgeInsets.only(right: 188,top: 36), - child: AppText( - getText(currentTab), - letterSpacing: -1.44, - fontWeight: FontWeight.w700, - fontSize: 24.0, - color: Color(0xff2B353E), - ), - ) + ? AppText( + getText(currentTab), + letterSpacing: -1.44, + fontWeight: FontWeight.w700, + fontSize: 24.0, + color: Color(0xff2B353E), + ) : SizedBox(), leading: Builder( builder: (BuildContext context) { diff --git a/lib/locator.dart b/lib/locator.dart index 28f4bfdf..0bdfe8e9 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -7,14 +7,13 @@ import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; - import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; import 'core/service/PatientRegistrationService.dart'; @@ -32,7 +31,9 @@ import 'core/service/patient/out_patient_service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart'; import 'core/service/patient/patientInPatientService.dart'; import 'core/service/patient/patient_service.dart'; +import 'core/service/patient/profile/intervention_medication_service.dart'; import 'core/service/patient/profile/operation_report_servive.dart'; +import 'core/service/patient/profile/vte_assessment_service.dart'; import 'core/service/patient/referral_patient_service.dart'; import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; @@ -41,7 +42,6 @@ import 'core/service/patient_medical_file/medical_report/PatientMedicalReportSer import 'core/service/patient_medical_file/medical_report/medical_file_service.dart'; import 'core/service/patient_medical_file/prescription/medicine_service.dart'; import 'core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'core/service/patient_medical_file/prescription/prescriptions_service.dart'; import 'core/service/patient_medical_file/procedure/procedure_service.dart'; import 'core/service/patient_medical_file/radiology/radiology_service.dart'; import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart'; @@ -64,7 +64,8 @@ import 'core/viewModel/patient-admission-request-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'core/viewModel/prescriptions_view_model.dart'; +import 'core/viewModel/profile/intervention_medication_view_model.dart'; +import 'core/viewModel/profile/vte_assessment_view_model.dart'; import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -94,7 +95,6 @@ void setupLocator() { locator.registerLazySingleton(() => LabsService()); locator.registerLazySingleton(() => InsuranceCardService()); locator.registerLazySingleton(() => RadiologyService()); - locator.registerLazySingleton(() => PrescriptionsService()); locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => DischargedPatientService()); @@ -112,6 +112,8 @@ void setupLocator() { locator.registerLazySingleton(() => PendingOrderService()); locator.registerLazySingleton(() => PatientRegistrationService()); locator.registerLazySingleton(() => DischargeSummaryService()); + locator.registerLazySingleton(() => VteAssessmentService()); + locator.registerLazySingleton(() => InterventionMedicationService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -133,7 +135,6 @@ void setupLocator() { locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => InsuranceViewModel()); locator.registerFactory(() => RadiologyViewModel()); - locator.registerFactory(() => PrescriptionsViewModel()); locator.registerFactory(() => DischargedPatientViewModel()); locator.registerFactory(() => PatientSearchViewModel()); locator.registerFactory(() => HospitalViewModel()); @@ -144,4 +145,6 @@ void setupLocator() { locator.registerFactory(() => PatientRegistrationViewModel()); locator.registerFactory(() => PendingOrdersViewModel()); locator.registerFactory(() => DischargeSummaryViewModel()); + locator.registerFactory(() => VteAssessmentViewModel()); + locator.registerFactory(() => InterventionMedicationViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index 8f636d74..917b1c6c 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -18,11 +18,14 @@ import 'package:doctor_app_flutter/screens/patients/profile/notes/note/progress_ import 'package:doctor_app_flutter/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; import 'package:doctor_app_flutter/screens/patients/profile/pending_orders/pending_orders_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart'; +import 'package:doctor_app_flutter/screens/prescription/new_prescriptions_page.dart'; +import 'package:doctor_app_flutter/screens/prescription/old_prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import './screens/auth/login_screen.dart'; @@ -68,6 +71,7 @@ const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail'; const String PATIENT_ECG = 'patients/ecg'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; +const String ORDER_PRESCRIPTION_OLD = 'prescription/prescription_old'; const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PROCEDURE = 'procedure/procedure'; const String ADD_SICKLEAVE = 'add-sickleave'; @@ -80,7 +84,11 @@ const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; +const String VTE_ASSESSMENT = 'vte_assessment '; const String DISCHARGE_SUMMARY = 'discharge_summary'; +const String PHARMACY_INTERVENTION = 'new_medication'; +const String INTERVENTION_MEDICATION = 'intervention_medication'; + //todo: change the routing way. var routes = { @@ -117,7 +125,8 @@ var routes = { ), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(), - ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), + ORDER_PRESCRIPTION_OLD: (_) => OldPrescriptionsPage(), + ORDER_PRESCRIPTION_NEW: (_) => NewPrescriptionsPage(), ORDER_PROCEDURE: (_) => ProcedureScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(), @@ -131,4 +140,6 @@ var routes = { DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), DIABETIC_CHART_VALUES: (_) => DiabeticChart(), + PHARMACY_INTERVENTION: (_) => PharmacyInterventionScreen(), + VTE_ASSESSMENT: (_) => VteAssessmentScreen(), }; diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 1558e18d..8ee81b95 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 1583161a..685c4903 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - +import 'package:doctor_app_flutter/util/tab_helper.dart'; import 'all_doctor_questions.dart'; import 'not_replaied_Doctor_Questions.dart'; @@ -72,7 +72,7 @@ class _DoctorReplyScreenState extends State preferredSize: Size.fromHeight( MediaQuery.of(context).size.height * 0.070), child: Container( - color: Helpers.getBgTabColor(), + color: TabHelper.getBgTabColor(), child: TabBar( isScrollable: false, controller: _tabController, @@ -136,8 +136,8 @@ Widget tabWidget( return Center( child: Container( - height: Helpers.getTabHeight(context), - decoration: Helpers.getBoxTabsBoxDecoration( + height: TabHelper.getTabHeight(context), + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: isActive, isFirst: isFirst, isMiddle: isMiddle, @@ -146,9 +146,9 @@ Widget tabWidget( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText(title: title, isActive: isActive), + TabHelper.getTabText(title: title, isActive: isActive), if (counter != -1) - Helpers.getTabCounter(isActive: isActive, counter: counter) + TabHelper.getTabCounter(isActive: isActive, counter: counter) ], ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index dce1d38c..8c8324d8 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -34,7 +34,7 @@ class _DoctorReplyWidgetState extends State { bgColor: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR + ? AppGlobal.inProgressColor : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : AppGlobal.appGreenColor, @@ -78,7 +78,7 @@ class _DoctorReplyWidgetState extends State { color: widget.reply.infoStatus == 99 ? Color(0xFF2B353E) : widget.reply.infoStatus == 4 - ? IN_PROGRESS_COLOR + ? AppGlobal.inProgressColor : widget.reply.infoStatus == 3 ? Color(0xFFD02127) : AppGlobal.appGreenColor, @@ -207,10 +207,11 @@ class _DoctorReplyWidgetState extends State { label: TranslationBase.of(context).fileNumber, value: widget.reply.patientID.toString(), isCopyable: false, + isExpanded: false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", - isCopyable: false, + label: TranslationBase.of(context).age + " : ", isCopyable: false, + isExpanded: false, value: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", ), diff --git a/lib/screens/doctor/my_schedule_screen.dart b/lib/screens/doctor/my_schedule_screen.dart index 02c95a2b..de61ec98 100644 --- a/lib/screens/doctor/my_schedule_screen.dart +++ b/lib/screens/doctor/my_schedule_screen.dart @@ -22,7 +22,7 @@ class MyScheduleScreen extends StatelessWidget { ) : Container( color: HexColor("#EFEFEF"), - padding: EdgeInsetsDirectional.fromSTEB(21, 0, 21, 0), + padding: EdgeInsetsDirectional.fromSTEB(0, 0, 21, 0), child: ListView( children: [ Column( diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 9054fc12..11ee6f29 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/home/dashboard_referral_patient.dart b/lib/screens/home/dashboard_referral_patient.dart index 8b134f61..33bacd50 100644 --- a/lib/screens/home/dashboard_referral_patient.dart +++ b/lib/screens/home/dashboard_referral_patient.dart @@ -2,7 +2,7 @@ import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; diff --git a/lib/screens/home/dashboard_slider-item-widget.dart b/lib/screens/home/dashboard_slider-item-widget.dart index d36f0094..9ee8d9d3 100644 --- a/lib/screens/home/dashboard_slider-item-widget.dart +++ b/lib/screens/home/dashboard_slider-item-widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/home/dashboard_swipe_widget.dart b/lib/screens/home/dashboard_swipe_widget.dart index d89efd7d..9f4d45c9 100644 --- a/lib/screens/home/dashboard_swipe_widget.dart +++ b/lib/screens/home/dashboard_swipe_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index df810361..0d8d4150 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; @@ -424,24 +424,24 @@ class _HomeScreenState extends State { }, )); changeColorIndex(); - - patientCards.add(HomePatientCard( - gradient: backgroundColors[colorIndex], - backgroundIconColor: backgroundIconColors[colorIndex], - //TODO Elham* match the of the icon - cardIcon: DoctorApp.arrival_patients, - textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, - onTap: () { - Navigator.push( - context, - FadePage( - page: RegisterPatientPage(), - ), - ); - }, - )); - changeColorIndex(); + //TODO Keep commented + // patientCards.add(HomePatientCard( + // gradient: backgroundColors[colorIndex], + // backgroundIconColor: backgroundIconColors[colorIndex], + // //TODO Elham* match the of the icon + // cardIcon: DoctorApp.arrival_patients, + // textColor: textColors[colorIndex], + // text: TranslationBase.of(context).registerNewPatient, + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: RegisterPatientPage(), + // ), + // ); + // }, + // )); + // changeColorIndex(); patientCards.add(HomePatientCard( gradient: backgroundColors[colorIndex], diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 87e36943..a68eff56 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -3,17 +3,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/live-care_transfer_to_admin.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index b4f6cc88..4cd9a3a0 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -32,7 +32,7 @@ class LivaCareTransferToAdmin extends StatefulWidget { class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -168,7 +168,7 @@ class _LivaCareTransferToAdminState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -178,14 +178,14 @@ class _LivaCareTransferToAdminState extends State { } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - noteController.text += reconizedWord + '\n'; + noteController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 8943b68d..ff14cab2 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index fed2cad1..bfb55579 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; +import 'package:doctor_app_flutter/core/model/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 1c149f07..93acd87a 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -4,9 +4,9 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; -import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index 9155ffc1..2424b09b 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index eb76ead9..ee6df167 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index b0421609..3656c585 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,12 +1,11 @@ import 'dart:math'; - import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -18,7 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:flutter/material.dart'; -import 'package:permission_handler/permission_handler.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; @@ -42,44 +41,29 @@ class _MedicineSearchState extends State { Helpers helpers = new Helpers(); bool _hasSpeech = false; String _currentLocaleId = ""; - bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); - // String lastWords; - List _localeNames = []; String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + String recognizedWord; @override void didChangeDependencies() { super.didChangeDependencies(); } - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } Future initSpeechState() async { bool hasSpeech = await speech.initialize( onError: errorListener, onStatus: statusListener); - // if (hasSpeech) { - // _localeNames = await speech.locales(); - - // var systemLocale = await speech.systemLocale(); _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; - // } - if (!mounted) return; setState(() { @@ -87,152 +71,136 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - @override Widget build(BuildContext context) { return BaseView(onModelReady: (model) async { - // if (model.allMedicationList.length == 0) - // await model.getMedicationList(); }, builder: (_, model, w) { myController.text = model.searchText; return AppScaffold( // baseViewModel: model, isShowAppBar: true, - appBar: PatientSearchHeader( + appBar: BottomSheetTitle( title: TranslationBase.of(context).searchMedicine, ), - //appBarTitle: TranslationBase.of(context).searchMedicine + "6", body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Container( - // height: SizeConfig.screenHeight, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 20, - ), - FractionallySizedBox( - widthFactor: 0.9, - child: AppTextFieldCustomSearch( - hintText: - TranslationBase.of(context).searchMedicineNameHere, - searchController: myController, - onFieldSubmitted: (value) { - searchMedicine(context, model); - }, - marginTop: 5, - ), - ), - SizedBox( - height: 20, - ), - FractionallySizedBox( - widthFactor: 0.9, - child: Container( - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, - ), - ], - ), - ), - ), - Container( - margin: - EdgeInsets.only(left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + AppTextFieldCustomSearch( + hintText: + TranslationBase.of(context).searchMedicineNameHere, + searchController: myController, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + marginTop: 5, + ), + Container( + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), + + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( TranslationBase.of(context).youCanFind + (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + " " + - TranslationBase.of(context).itemsInSearch, - fontWeight: FontWeight.bold, + TranslationBase.of(context).medicineSearchResult +" '${myController.text}'", + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.9, ), - ], - ), - ), - SizedBox( - height: 10, + ), + ], ), - if (myController.text != '') - Container( - height: MediaQuery.of(context).size.height * 0.6, - child: ListView.builder( - padding: const EdgeInsets.only(top: 20), + ), + SizedBox( + height: 5, + ), + if (myController.text != '') + Container( + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), - scrollDirection: Axis.vertical, - // shrinkWrap: true, - itemCount: model.pharmacyItemsList == null - ? 0 - : model.pharmacyItemsList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - child: MedicineItemWidget( - label: model.pharmacyItemsList[index] - ["ItemDescription"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PharmaciesListScreen( - itemID: model.pharmacyItemsList[index] - ["ItemID"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"]), - settings: RouteSettings( - name: 'PharmaciesListScreen'), - ), - ); - }, - ); - }, - ), + height: MediaQuery.of(context).size.height * 0.6, + child: ListView.builder( + padding: const EdgeInsets.only(top: 20), + scrollDirection: Axis.vertical, + itemCount: model.pharmacyItemsList == null + ? 0 + : model.pharmacyItemsList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: model.pharmacyItemsList[index] + ["ItemDescription"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"], + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PharmaciesListScreen( + itemID: model.pharmacyItemsList[index] + ["ItemID"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"]), + settings: RouteSettings( + name: 'PharmaciesListScreen'), + ), + ); + }, + ); + }, ), - ], - ), + ), + ], )), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine(context, model); + }, + color: AppGlobal.appRedColor, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], ), ), + ); }); } @@ -241,7 +209,6 @@ class _MedicineSearchState extends State { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); - //"Type Medicine Name") return; } if (myController.text.length < 3) { @@ -256,7 +223,6 @@ class _MedicineSearchState extends State { } startVoiceSearch() { - // lastWords = ""; lastError = ""; speech.listen( onResult: resultListener, @@ -272,18 +238,15 @@ class _MedicineSearchState extends State { void resultListener(SpeechRecognitionResult result) { setState(() { - // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - reconizedWord = result.recognizedWords; + recognizedWord = result.recognizedWords; lastStatus = ''; - myController.text = reconizedWord; + myController.text = recognizedWord; Future.delayed(const Duration(seconds: 2), () { - // searchMedicine(context); }); }); } void errorListener(SpeechRecognitionError error) { - // print("Received error status: $error, listening: ${speech.isListening}"); setState(() { lastError = "${error.errorMsg} - ${error.permanent}"; }); @@ -291,23 +254,15 @@ class _MedicineSearchState extends State { void statusListener(String status) { // print( - // "Received listener status: $status, listening: ${speech.isListening}"); setState(() { lastStatus = status; }); } - // _switchLang(selectedVal) { - // setState(() { - // _currentLocaleId = selectedVal; - // }); - // print(selectedVal); - // } void soundLevelListener(double level) { minSoundLevel = min(minSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level); - // print("sound level $level: $minSoundLevel - $maxSoundLevel "); setState(() { this.level = level; }); diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index a9e21274..4c0c27ea 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -1,21 +1,28 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../../locator.dart'; + DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class PharmaciesListScreen extends StatefulWidget { @@ -42,158 +49,98 @@ class _PharmaciesListState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).pharmaciesList, - body: Container( - height: SizeConfig.screenHeight, - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const AlwaysScrollableScrollPhysics(), - children: [ - model.pharmaciesList.length > 0 - ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: widget.url != null - ? Image.network( - widget.url, - height: - SizeConfig.imageSizeMultiplier * 21, - width: - SizeConfig.imageSizeMultiplier * 20, - fit: BoxFit.cover, - ) - : Container(), - ), - ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - AppText( - TranslationBase.of(context).description, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - TranslationBase.of(context).price, - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - model.pharmaciesList[0]["SellingPrice"] - .toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - ], - ), + body: Center( + child: FractionallySizedBox( + widthFactor: 0.95, + child: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ + model.pharmaciesList.length > 0 + ? MedicineItemWidget( + label: model.pharmaciesList[0]["ItemDescription"], + url: widget.url, + showArrow: false, + showPrice: true, + price: model.pharmaciesList[0]["SellingPrice"] + .toString(), ) - ], - )) - : Container(), - Container( - margin: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 2, - bottom: SizeConfig.widthMultiplier * 2, - right: SizeConfig.widthMultiplier * 4, - left: SizeConfig.widthMultiplier * 4, - ), - child: Align( - alignment: Alignment.centerLeft, - child: AppText( - TranslationBase.of(context).youCanFindItIn, - fontWeight: FontWeight.bold, + : Container(), + Container( + margin: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 2, + bottom: SizeConfig.widthMultiplier * 2, + right: SizeConfig.widthMultiplier * 4, + left: SizeConfig.widthMultiplier * 4, + ), + child: Align( + alignment: Alignment.centerLeft, + child: AppText( + TranslationBase.of(context).youCanFindItIn, + fontWeight: FontWeight.bold, + ), + ), + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, ), - ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, - ), - Container( - width: SizeConfig.screenWidth * 0.99, - margin: EdgeInsets.only(left: 10, right: 10), - child: ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null - ? 0 - : model.pharmaciesList.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - margin: EdgeInsets.only(top: 5), - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.network( - model.pharmaciesList[index] - ["ProjectImageURL"], - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, - ), - ), - ), - Expanded( - flex: 4, - child: AppText( - model.pharmaciesList[index] - ["LocationDescription"], - margin: 10, - ), - ), - Expanded( - flex: 2, - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.end, - crossAxisAlignment: WrapCrossAlignment.end, - children: [ - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.call, - color: Colors.red, - ), - onTap: () => launch("tel://" + - model.pharmaciesList[index] - ["PhoneNumber"]), + Container( + width: SizeConfig.screenWidth * 0.99, + margin: EdgeInsets.only(left: 10, right: 10), + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: model.pharmaciesList == null + ? 0 + : model.pharmaciesList.length, + itemBuilder: (BuildContext context, int index) { + return CardWithBgWidget( + bgColor: Colors.transparent, + hasBorder: false, + widget: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.network( + model.pharmaciesList[index] + ["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), ), - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.pin_drop, - color: Colors.red, - ), - onTap: () { + ), + Expanded( + flex: 4, + child: AppText( + Helpers.convertToTitleCase( + model.pharmaciesList[index] + ["LocationDescription"] ?? + ''), + margin: 10, + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + ), + + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { MapsLauncher.launchCoordinates( double.parse( model.pharmaciesList[index] @@ -204,17 +151,123 @@ class _PharmaciesListState extends State { model.pharmaciesList[index] ["LocationDescription"]); }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + Icons.pin_drop, + size: 15, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "location", + fontSize: 8, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), ), - ), - ], - ), + SizedBox( + height: 10, + ), + InkWell( + onTap: () { + launch("tel://" + + model.pharmaciesList[index] + ["PhoneNumber"]); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.call, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "Call Now", + fontSize: 8, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + ], + ), + // Expanded( + // flex: 2, + // child: Wrap( + // direction: Axis.horizontal, + // alignment: WrapAlignment.end, + // crossAxisAlignment: WrapCrossAlignment.end, + // children: [ + // Padding( + // padding: EdgeInsets.all(5), + // child: InkWell( + // child: Icon( + // Icons.call, + // color: Colors.red, + // ), + // onTap: () => launch("tel://" + + // model.pharmaciesList[index] + // ["PhoneNumber"]), + // ), + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: InkWell( + // child: Icon( + // Icons.pin_drop, + // color: Colors.red, + // ), + // onTap: () { + // MapsLauncher.launchCoordinates( + // double.parse( + // model.pharmaciesList[index] + // ["Latitude"]), + // double.parse( + // model.pharmaciesList[index] + // ["Longitude"]), + // model.pharmaciesList[index] + // ["LocationDescription"]); + // }, + // ), + // ), + // ], + // ), + // ), + ], ), - ], - ), - ); - }), - ) - ]), + ); + }), + ) + ]), + ), + ), ), ), ); diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 9f3c7810..5958c5fe 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -200,7 +200,7 @@ class _AddPatientSickLeaveScreenState extends State { Icon( DoctorApp.warning, size: 20, - color: IN_PROGRESS_COLOR, + color: AppGlobal.inProgressColor, ), SizedBox( width: 10, @@ -211,7 +211,7 @@ class _AddPatientSickLeaveScreenState extends State { .recommendedSickLeaveDays, textAlign: TextAlign.start, fontSize: 12, - color: IN_PROGRESS_COLOR, + color: AppGlobal.inProgressColor, ), ), ], diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index a2bc5a23..9fd5c7af 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -5,14 +5,14 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index d477f0cb..53c145c9 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index b621b643..06041e00 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index a2ef497a..b743b8f7 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../util/tab_helper.dart'; import '../DischargedPatientPage.dart'; import 'in_patient_list_page.dart'; @@ -123,7 +124,7 @@ class _InPatientScreenState extends State color: Colors.white), child: Container( margin: EdgeInsets.only(top: 9), - color: Helpers.getBgTabColor(), + color: TabHelper.getBgTabColor(), child: TabBar( isScrollable: false, controller: _tabController, @@ -214,8 +215,8 @@ class _InPatientScreenState extends State return Center( child: Container( - height: Helpers.getTabHeight(context), - decoration: Helpers.getBoxTabsBoxDecoration( + height: TabHelper.getTabHeight(context), + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: isActive, isFirst: isFirst, isMiddle: isMiddle, @@ -224,9 +225,9 @@ class _InPatientScreenState extends State child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText(title: title, isActive: isActive), + TabHelper.getTabText(title: title, isActive: isActive), if (counter != -1) - Helpers.getTabCounter(isActive: isActive, counter: counter) + TabHelper.getTabCounter(isActive: isActive, counter: counter) ], ), ), diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 58f9db26..86b05a4e 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -121,7 +121,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor : Colors.red[700], diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 53932c99..7ee9a950 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card_insurance.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 4695b7d4..254efa22 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; @@ -14,6 +14,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/config.dart'; + class InsuranceApprovalsDetails extends StatefulWidget { PatiantInformtion patient; int indexInsurance; @@ -106,7 +108,7 @@ class _InsuranceApprovalsDetailsState extends State { "Approved" || "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == "تمت الموافقة" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127) : Color(0xffD02127), letterSpacing: -0.4, @@ -484,7 +486,7 @@ class _InsuranceApprovalsDetailsState extends State { null ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == "Approved" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127) : Color(0xffD02127), ), diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart index 14ae707b..d03f19ee 100644 --- a/lib/screens/patients/out_patient/filter_date_page.dart +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -12,6 +12,8 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../config/config.dart'; + class FilterDatePage extends StatefulWidget { final OutPatientFilterType outPatientFilterType; final PatientSearchViewModel patientSearchViewModel; @@ -144,7 +146,7 @@ class _FilterDatePageState extends State { child: AppButton( title: TranslationBase.of(context).search, padding: 10, - color: Color(0xFF359846), + color: AppGlobal.appGreenColor, onPressed: () async { if (widget.patientSearchViewModel.selectedFromDate == null || diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index d6db782d..04131ae2 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; @@ -21,6 +21,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import '../../../util/tab_helper.dart'; import 'filter_date_page.dart'; // ignore: must_be_immutable @@ -102,8 +103,8 @@ class _OutPatientsScreenState extends State { children: [ Container( // color: Colors.red, - height: Helpers.getTabHeight(context), - color: Helpers.getBgTabColor(), + height: TabHelper.getTabHeight(context), + color: TabHelper.getBgTabColor(), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -138,7 +139,7 @@ class _OutPatientsScreenState extends State { child: Center( child: Container( height: screenSize.height * 0.070, - decoration: Helpers.getBoxTabsBoxDecoration( + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: _isActive, isFirst: _times.indexOf(item) == 0, isLast: @@ -150,12 +151,12 @@ class _OutPatientsScreenState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Helpers.getTabText( + TabHelper.getTabText( title: item, isActive: _isActive), _isActive && _activeLocation != 0 && model.state == ViewState.Idle - ? Helpers.getTabCounter( + ? TabHelper.getTabCounter( isActive: _isActive, counter: model.filterData.length) : Container(), diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index 0bad2313..fe40408e 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/request_prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/request_prescription_report.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 3676fedf..6f2f3e73 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index e1fdd033..94f18d81 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -117,7 +117,7 @@ class _PatientSearchScreenState extends State { onPressed: () { onSubmitSearch(); }, - color: Colors.red[800], + color: AppGlobal.appRedColor, ), ), ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 995df353..c7b51da3 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -2,12 +2,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/order-procedure.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -339,7 +340,7 @@ class DiagnosisWidget extends StatelessWidget { class MedicationWidget extends StatelessWidget { final UcafViewModel model; - final EntityList prescription; + final PrescriptionEntityModel prescription; MedicationWidget(this.model, this.prescription); diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index ddad858f..ca907068 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -38,6 +38,8 @@ class _UCAFInputScreenState extends State { final _whereController = TextEditingController(); final _managementsLineController = TextEditingController(); final _signsController = TextEditingController(); + + ///TODO Elham* fix this List conditionsData = [ {"name": "CHRONIC", "isChecked": false}, {"name": "RTA", "isChecked": false}, @@ -383,7 +385,7 @@ class _UCAFInputScreenState extends State { error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context))) + : TranslationBase.of(context).chiefComplaintEmptyMsg)) : Container(), ), ); diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index 628f6663..4ab7f0f6 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -3,14 +3,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -/// * -/// By Mousa Zaid Mousa Abuzaid -/// At 13/4/2021 +import '../../../../config/config.dart'; -/* - All hex value from 100% to 0% alpha: used in line 122 - https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 - */ class PageStepperWidget extends StatelessWidget { final int stepsCount; @@ -102,14 +96,14 @@ class StepWidget extends StatelessWidget { ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) - : Color(0xFF359846), + : AppGlobal.appGreenColor, shape: BoxShape.circle, border: Border.all( color: status == StepStatus.InProgress ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFFE3E3E3) - : Color(0xFF359846), + : AppGlobal.appGreenColor, width: 1), ), child: Center( @@ -127,7 +121,7 @@ class StepWidget extends StatelessWidget { width: dividerWidth, height: 2, color: status == StepStatus.Completed - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), ], @@ -178,7 +172,7 @@ class StepWidget extends StatelessWidget { ? Color(0xFFCC9B14) : status == StepStatus.Locked ? Color(0xFF969696) - : Color(0xFF359846), + : AppGlobal.appGreenColor, ), ) ], diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index b2a28f9a..b370adfa 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 9719b525..be98605e 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index b74c2ef3..ef7cb9f5 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -5,11 +5,11 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index fb805129..3f1bf4ec 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -6,11 +6,11 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 394112fa..c5fbe2df 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -7,12 +7,12 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index de9f6476..fe769397 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -3,14 +3,14 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/diabetic_chart/DiabeticType.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index 5a84f94f..3eea87f9 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 5a04c60a..e646252a 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -3,12 +3,12 @@ import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatient import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 56742976..48fa30b8 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index cf32675b..979fd207 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; +import 'package:doctor_app_flutter/core/model/discharge_summary/GetDischargeSummaryResModel.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 0878994a..41961cd9 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 4ee06e59..44b8aa93 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 0f0c22c6..7eb53d0a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 3fff6106..2cb2b7b9 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -16,7 +16,7 @@ class LabResultHistoryPage extends StatelessWidget { LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); -// TODO mosa UI changes +// TODO Elham* UI changes and add translation @override Widget build(BuildContext context) { return BaseView( diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index b212c067..166510d8 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/FlowChartPage.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart index 940003e8..d60d1d73 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -24,12 +24,6 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(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(0), child: Container( color: Colors.transparent, diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 24cf352a..25b02767 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index 0a6af767..399a99ff 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.dart'; @@ -75,7 +75,8 @@ class _LabResultState extends State { CardWithBgWidgetNew( widget: LabResultWidget( labResult: model.labResultList, - )) + ), + ) ], ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 0ead8fea..c377d04e 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 529c7716..a90c72e1 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResultWidget.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 22453c13..07e57a33 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; @@ -196,7 +196,7 @@ class _LabsHomePageState extends State { clinic: Helpers.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription), appointmentDate: - model.patientLabOrdersList[index].orderDate, + model.patientLabOrdersList[index].createdOn, orderNo: model.patientLabOrdersList[index].orderNo, isShowTime: false, ), diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index 1883a8f2..871a0da3 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 9bd1da29..54a7c75d 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -13,6 +13,8 @@ import 'package:flutter/material.dart'; import 'package:html_editor_enhanced/html_editor.dart'; import 'package:permission_handler/permission_handler.dart'; +import '../../../../config/config.dart'; + class AddVerifyMedicalReport extends StatefulWidget { final PatiantInformtion patient; final String patientType; @@ -157,7 +159,7 @@ class _AddVerifyMedicalReportState extends State { title: widget.status == MedicalReportStatus.ADD ? TranslationBase.of(context).add : TranslationBase.of(context).verify, - color: Color(0xff359846), + color: AppGlobal.appGreenColor, fontWeight: FontWeight.w700, onPressed: () async { txtOfMedicalReport = diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index eb28c528..227d5346 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index b124f2cc..249d5d0a 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel. import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index b8220939..657e5ed6 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -8,15 +8,15 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/notes/note/update_note.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; @@ -456,7 +456,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase.of( context) - .createdBy, + .createdBy + ' ', fontSize: 10, ), Expanded( @@ -474,6 +474,26 @@ class _ProgressNoteState extends State { ), ], ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of(context).conditionDescription + ' : ', + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].conditionDescription ?? '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), ], ), ), diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 85b33f5e..9df70b35 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -2,16 +2,16 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -26,6 +26,8 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; +import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; +import '../../../../base/base_view.dart'; class UpdateNoteOrder extends StatefulWidget { final NoteModel note; @@ -33,6 +35,8 @@ class UpdateNoteOrder extends StatefulWidget { final PatiantInformtion patient; final int visitType; final bool isUpdate; + final List elementList; + final Function(dynamic) okFunction; const UpdateNoteOrder( {Key key, @@ -40,7 +44,9 @@ class UpdateNoteOrder extends StatefulWidget { this.patientModel, this.patient, this.visitType, - this.isUpdate}) + this.isUpdate, + this.elementList, + this.okFunction}) : super(key: key); @override @@ -48,10 +54,11 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { + dynamic selectValue; int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -78,120 +85,35 @@ class _UpdateNoteOrderState extends State { @override Widget build(BuildContext context) { + String keyId = 'ParameterCode'; + projectViewModel = Provider.of(context); if (widget.note != null) { progressNoteController.text = widget.note.notes; - } + if(selectValue==null) + selectValue={}; + selectValue['ParameterCode'] = widget.note.condition; + selectValue['Description'] = widget.note.conditionDescription; - return AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Padding( - padding: EdgeInsets.all(0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - ), - SizedBox( - height: 10.0, - ), - Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Stack( - children: [ - AppTextFieldCustom( - hintText: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, - //TranslationBase.of(context).addProgressNote, - controller: progressNoteController, - maxLines: 35, - minLines: 25, - hasBorder: true, + } - // isTextFieldHasSuffix: true, - validationError: - progressNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, - child: Column( - children: [ - IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ], - )) - ], - ), - ], - ), - ), - ), - ], - ), - ), - ), - ), - bottomSheet: Container( - height: progressNoteController.text.isNotEmpty ? 130 : 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - if (progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), - Container( - margin: EdgeInsets.all(5), - child: AppButton( + return BaseView( + onModelReady: (model) { + model.getStpMasterList(isLocalBusy: false); + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate @@ -201,73 +123,220 @@ class _UpdateNoteOrderState extends State { ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, - color: Color(0xff359846), - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { + ), + SizedBox( + height: 10.0, + ), + Container( + padding: EdgeInsets.only(right: 20, left: 20), + child: InkWell( + onTap: model.stpMasterList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.stpMasterList, + attributeName: 'Description', + attributeValueId: + model.stpMasterList.length == 1 + ? model.stpMasterList[0]['${keyId}'] + .toString() + : '${keyId}', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) => { + setState(() { + selectValue = selectedValue; + selectValue['isDefault'] = true; + }) + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).selectCondition,//'Select Condition', + dropDownText: model.stpMasterList.length == 1 + ? model.stpMasterList[0]['Description'] + : selectValue == null + ? null + : selectValue['Description'], + enabled: false, + isTextFieldHasSuffix: true, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context) + .progressNote, + //TranslationBase.of(context).addProgressNote, + controller: progressNoteController, + maxLines: 35, + minLines: 25, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: progressNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + Positioned( + top: -2, + //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: progressNoteController.text.isNotEmpty ? 130 : 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + if (progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { setState(() { - isSubmitted = true; + progressNoteController.text = ''; }); - if (progressNoteController.text.trim().isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + }, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + color: AppGlobal.appGreenColor, + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); - if (widget.isUpdate) { - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - verifiedNote: false, - patientTypeID: widget.patient.patientType, - patientOutSA: false, - ); - await widget.patientModel - .updatePatientProgressNote(reqModel); - } else { - CreateNoteModel reqModel = CreateNoteModel( - admissionNo: - int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, - visitType: widget.visitType, - patientID: widget.patient.patientId, - nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, - patientOutSA: false, - notes: progressNoteController.text); + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: + int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + conditionId: selectValue['ParameterCode']); + await widget.patientModel + .updatePatientProgressNote(reqModel); + } else { + CreateNoteModel reqModel = CreateNoteModel( + admissionNo: + int.parse(widget.patient.admissionNo), + createdBy: doctorProfile.doctorID, + visitType: widget.visitType, + patientID: widget.patient.patientId, + nursingRemarks: ' ', + patientTypeID: widget.patient.patientType, + patientOutSA: false, + notes: progressNoteController.text, + conditionId: selectValue['ParameterCode']); - await widget.patientModel - .createPatientProgressNote(reqModel); - } + await widget.patientModel + .createPatientProgressNote(reqModel); + } - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); + if (widget.patientModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel.error); + } else { + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); + } + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).yourOrderAddedSuccessfully); + Navigator.of(context).pop(); } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: - int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, - patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel.getPatientProgressNote( - progressNoteRequest.toJson()); + Helpers.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); } - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } - })), - ], + })), + ], + ), ), ), ); @@ -296,7 +365,7 @@ class _UpdateNoteOrderState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -306,14 +375,14 @@ class _UpdateNoteOrderState extends State { } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text += reconizedWord + '\n'; + progressNoteController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 06dc687a..b0cf2a2d 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -4,12 +4,12 @@ import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 409e118d..0592b4d0 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; @@ -10,13 +11,12 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/update_operation_report.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../../../models/patient/patiant_info_model.dart'; import '../../../../util/dr_app_shared_pref.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 12f6739c..882bacc8 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -3,10 +3,10 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart'; -import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; +import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -20,6 +20,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; +import '../../../../config/config.dart'; + class UpdateOperationReport extends StatefulWidget { final GetReservationsResponseModel reservation; @@ -45,7 +47,7 @@ class _UpdateOperationReportState extends State { int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -532,7 +534,7 @@ class _UpdateOperationReportState extends State { : TranslationBase.of(context).noteAdd) + " " + TranslationBase.of(context).operationReports, - color: Color(0xff359846), + color: AppGlobal.appGreenColor, // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index 589c4680..ce6389b9 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart new file mode 100644 index 00000000..d7904596 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart @@ -0,0 +1,206 @@ +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../widgets/transitions/fade_page.dart'; +import 'intervention_medication_history_screen.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class InterventionMedicationScreen extends StatefulWidget { + final PatiantInformtion patient; + final InterventionMedicationViewModel previousModel; + const InterventionMedicationScreen(this.patient, {Key key, this.previousModel}) : super(key: key); + + @override + _InterventionMedicationScreenState createState() => + _InterventionMedicationScreenState(); +} + +class _InterventionMedicationScreenState + extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) => model.getInterventionMedication( + patientId: widget.patient.patientId, + //admissionNo: int.parse(widget.patient.admissionNo), + fromDate: widget.previousModel.selectedFromDate, + toDate: widget.previousModel.selectedToDate, + ), + + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient: true, + ), + body: model.allInterventionList == null || + model.allInterventionList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allInterventionList.length, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + CustomRow( + valueSize: 14, + label: '', + value: model.allInterventionList[index].cS, + ) + ], + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(model + .allInterventionList[ + index] + .startDatetime), + isArabic: + projectViewModel + .isArabic, + isMonthShort: + true), + fontWeight: + FontWeight.w600, + fontSize: 14, + color: Color(0xFF2B353E), + ), + ], + ), + ], + ) + ], + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).description, + value: model.allInterventionList[index].description, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).medication, + value: model.allInterventionList[index].medication, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).doctorComments, + value: model.allInterventionList[index].doctorComments, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).statusDescription, + value: model.allInterventionList[index].statusDescription, + ), + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ), + onTap: () { + Navigator.push( + context, + FadePage( + page: InterventionMedicationHistoryScreen(widget.patient, model.allInterventionList[index]), + ), + ); + }, + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart new file mode 100644 index 00000000..10239f50 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart @@ -0,0 +1,299 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/new_medication_res_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import '../../../../config/config.dart'; +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../widgets/shared/user-guid/CusomRow.dart'; + + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class InterventionMedicationHistoryScreen extends StatefulWidget { + final PatiantInformtion patient; + final InterventionMedicationResModel interventionMedication; + const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key key}) : super(key: key); + + @override + _InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState(); +} + +class _InterventionMedicationHistoryScreenState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) => model.getInterventionMedicationHistory( + patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo, + ), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient: true, + ), + body: model.allInterventionHistoryList == null || + model.allInterventionHistoryList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allInterventionHistoryList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).createdByName, + value: model.allInterventionHistoryList[index].createdByName, + ), + ], + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + model + .allInterventionHistoryList[ + index].createdOn) + ,isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontWeight: FontWeight.w600, + fontSize: 14, + color: Color(0xFF2B353E), + ), + ], + ), + ], + ) + ], + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).remarks, + value: model.allInterventionHistoryList[index].remark, + ), + SizedBox( + height: 8, + ), + SizedBox( + height: 8, + ), + SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { + + GifLoaderDialogUtils.showMyDialog(context); + await model.setAcceptedOrRejected( + remarks: "", + memberId: model.allInterventionHistoryList[index].commentedBy, + prescriptionNo: model.allInterventionHistoryList[index].prescriptionId, + patientID: model.allInterventionHistoryList[index].patientId, + orderNo: model.allInterventionHistoryList[index].orderNo, + admissionNo: model.allInterventionHistoryList[index].admissionNo, + interventionStatus: 1, + status: 61 + ); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + } else { + await model.getInterventionMedicationHistory(patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo,); + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Has been Successfully accepted"); + } + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appGreenColor, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .accept, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + + GifLoaderDialogUtils.showMyDialog(context); + await model.setAcceptedOrRejected( + remarks: "", + memberId: model.allInterventionHistoryList[index].commentedBy, + prescriptionNo: model.allInterventionHistoryList[index].prescriptionId, + patientID: model.allInterventionHistoryList[index].patientId, + orderNo: model.allInterventionHistoryList[index].orderNo, + admissionNo: model.allInterventionHistoryList[index].admissionNo, + interventionStatus: 2, + status: 61 + ); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + } else { + await model.getInterventionMedicationHistory(patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo,); + GifLoaderDialogUtils.hideDialog(context); + + DrAppToastMsg.showSuccesToast( + "Has been Successfully Rejected"); + } + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appRedColor, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .reject, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart new file mode 100644 index 00000000..191ac79e --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart @@ -0,0 +1,262 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../../config/config.dart'; +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../base/base_view.dart'; +import 'intervention_medication.dart'; + +class PharmacyInterventionScreen extends StatefulWidget { + final OutPatientFilterType outPatientFilterType; + + const PharmacyInterventionScreen({ + Key key, + this.outPatientFilterType, + }) : super(key: key); + + @override + _PharmacyInterventionScreenState createState() => + _PharmacyInterventionScreenState(); +} + +class _PharmacyInterventionScreenState + extends State { + @override + void initState() { + // TODO: implement initState + super.initState(); + } + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) + ? "" + : TranslationBase.of(context).pharmacyIntervention, + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, + model, + firstDate: DateTime( + DateTime.now().year - 20, + DateTime.now().month, + DateTime.now().day), + lastDate: DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day + 100), + selectedDate: model.selectedFromDate != null + ? model.selectedFromDate + : DateTime.now(), + ), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).fromDate, + "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}" + , + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, + model, + isFromDate: false, + firstDate: DateTime( + DateTime.now().year - 20, + DateTime.now().month, + DateTime.now().day), + lastDate: DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day + 100), + selectedDate: model.selectedToDate != null + ? model.selectedToDate + : DateTime.now().add(Duration(days: 1)), + ), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).toDate, + "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}" + , + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).search, + padding: 5, + color: AppGlobal.appGreenColor, + onPressed: () async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InterventionMedicationScreen( + patient, + previousModel: model, + )), + ); + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ))); + } + + selectDate(BuildContext context, InterventionMedicationViewModel model, + {bool isFromDate = true, + DateTime firstDate, + lastDate, + selectedDate}) async { + Helpers.hideKeyboard(context); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: firstDate, + lastDate: lastDate, + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null) { + if (isFromDate) { + setState(() { + model.selectedFromDate = picked; + var date = picked.add(Duration(days: 1)); + if (date.isBefore(lastDate)) { + model.selectedToDate = date; + } else + model.selectedToDate = lastDate; + }); + } else { + setState(() { + model.selectedToDate = picked; + }); + } + } + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } +} diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index ca8be2c0..c3aab3f4 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart index a7e0f7e2..c6f96dde 100644 --- a/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart +++ b/lib/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/patient_profile_card_model.dart similarity index 100% rename from lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart rename to lib/screens/patients/profile/profile_screen/patient_profile_card_model.dart diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 0c12b913..a80c975b 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -7,9 +7,9 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/PostEpisodeForInpatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; @@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 22d784e7..d4c20025 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; @@ -58,12 +58,19 @@ class ProfileGridForInPatient extends StatelessWidget { RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg', isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', + ORDER_PRESCRIPTION_OLD, + 'assets/images/svgs/profile_screen/order prescription.svg', + isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), + PatientProfileCardModel( TranslationBase.of(context).progress, TranslationBase.of(context).note, @@ -167,6 +174,20 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, ), + PatientProfileCardModel( + "VTE", + "Assessment", + VTE_ASSESSMENT, + 'assets/images/svgs/profile_screen/diabetic chart.svg', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + TranslationBase.of(context).pharmacy, + TranslationBase.of(context).intervention, + PHARMACY_INTERVENTION, + 'assets/images/svgs/profile_screen/medical report.svg', + isInPatient: isInpatient, + ), ]; return Padding( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 797fc6a3..b2f844dd 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; @@ -58,6 +58,12 @@ class ProfileGridForOther extends StatelessWidget { isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).orders, + TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', + ORDER_PRESCRIPTION_OLD, + 'assets/images/svgs/profile_screen/order prescription.svg', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index ef195a9c..8e54c8ca 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; @@ -55,6 +55,12 @@ class ProfileGridForSearch extends StatelessWidget { isInPatient: isInpatient), PatientProfileCardModel( TranslationBase.of(context).orders, + TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', + ORDER_PRESCRIPTION_OLD, + 'assets/images/svgs/profile_screen/order prescription.svg', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index df3bbb06..bc9ec56a 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -50,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget { ), isShowAppBar: true, baseViewModel: model, - body: SingleChildScrollView( + body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 6c3d93f7..99a300d4 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 0c2c4d8d..835339ea 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -46,7 +46,7 @@ class _AddReplayOnReferralPatientState int replay = 1; int reject = 2; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); TextEditingController replayOnReferralController = TextEditingController(); @@ -248,7 +248,7 @@ class _AddReplayOnReferralPatientState void errorListener(SpeechRecognitionError error) {} void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -258,13 +258,13 @@ class _AddReplayOnReferralPatientState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - replayOnReferralController.text += reconizedWord + '\n'; + replayOnReferralController.text += recognizedWord + '\n'; }); } } diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 8d9293fe..87fe16ba 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -110,7 +110,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referralPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referralPatient.referralStatus == 46 || referralPatient diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 687f1463..c620de1c 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -10,6 +10,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../util/tab_helper.dart'; import '../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; @@ -60,8 +61,8 @@ class _PatientReferralScreen extends State Size.fromHeight(MediaQuery.of(context).size.height * 0.070), child: Center( child: Container( - height: Helpers.getTabHeight(context), - color: Helpers.getBgTabColor(), + height: TabHelper.getTabHeight(context), + color: TabHelper.getBgTabColor(), child: Center( child: TabBar( isScrollable: false, @@ -75,36 +76,36 @@ class _PatientReferralScreen extends State unselectedLabelColor: Colors.grey[800], tabs: [ Container( - decoration: Helpers.getBoxTabsBoxDecoration( + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: index == 0, isFirst: true, projectViewModel: projectsProvider), child: Center( - child: Helpers.getTabText( + child: TabHelper.getTabText( title: TranslationBase.of(context) .myReferredPatient, isActive: index == 0)), ), Center( child: Container( - decoration: Helpers.getBoxTabsBoxDecoration( + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: index == 1, isMiddle: true, projectViewModel: projectsProvider), child: Center( - child: Helpers.getTabText( + child: TabHelper.getTabText( title: TranslationBase.of(context).referral, isActive: index == 1)), ), ), Center( child: Container( - decoration: Helpers.getBoxTabsBoxDecoration( + decoration: TabHelper.getBoxTabsBoxDecoration( isActive: index == 2, isLast: true, projectViewModel: projectsProvider), child: Center( - child: Helpers.getTabText( + child: TabHelper.getTabText( title: TranslationBase.of(context).discharged, isActive: index == 2), ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 48b161b6..e7c8d2ad 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -4,13 +4,13 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -51,7 +51,7 @@ class _PatientMakeInPatientReferralScreenState String doctorError; String frequencyError; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); @override @@ -90,7 +90,7 @@ class _PatientMakeInPatientReferralScreenState } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -100,14 +100,14 @@ class _PatientMakeInPatientReferralScreenState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - _remarksController.text += reconizedWord + '\n'; + _remarksController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index d5098e8e..0dc92eb2 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -1,26 +1,22 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; class PatientMakeReferralScreen extends StatefulWidget { // previous design page is: ReferPatientScreen @@ -152,9 +148,6 @@ class _PatientMakeReferralScreenState extends State { .referredByDoctorInfo, clinicDescription: null, ), - SizedBox( - height: 10, - ), ], ), if (model.patientReferral.length == 0) @@ -208,7 +201,7 @@ class _PatientMakeReferralScreenState extends State { TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); }); - }), + }) ], ), ), diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 66c443c8..464d8e49 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -156,7 +156,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { fontSize: 1.7 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 || referredPatient diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index fe40a7e6..f1467f64 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart'; @@ -11,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - import '../../../../widgets/shared/errors/error_message.dart'; class ReferredPatientScreen extends StatefulWidget { @@ -49,16 +49,15 @@ class _ReferredPatientScreenState extends State { }, ), ), - model.listMyReferredPatientModel == null || - model.listMyReferredPatientModel.length == 0 - ? Center( + if (model.listMyReferredPatientModel == null || + model.listMyReferredPatientModel.length == 0) Center( child: ErrorMessage( error: TranslationBase.of(context).referralEmptyMsg, - )) - : Expanded( + )) else Expanded( child: SingleChildScrollView( // DoctorApplication.svc/REST/GtMyReferredPatient child: Container( + child: Column( children: [ ListView.builder( @@ -86,23 +85,30 @@ class _ReferredPatientScreenState extends State { referralStatusCode: model .getReferredPatientItem(index) .referralStatus, - patientName: - "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientGender: model .getReferredPatientItem(index) .gender, - referredDate: AppDateUtils - .convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "dd/MM/yyyy"), - referredTime: AppDateUtils - .convertDateFromServerFormat( - model - .getReferredPatientItem(index) - .referralDate, - "hh:mm a"), + referredDate: model.state == ViewState.BusyLocal ?"": + AppDateUtils.getDayMonthYearDateFormatted( + patientType == PatientType.IN_PATIENT? + AppDateUtils.getDateTimeFromServerFormat( + model.getReferredPatientItem(index).referralDate, + ):AppDateUtils.getDateTimeFromString( + model.getReferredPatientItem(index).referralDate, + ), + isMonthShort: true + ), + referredTime:model.state == ViewState.BusyLocal ?"":AppDateUtils.getHour( + patientType == PatientType.IN_PATIENT? + AppDateUtils.getDateTimeFromServerFormat( + model.getReferredPatientItem(index).referralDate, + ):AppDateUtils.getDateTimeFromString( + model.getReferredPatientItem(index).referralDate, + ), + // isMonthShort: true + ), patientID: "${model.getReferredPatientItem(index).patientID}", isSameBranch: model @@ -121,8 +127,8 @@ class _ReferredPatientScreenState extends State { doctorAvatar: model .getReferredPatientItem(index) .doctorImageURL, - referralDoctorName: - "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + referralDoctorName: "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 401da0aa..518c9f9c 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -15,7 +15,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; - import '../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { @@ -156,7 +155,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor : Colors.red[700], diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index bef369f8..dc18fe9c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -4,12 +4,12 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/PatchAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index c7e82b5f..22a32070 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; @@ -142,318 +142,327 @@ class _UpdateAssessmentPageState extends State return Container( margin: EdgeInsets.only( left: 5, right: 5, top: 15, bottom: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + child: Column( children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Row( + children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - ""), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 5, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - ), - children: [ - new TextSpan( - text: assessment - .selectedICD.description - .toString(), - ), - ], - ), - ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( + RichText( + text: new TextSpan( + style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + .getTextMultiplierBasedOnWidth() * + 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - letterSpacing: -0.4, - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment.appointmentId - .toString() ?? - "", - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), - ), - ], - ), + new TextSpan( + text: assessment + .selectedICD.code + .trim() + .toUpperCase() ?? + ""), + ], ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn), isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], + ), + ], + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + children: [ + new TextSpan( + text: assessment + .selectedICD.description + .toString(), + ), + ], ), ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, + ), + RichText( + text: new TextSpan( style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), + 3.5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, ), - ), - ], - ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( + children: [ + new TextSpan( + text: TranslationBase.of( context) - .dType + - ' : ', - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), - ), + .appointmentNo, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: assessment.appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, + ), + RichText( + text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), - ), - ], - ), - ), - if (assessment.doctorName != null) - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .doctor + - ' : ', - style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * 3, - letterSpacing: -0.4, - color: Color(0xFF575757), + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: - assessment.doctorName ?? - '', - style: new TextStyle( + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .dType + + ' : ', + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), ), - ), - ], + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), ), - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .doctor + + ' : ', + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: + assessment.doctorName ?? + '', + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), SizedBox( height: 6, ), - AppText( - (assessment.remark != null && - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - RemarkText( - remark: assessment.remark ?? "", - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( + Row( + mainAxisAlignment: + MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.end, + CrossAxisAlignment.start, children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + SizedBox( + height: 6, ), AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + (assessment.remark != null && + assessment.remark != + '') + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + RemarkText( + remark: assessment.remark ?? "", ), ], ), ], ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, + ), + ) + ], ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, - size: 18, - ), - ) ], ), ], diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 81b296d3..59bf42c7 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 18e5d154..fa174f42 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -1,8 +1,8 @@ // ignore: must_be_immutable import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 89691cf2..193aea9d 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index b7f7ef2a..edc3dcce 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index bb30eebc..0be5d2a6 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -4,11 +4,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 37a6096e..22f18b3e 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetGetProgressNoteResModel.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index da7453b2..7d9e3d82 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index 92275fb4..440e1e3e 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -3,6 +3,8 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../../config/config.dart'; + class BottomSheetDialogButton extends StatelessWidget { final Function onTap; final String label; @@ -33,7 +35,7 @@ class BottomSheetDialogButton extends StatelessWidget { child: Center( child: AppButton( title: label, - color: Color(0xFF359846), + color: AppGlobal.appGreenColor, onPressed: onTap, ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart index ea75d348..95b3d061 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../../../config/config.dart'; + class StatusLabel extends StatelessWidget { const StatusLabel({ Key key, @@ -39,11 +41,11 @@ class StatusLabel extends StatelessWidget { : TranslationBase.of(context).locked, fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFF969696), ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index bd31e4ce..cb1cb2f1 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -1,12 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import '../../../../../../config/config.dart'; import 'Step_details_widget.dart'; class StepsWidget extends StatelessWidget { @@ -85,7 +86,7 @@ class StepsWidget extends StatelessWidget { color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -137,7 +138,7 @@ class StepsWidget extends StatelessWidget { color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -192,7 +193,7 @@ class StepsWidget extends StatelessWidget { color: index == 2 ? Color(0xFFCC9B14) : index > 2 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -245,7 +246,7 @@ class StepsWidget extends StatelessWidget { color: index == 3 ? Color(0xFFCC9B14) : index > 3 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -323,7 +324,7 @@ class StepsWidget extends StatelessWidget { color: index == 0 ? Color(0xFFCC9B14) : index > 0 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( @@ -375,7 +376,7 @@ class StepsWidget extends StatelessWidget { color: index == 1 ? Color(0xFFCC9B14) : index > 1 - ? Color(0xFF359846) + ? AppGlobal.appGreenColor : Color(0xFFCCCCCC), ), child: Center( diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 77ba1028..29ed59d7 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -1,7 +1,7 @@ -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; class SoapUtils { static MySelectedHistory generateMySelectedHistory( diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 09495bb6..6d8ff628 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -2,8 +2,8 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 7d22fa26..72b198b6 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 44456897..3f00cbc8 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 283907bd..84bd1c9b 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index b10d831d..9d6c5ddc 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index 07b83abb..e7438c65 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 72330be3..f8c3527d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 9fe4cf64..a8889849 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index fd5e6b45..075126fb 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index fd6a62d8..acd1e827 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 8fa55b37..d1fcfef1 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -16,8 +16,8 @@ class LineChartCurved extends StatelessWidget { List yAxixs = List(); // DateFormat format = DateFormat("yyyy-MM-dd"); - DateFormat yearFormat = DateFormat("yyyy/MMM"); - DateFormat monthFormat = DateFormat("MMM"); + DateFormat yearFormat = DateFormat("yyyy/MMM/dd"); + DateFormat monthFormat = DateFormat("dd/MMM"); bool isDatesSameYear = true; @override @@ -96,6 +96,7 @@ class LineChartCurved extends StatelessWidget { } } + LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( @@ -162,31 +163,25 @@ class LineChartCurved extends StatelessWidget { return ''; }, ), - leftTitles: SideTitles( - showTitles: true, - getTextStyles: (context, value) { - return TextStyle( + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( color: Colors.black, + fontWeight: FontWeight.bold, fontSize: 10, - ); - }, - getTitles: (value) { - // if (timeSeries.length < 10) { - // return '${value.toInt()}'; - // } else { - // if (value == getMinY()) - // return '${value.toInt()}'; - // if (value == getMaxY()) + ), + interval:getInterval(), + + // getTitles: (value) { + // if (value.toInt() == 0) // return '${value.toInt()}'; - // if (yAxixs.contains(value)) { + // else if (value.toInt() % horizontalInterval == 0) // return '${value.toInt()}'; - // } - // return ''; - // } - return '${value.toInt()}'; - }, - margin: 12, - ), + // else + // return ''; + // }, + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -208,12 +203,44 @@ class LineChartCurved extends StatelessWidget { ), minX: 0, maxX: (timeSeries.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: getMinY(), + maxY: getMaxY() + getInterval(), + minY: 0, lineBarsData: getData(context), ); } + // double getMaxY() { + // double max = 0; + // timeSeries.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // + // return max.roundToDouble(); + // } + // + // double getMinY() { + // double min = timeSeries[0].sales; + // timeSeries.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // int value = min.toInt(); + // + // return value.toDouble(); + // } + + + double getInterval(){ + + return getMaxY() - getMinY() <= 100 + ? 20 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200; + + } + double getMaxY() { double max = 0; timeSeries.forEach((element) { diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 0af3c575..a84cd045 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -168,12 +168,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval:getInterval(), getTitles: (value) { return '${value.toInt()}'; }, @@ -199,23 +199,31 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: getMinY(), + maxX: 0, + maxY: getMaxY() + getInterval(), + minY: 0, lineBarsData: getData(context), ); } + double getInterval(){ + + return getMaxY() - getMinY() <= 100 + ? 20 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200; + + } + + + double getMaxY() { double max = 0; timeSeries1.forEach((element) { double resultValueDouble = element.sales; if (resultValueDouble > max) max = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble > max) max = resultValueDouble; - }); return max.roundToDouble(); } @@ -226,15 +234,39 @@ class LineChartCurvedBloodPressure extends StatelessWidget { double resultValueDouble = element.sales; if (resultValueDouble < min) min = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble < min) min = resultValueDouble; - }); - int value = min.toInt(); return value.toDouble(); } + // double getMaxY() { + // double max = 0; + // timeSeries1.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // + // return max.roundToDouble(); + // } + // + // double getMinY() { + // double min = timeSeries1[0].sales; + // timeSeries1.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // + // int value = min.toInt(); + // + // return value.toDouble(); + // } List getData(context) { List spots = List(); diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index af67f3e3..f4ea6d75 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -79,14 +79,18 @@ class VitalSignDetailPainScale extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.only(left: 8), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Expanded( flex: 2, child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Container( @@ -268,13 +272,24 @@ class VitalSignDetailPainScale extends StatelessWidget { ), Expanded( child: Container( - padding: EdgeInsets.all(8), + padding: EdgeInsets.symmetric(horizontal: 8), child: Center( - child: AppText( - "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", - fontWeight: FontWeight.w700, - color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.6, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + AppText( + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "hh:mm a")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index ab10a76e..5042f707 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 33c796b0..1bfe3643 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -3,12 +3,12 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index 085a11ba..37b1552b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 26f418e8..d0c13672 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index 4c0d07af..c0db764c 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 92483ff4..aac05ceb 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart b/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart new file mode 100644 index 00000000..e619185e --- /dev/null +++ b/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart @@ -0,0 +1,282 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/vte_assessment_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class VteAssessmentScreen extends StatefulWidget { + const VteAssessmentScreen({Key key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => model.getVteAssessment(patientId: patient.patientId, + // admissionNo: 2016023498 + + admissionNo:int.parse(patient.admissionNo) + ), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.allVteHistoryList == null || + model.allVteHistoryList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allVteHistoryList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + model + .allVteHistoryList[ + index].riskScore, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .allVteHistoryList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromString(model + .allVteHistoryList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .allVteHistoryList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromString(model + .allVteHistoryList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .VTE_Type + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .vTEType, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .pharmacology + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .pharmacology, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .reasonsThrombo + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .reasonsThrombo, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Ambulation Protocol : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .ambulationProtocol, + fontSize: 12, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart index f3d1ba6b..17bdac40 100644 --- a/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.d import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart index 59747e37..671511b9 100644 --- a/lib/screens/patients/register_patient/RegisterPatientPage.dart +++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart @@ -158,8 +158,8 @@ class _RegisterPatientPageState extends State hasBorder: true, vPadding: 12, hPadding: 8, - borderColor: Color(0xFF359846), - color: Color(0xFF359846), + borderColor: AppGlobal.appGreenColor, + color: AppGlobal.appGreenColor, fontColor: Colors.white, onPressed: () {}, ), diff --git a/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart new file mode 100644 index 00000000..854ec4ae --- /dev/null +++ b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart @@ -0,0 +1,146 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'drug_to_drug.dart'; + +class AddDrugWidget extends StatefulWidget { + final PatiantInformtion patient; + final List prescriptionList; + final MedicineViewModel medicineModel; + final PrescriptionViewModel modelPrescription; + final dynamic units; + final dynamic route; + final dynamic frequency; + final dynamic duration; + final dynamic doseTime; + final dynamic uom; + final dynamic x; + final GetMedicationResponseModel selectedMedication; + final String strength; + final String indication; + final String instruction; + final DateTime selectedDate; + + const AddDrugWidget( + {Key key, + this.patient, + this.prescriptionList, + this.medicineModel, + this.modelPrescription, + this.units, + this.route, + this.frequency, + this.duration, + this.doseTime, + this.uom, + this.x, + this.selectedMedication, + this.strength, + this.indication, + this.instruction, + this.selectedDate}) + : super(key: key); + + @override + _AddDrugWidgetState createState() => _AddDrugWidgetState(); +} + +class _AddDrugWidgetState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + baseViewModel: widget.medicineModel, + appBar: + BottomSheetTitle(title: TranslationBase.of(context).addMedication), + body: Container( + height: SizeConfig.realScreenHeight * .8, + width: SizeConfig.realScreenWidth, + child: SingleChildScrollView( + child: Column( + children: [ + DrugToDrug( + widget.patient, + widget.medicineModel.getPrescriptionForDrug( + widget.prescriptionList, widget.medicineModel), + widget.medicineModel.patientAssessmentList), + ], + )), + ), + bottomSheet: widget.medicineModel.state == ViewState.BusyLocal || + widget.medicineModel.state == ViewState.Busy + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: TranslationBase.of(context).addMedication, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await widget.medicineModel.postPrescription( + isLocalBusy: true, + icdCode: widget.medicineModel.patientAssessmentList.isNotEmpty + ? widget.medicineModel.patientAssessmentList[0] + .icdCode10ID.isEmpty + ? "test" + : widget.medicineModel.patientAssessmentList[0] + .icdCode10ID + .toString() + : "test", + dose: widget.strength, + doseUnit: + widget.medicineModel.itemMedicineListUnit.length == 1 + ? widget.medicineModel + .itemMedicineListUnit[0]['parameterCode'] + .toString() + : widget.units['parameterCode'].toString(), + patient: widget.patient, + doseTimeIn: widget.doseTime['id'].toString(), + model: widget.modelPrescription, + duration: widget.duration['id'].toString(), + frequency: widget.medicineModel.itemMedicineList.length == 1 + ? widget + .medicineModel.itemMedicineList[0]['parameterCode'] + .toString() + : widget.frequency['parameterCode'].toString(), + route: widget.medicineModel.itemMedicineListRoute.length == 1 + ? widget.medicineModel + .itemMedicineListRoute[0]['parameterCode'] + .toString() + : widget.route['parameterCode'].toString(), + drugId: widget.selectedMedication.itemId.toString(), + strength: widget.strength, + indication: widget.indication, + instruction: widget.instruction, + doseTime: widget.selectedDate, + ); + if (widget.medicineModel.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(widget.medicineModel.error); + } else if (widget.modelPrescription.state == ViewState.Idle) { + await widget.modelPrescription.getPrescriptionListNew( + appNo: widget.patient.appointmentNo, + mrn: widget.patient.patientMRN, + isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).medicationHasBeenAdded); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }, + ), + ); + } +} diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart similarity index 66% rename from lib/screens/prescription/drugtodrug.dart rename to lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart index 78f5afae..2ce61af0 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart @@ -4,13 +4,14 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; @@ -28,6 +29,7 @@ class DrugToDrug extends StatefulWidget { class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; + /// TODO Elham* fix this List> expandableList = [ {'name': 'CRITICAL', 'level': 'LEVEL_4'}, {'name': 'HIGH', 'level': 'LEVEL_3'}, @@ -35,18 +37,10 @@ class _DrugToDrug extends State { {'name': 'LOW', 'level': 'LEVEL_1'}, {'name': 'INFO', 'level': 'INFO'}, ]; - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: 2954208, - //widget.patient.patientMRN, - episodeId: 210011002, - //widget.patient.episodeNo, - appointmentNo: 2016055308, - //widget.patient.appointmentNo, - doctorID: '', - editedBy: ''); - VitalSignsViewModel model = new VitalSignsViewModel(); - SOAPViewModel model2 = new SOAPViewModel(); + + VitalSignsViewModel vitalSignsViewModel = new VitalSignsViewModel(); + SOAPViewModel soapViewModel = new SOAPViewModel(); @override void initState() { @@ -59,18 +53,18 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (model3) => model3.getDrugToDrug( - model.patientVitalSigns, + onModelReady: (prescriptionViewModel) => prescriptionViewModel.getDrugToDrug( + vitalSignsViewModel.patientVitalSigns, widget.listAssessment, - model2.patientAllergiesList, + soapViewModel.patientAllergiesList, widget.patient, widget.prescription), - builder: (BuildContext context, PrescriptionViewModel model3, + builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget child) => NetworkBaseView( - baseViewModel: model3, + baseViewModel: prescriptionViewModel, child: Container( - height: SizeConfig.realScreenHeight * .4, + height: SizeConfig.realScreenHeight * .9, child: new ListView.builder( itemCount: expandableList.length, itemBuilder: (context, i) { @@ -80,7 +74,7 @@ class _DrugToDrug extends State { ' ' + '(' + getDrugInfo(expandableList[i]['level'], - model3) + prescriptionViewModel) .length .toString() + ')', @@ -88,7 +82,7 @@ class _DrugToDrug extends State { fontWeight: FontWeight.bold, ), children: getDrugInfo( - expandableList[i]['level'], model3) + expandableList[i]['level'], prescriptionViewModel) .map((item) { return Container( padding: EdgeInsets.all(10), @@ -100,10 +94,8 @@ class _DrugToDrug extends State { })))) : Container( height: SizeConfig.realScreenHeight * .45, - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Colors.black), - ))); + child: GifLoaderContainer() + ); } getTypeID() async { @@ -114,17 +106,28 @@ class _DrugToDrug extends State { } getRequestedData() async { - await model.getPatientVitalSign(widget.patient); - await model2.getPatientAllergy(generalGetReqForSOAP); - await model2.getMasterLookup(MasterKeysService.DiagnosisType); - if (model.state == ViewState.Idle && model2.state == ViewState.Idle) { + + + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + /// TODO Elham* fix this today + patientMRN: widget.patient.patientMRN, + episodeId: widget.patient.episodeNo, + appointmentNo: + widget.patient.appointmentNo, + doctorID: '', + editedBy: ''); + + await vitalSignsViewModel.getPatientVitalSign(widget.patient); + await soapViewModel.getPatientAllergy(generalGetReqForSOAP); + await soapViewModel.getMasterLookup(MasterKeysService.DiagnosisType); + if (vitalSignsViewModel.state == ViewState.Idle && soapViewModel.state == ViewState.Idle) { setState(() { isLoaded = true; }); } } - List getDrugInfo(level, model3) { - return model3.drugToDrug.where((i) => i['Severity'] == level).toList(); + List getDrugInfo(level, prescriptionViewModel) { + return prescriptionViewModel.drugToDrug.where((i) => i['Severity'] == level).toList(); } } diff --git a/lib/screens/prescription/add_prescription/add_prescription.dart b/lib/screens/prescription/add_prescription/add_prescription.dart new file mode 100644 index 00000000..074a01fe --- /dev/null +++ b/lib/screens/prescription/add_prescription/add_prescription.dart @@ -0,0 +1,171 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/prescription_form_widget.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/search_preescription_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class AddPrescription extends StatefulWidget { + final PrescriptionViewModel prescriptionViewModel; + final PatiantInformtion patient; + final List prescriptionList; + + AddPrescription( + this.prescriptionViewModel, this.patient, this.prescriptionList); + + @override + _AddPrescriptionState createState() => _AddPrescriptionState(); +} + +class _AddPrescriptionState extends State { + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; + int selectedType; + + bool visibilitySearch = true; + + TextEditingController strengthController = TextEditingController(); + TextEditingController unitController = TextEditingController(); + TextEditingController indicationController = TextEditingController(); + TextEditingController instructionController = TextEditingController(); + + bool visibilityPrescriptionForm = false; + + final myController = TextEditingController(); + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; + MedicineViewModel medicineViewModel; + + GlobalKey key = + new GlobalKey>(); + + TextEditingController drugIdController = TextEditingController(); + TextEditingController doseController = TextEditingController(); + final searchController = TextEditingController(); + stt.SpeechToText speech = stt.SpeechToText(); + var event = RobotProvider(); + var recognizedWord; + + final GlobalKey formKey = GlobalKey(); + final double spaceBetweenTextFields = 12; + dynamic route; + dynamic frequency; + dynamic duration; + dynamic doseTime; + dynamic indication; + dynamic units; + dynamic uom; + dynamic box; + dynamic x; + + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: ( + BuildContext context, + MedicineViewModel model, + Widget child, + ) => + NetworkBaseView( + baseViewModel: model, + child: GestureDetector( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: DraggableScrollableSheet( + initialChildSize: 0.98, + maxChildSize: 0.98, + minChildSize: 0.9, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.65, + color: Color(0xffF8F8F8), + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), + child: Column( + children: [ + Column( + children: [ + SizedBox( + height: 60, + ), + ], + ), + SizedBox( + height: spaceBetweenTextFields, + ), + Container( + child: Column( + children: [ + Visibility( + visible: visibilitySearch, + child: SearchPrescriptionWidget( + spaceBetweenTextFields: + spaceBetweenTextFields, + medicineViewModel: model, + prescriptionViewModel: + widget.prescriptionViewModel, + onItemSelected: + (GetMedicationResponseModel + medication) async { + setState(() { + visibilitySearch = !visibilitySearch; + _selectedMedication = medication; + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getAssessmentList(patientInfo: widget.patient, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }, + + ), + ), + Visibility( + visible: !visibilitySearch, + child: Container( + child: Column( + children: [ + PrescriptionFormWidget( + patient: widget.patient, + prescriptionViewModel: + widget.prescriptionViewModel, + medicineViewModel: model, + prescriptionList: + widget.prescriptionList, + selectedMedication: _selectedMedication, + ), + ], + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart new file mode 100644 index 00000000..13ec5a15 --- /dev/null +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -0,0 +1,547 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; +import '../../../widgets/transitions/slide_up_page.dart'; +import 'add_drug/add_drug_widget.dart'; + +class PrescriptionFormWidget extends StatefulWidget { + final PatiantInformtion patient; + final List prescriptionList; + final PrescriptionViewModel prescriptionViewModel; + final MedicineViewModel medicineViewModel; + final GetMedicationResponseModel selectedMedication; + + const PrescriptionFormWidget( + {Key key, + this.patient, + this.prescriptionList, + this.prescriptionViewModel, + this.medicineViewModel, + this.selectedMedication}); + + @override + _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); +} + +class _PrescriptionFormWidgetState extends State { + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; + + int selectedType; + + TextEditingController strengthController = TextEditingController(); + TextEditingController unitController = TextEditingController(); + TextEditingController indicationController = TextEditingController(); + TextEditingController instructionController = TextEditingController(); + + bool visibilityPrescriptionForm = false; + bool visibilitySearch = true; + + final myController = TextEditingController(); + DateTime selectedDate; + int strengthChar; + GlobalKey key = + new GlobalKey>(); + + TextEditingController drugIdController = TextEditingController(); + TextEditingController doseController = TextEditingController(); + final searchController = TextEditingController(); + stt.SpeechToText speech = stt.SpeechToText(); + var event = RobotProvider(); + var recognizedWord; + + final GlobalKey formKey = GlobalKey(); + final double spaceBetweenTextFields = 12; + dynamic route; + dynamic frequency; + dynamic duration; + dynamic doseTime; + dynamic units; + dynamic uom; + dynamic box; + dynamic x; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + onVoiceText() async { + new SpeechToText(context: context).showAlertDialog(context); + var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + bool available = await speech.initialize( + onStatus: statusListener, onError: errorListener); + if (available) { + speech.listen( + onResult: resultListener, + listenMode: stt.ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + print(error); + } + + void statusListener(String status) { + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; + } + + void resultListener(result) { + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); + + if (result.finalResult == true) { + setState(() { + SpeechToText.closeAlertDialog(context); + speech.stop(); + instructionController.text += recognizedWord + '\n'; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return Form( + key: formKey, + child: Column( + children: [ + AppText( + widget.selectedMedication?.description ?? "", + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 15.0, + ), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + width: 6, + ), + AppText( + TranslationBase.of(context).orderType, + fontWeight: FontWeight.w500, + ), + SizedBox( + width: 18, + ), + Radio( + activeColor: AppGlobal.appRedColor, + value: 1, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + ], + ), + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: AppTextFieldCustom( + validationError: strengthError, + hintText: TranslationBase.of(context).strength, + isTextFieldHasSuffix: false, + enabled: true, + controller: strengthController, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 5) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .only5DigitsAllowedForStrength, + ); + } + }, + inputType: TextInputType.numberWithOptions( + decimal: true, + ), + ), + ), + SizedBox( + width: 5.0, + ), + PrescriptionTextFiled( + width: MediaQuery.of(context).size.width * 0.510, + element: + widget.medicineViewModel.itemMedicineListUnit.length == 1 + ? widget.medicineViewModel.itemMedicineListUnit[0] + : units, + elementError: unitError, + keyName: 'description', + keyId: 'parameterCode', + hintText: TranslationBase.of(context).unit, + elementList: widget.medicineViewModel.itemMedicineListUnit, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + units['isDefault'] = true; + }); + }, + ), + ], + ), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + elementList: widget.medicineViewModel.itemMedicineListRoute, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 + ? route = widget.medicineViewModel.itemMedicineListRoute[0] + : route, + elementError: routeError, + keyId: 'parameterCode', + keyName: 'description', + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + route['isDefault'] = true; + }); + }, + hintText: TranslationBase.of(context).route, + ), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + hintText: TranslationBase.of(context).frequency, + elementError: frequencyError, + // element: frequency, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 + ? frequency = widget.medicineViewModel.itemMedicineListRoute[0] + : frequency, + elementList: widget.medicineViewModel.itemMedicineList, + keyId: 'parameterCode', + keyName: 'description', + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + frequency['isDefault'] = true; + if (widget.selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + widget.medicineViewModel.getBoxQuantity( + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: widget.selectedMedication.itemId, + strength: double.parse(strengthController.text)); + + return; + } + }); + }), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + hintText: TranslationBase.of(context).doseTime, + elementError: doseTimeError, + element: doseTime, + elementList: widget.medicineViewModel.medicationDoseTimeList, + keyId: 'id', + keyName: 'nameEn', + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }), + SizedBox(height: spaceBetweenTextFields), + if (widget.medicineViewModel.patientAssessmentList.isNotEmpty) + Container( + height: screenSize.height * 0.070, + width: double.infinity, + color: Colors.white, + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: AppTextFieldCustom( + hintText: widget + .medicineViewModel.patientAssessmentList[0].icdCode10ID + .toString(), + enabled: true, + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.57, + color: Colors.white, + child: AppTextFieldCustom( + maxLines: 5, + hintText: widget + .medicineViewModel.patientAssessmentList[0].asciiDesc + .toString(), + enabled: true, + ), + ), + ], + ), + ), + SizedBox(height: spaceBetweenTextFields), Container( + color: Colors.transparent, + child: InkWell( + onTap: () => selectDate(context, widget.prescriptionViewModel), + child: AppTextFieldCustom( + validationError: strengthError, + hintText: TranslationBase.of(context).date, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.calendar_today, + color: Colors.black, + ), + ), + dropDownText: selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + enabled: false, + ), + ), + ), + SizedBox(height: spaceBetweenTextFields), + PrescriptionTextFiled( + element: duration, + elementError: durationError, + hintText: TranslationBase.of(context).duration, + elementList: widget.medicineViewModel.medicationDurationList, + keyName: 'nameEn', + keyId: 'id', + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + if (widget.selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + box = widget.medicineViewModel.boxQuintity; + return; + } + }); + }, + ), + SizedBox(height: spaceBetweenTextFields), + Container( + color: Colors.white, + child: AppTextFieldCustom( + hintText: "UOM", + isTextFieldHasSuffix: false, + dropDownText: uom != null ? uom : null, + enabled: false, + ), + ), + SizedBox(height: spaceBetweenTextFields), + Container( + color: Colors.white, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).boxQuantity, + isTextFieldHasSuffix: false, + dropDownText: box != null + ? widget.medicineViewModel.boxQuintity.toString() + : null, + enabled: false, + ), + ), + SizedBox(height: spaceBetweenTextFields), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + child: Stack( + children: [ + TextFields( + maxLines: 6, + minLines: 4, + hintText: TranslationBase.of(context).instruction, + controller: instructionController, + ), + Positioned( + top: 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + size: 35, + ), + onPressed: () { + initSpeechState().then((value) => {onVoiceText()}); + }, + ), + ), + ], + ), + ), + SizedBox(height: spaceBetweenTextFields), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + color: Color(0xff359846), + title: TranslationBase.of(context).addMedication, + fontWeight: FontWeight.w600, + onPressed: () async { + addMedicationButton(widget.medicineViewModel); + }, + ), + ], + ), + ), + ], + ), + ); + } + + selectDate(BuildContext context, PrescriptionViewModel model) async { + Helpers.hideKeyboard(context); + DateTime selectedDate; + selectedDate = DateTime.now(); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != selectedDate) { + setState(() { + this.selectedDate = picked; + }); + } + } + + addMedicationButton(MedicineViewModel model) async { + await locator().logEvent( + eventCategory: "Add Prescription Form", + eventAction: "Add Prescription", + ); + if (duration != null && + doseTime != null && + frequency != null && + selectedDate != null && + strengthController.text != "") { + if (widget.selectedMedication.isNarcotic == true) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .narcoticMedicineCanOnlyBePrescribedFromVida); + Navigator.pop(context); + return; + } + + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).thousandIsTheMAXForTheStrength); + return; + } + if (double.parse(strengthController.text) < 0.0) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context).strengthCanNotBeZero); + return; + } + + if (formKey.currentState.validate()) { + Navigator.push( + context, + SlideUpPageRoute( + widget: AddDrugWidget( + patient: widget.patient, + medicineModel: widget.medicineViewModel, + modelPrescription: widget.prescriptionViewModel, + prescriptionList: widget.prescriptionList, + route: route, + doseTime: doseTime, + duration: duration, + frequency: frequency, + units: units, + uom: uom, + x: x, + selectedMedication: widget.selectedMedication, + strength: strengthController.text, + indication: indicationController.text, + instruction: instructionController.text, + selectedDate: selectedDate, + ), + ), + ); + // Navigator.pop(context); + // openDrugToDrug(model, prescriptionViewModel); + } + } else { + setState(() { + if (duration == null) { + durationError = TranslationBase.of(context).fieldRequired; + } else { + durationError = null; + } + if (doseTime == null) { + doseTimeError = TranslationBase.of(context).fieldRequired; + } else { + doseTimeError = null; + } + if (route == null) { + routeError = TranslationBase.of(context).fieldRequired; + } else { + routeError = null; + } + if (frequency == null) { + frequencyError = TranslationBase.of(context).fieldRequired; + } else { + frequencyError = null; + } + if (units == null) { + unitError = TranslationBase.of(context).fieldRequired; + } else { + unitError = null; + } + if (strengthController.text == "") { + strengthError = TranslationBase.of(context).fieldRequired; + } else { + strengthError = null; + } + }); + } + formKey.currentState.save(); + } +} diff --git a/lib/screens/prescription/add_prescription/search_preescription_widget.dart b/lib/screens/prescription/add_prescription/search_preescription_widget.dart new file mode 100644 index 00000000..8adeddd4 --- /dev/null +++ b/lib/screens/prescription/add_prescription/search_preescription_widget.dart @@ -0,0 +1,137 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import '../../../config/config.dart'; +import '../../../core/model/search_drug/get_medication_response_model.dart'; +import '../../../core/viewModel/medicine_view_model.dart'; +import '../../../core/viewModel/prescription/prescription_view_model.dart'; +import '../../../util/helpers.dart'; +import '../../../util/translations_delegate_base.dart'; +import '../../../widgets/medicine/medicine_item_widget.dart'; +import '../../../widgets/shared/buttons/app_buttons_widget.dart'; +import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart'; +import '../../../widgets/shared/network_base_view.dart'; +import '../../../widgets/shared/text_fields/app_text_form_field.dart'; +import '../../base/base_view.dart'; + +final myController = TextEditingController(); + +class SearchPrescriptionWidget extends StatelessWidget { + final double spaceBetweenTextFields; + final MedicineViewModel medicineViewModel; + final PrescriptionViewModel prescriptionViewModel; + final Function(GetMedicationResponseModel) onItemSelected; + + const SearchPrescriptionWidget( + {Key key, + this.spaceBetweenTextFields, + this.medicineViewModel, + this.prescriptionViewModel, + this.onItemSelected}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: ( + BuildContext context, + MedicineViewModel model, + Widget child, + ) => + NetworkBaseView( + baseViewModel: model, + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + borderColor: Colors.white, + hintText: TranslationBase.of(context).searchMedicineNameHere, + controller: myController, + onSaved: (value) {}, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + inputFormatter: ONLY_LETTERS, + ), + ), + ), + SizedBox( + height: 15.0, + ), + Container( + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.8, + child: Container( + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine( + context, + model, + ); + }, + ), + ], + ), + ), + ), + if (myController.text != '') + Container( + height: MediaQuery.of(context).size.height * 0.5, + child: ListView.builder( + padding: const EdgeInsets.only(top: 20), + scrollDirection: Axis.vertical, + itemCount: model.allMedicationList == null + ? 0 + : model.allMedicationList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: + model.allMedicationList[index].description), + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.getItem(itemID: model.allMedicationList[index].itemId, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + onItemSelected(model.allMedicationList[index]); + // uom = _selectedMedication.uom; + }, + ); + }, + ), + ), + ], + ), + ), + SizedBox( + height: spaceBetweenTextFields, + ), + ], + ), + ), + ); + } + + searchMedicine(context, MedicineViewModel model) async { + FocusScope.of(context).unfocus(); + if (myController.text.length < 3) { + Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + return; + } + GifLoaderDialogUtils.showMyDialog(context); + await model.getMedicationList(drug: myController.text, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + } +} diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart deleted file mode 100644 index 8c07afcf..00000000 --- a/lib/screens/prescription/add_prescription_form.dart +++ /dev/null @@ -1,1177 +0,0 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; -import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; -import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:provider/provider.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_to_text.dart' as stt; - -addPrescriptionForm(context, PrescriptionViewModel model, - PatiantInformtion patient, prescription) { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext bc) { - return PrescriptionFormWidget(model, patient, prescription); - }); -} - -postPrescription( - {String duration, - String doseTimeIn, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model, - DateTime doseTime, - String doseUnit, - String icdCode, - PatiantInformtion patient, - String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = - new PostPrescriptionReqModel(); - List prescriptionList = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - postProcedureReqModel.clinicID = patient.clinicId; - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - - prescriptionList.add(PrescriptionRequestModel( - covered: true, - dose: double.parse(dose), - itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit), - route: route.isEmpty ? 1 : int.parse(route), - frequency: frequency.isEmpty ? 1 : int.parse(frequency), - remarks: instruction, - approvalRequired: true, - icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime.toIso8601String())); - postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model.postPrescription(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else if (model.state == ViewState.Idle) { - model.getPrescriptions(patient); - DrAppToastMsg.showSuccesToast('Medication has been added'); - } -} - -class PrescriptionFormWidget extends StatefulWidget { - final PrescriptionViewModel model; - final PatiantInformtion patient; - final List prescriptionList; - - PrescriptionFormWidget(this.model, this.patient, this.prescriptionList); - - @override - _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); -} - -class _PrescriptionFormWidgetState extends State { - String routeError; - String frequencyError; - String doseTimeError; - String durationError; - String unitError; - String strengthError; - - int selectedType; - - TextEditingController strengthController = TextEditingController(); - TextEditingController indicationController = TextEditingController(); - TextEditingController instructionController = TextEditingController(); - - bool visbiltyPrescriptionForm = false; - bool visbiltySearch = true; - - final myController = TextEditingController(); - DateTime selectedDate; - int strengthChar; - GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); - - TextEditingController drugIdController = TextEditingController(); - TextEditingController doseController = TextEditingController(); - final searchController = TextEditingController(); - stt.SpeechToText speech = stt.SpeechToText(); - var event = RobotProvider(); - var reconizedWord; - - final GlobalKey formKey = GlobalKey(); - final double spaceBetweenTextFileds = 12; - dynamic route; - dynamic frequency; - dynamic duration; - dynamic doseTime; - dynamic indication; - dynamic units; - dynamic uom; - dynamic box; - dynamic x; - - @override - void initState() { - requestPermissions(); - event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { - if (this.mounted) { - initSpeechState().then((value) => {onVoiceText()}); - } - } - }); - selectedType = 1; - super.initState(); - } - - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - onVoiceText() async { - new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: lang == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } - } - - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - print(error); - } - - void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; - } - - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } - - void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); - - if (result.finalResult == true) { - setState(() { - SpeechToText.closeAlertDialog(context); - speech.stop(); - instructionController.text += reconizedWord + '\n'; - }); - } else { - print(result.finalResult); - } - } - - Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) async { - x = model.patientAssessmentList.map((element) { - return element.icdCode10ID; - }); - GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: widget.patient.appointmentNo); - if (model.medicationStrengthList.length == 0) { - await model.getMedicationStrength(); - } - if (model.medicationDurationList.length == 0) { - await model.getMedicationDuration(); - } - if (model.medicationDoseTimeList.length == 0) { - await model.getMedicationDoseTime(); - } - await model.getPatientAssessment(getAssessmentReqModel); - }, - builder: ( - BuildContext context, - MedicineViewModel model, - Widget child, - ) => - NetworkBaseView( - baseViewModel: model, - child: GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: DraggableScrollableSheet( - initialChildSize: 0.98, - maxChildSize: 0.98, - minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.65, - color: Color(0xffF8F8F8), - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - children: [ - Column( - children: [ - SizedBox( - height: 60, - ), - ], - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - children: [ - FractionallySizedBox( - widthFactor: 0.9, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - onTap: () { - visbiltyPrescriptionForm = false; - visbiltySearch = true; - }, - borderColor: Colors.white, - hintText: TranslationBase.of(context) - .searchMedicineNameHere, - controller: myController, - onSaved: (value) {}, - onFieldSubmitted: (value) { - searchMedicine(context, model); - }, - inputFormatter: ONLY_LETTERS, - ), - ), - ), - SizedBox( - height: 15.0, - ), - Visibility( - visible: visbiltySearch, - child: Container( - child: Column( - children: [ - FractionallySizedBox( - widthFactor: 0.8, - child: Container( - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of( - context) - .search, - onPressed: () async { - await searchMedicine( - context, model); - }, - ), - ], - ), - ), - ), - if (myController.text != '') - Container( - height: MediaQuery.of(context) - .size - .height * - 0.5, - child: ListView.builder( - padding: const EdgeInsets.only( - top: 20), - scrollDirection: Axis.vertical, - itemCount: - model.allMedicationList == - null - ? 0 - : model - .allMedicationList - .length, - itemBuilder: - (BuildContext context, - int index) { - return InkWell( - child: MedicineItemWidget( - label: model - .allMedicationList[ - index] - .description), - onTap: () { - model.getItem( - itemID: model - .allMedicationList[ - index] - .itemId); - visbiltyPrescriptionForm = - true; - visbiltySearch = false; - _selectedMedication = - model.allMedicationList[ - index]; - uom = _selectedMedication - .uom; - }, - ); - }, - ), - ), - ], - ), - ), - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Visibility( - visible: visbiltyPrescriptionForm, - child: Container( - child: Column( - children: [ - AppText( - _selectedMedication?.description ?? - "", - bold: true, - ), - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context) - .orderType, - fontWeight: FontWeight.w600, - ), - Radio( - activeColor: - Color(0xFFB9382C), - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context) - .regular), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.35, - child: AppTextFieldCustom( - //height: 40, - validationError: - strengthError, - hintText: 'Strength', - isTextFieldHasSuffix: false, - enabled: true, - controller: - strengthController, - onChanged: (String value) { - setState(() { - strengthChar = - value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, - ); - } - }, - inputType: TextInputType - .numberWithOptions( - decimal: true, - ), - ), - ), - SizedBox( - width: 5.0, - ), - PrescriptionTextFiled( - width: MediaQuery.of(context) - .size - .width * - 0.510, - element: model - .itemMedicineListUnit - .length == - 1 - ? model - .itemMedicineListUnit[0] - : units, - elementError: unitError, - keyName: 'description', - keyId: 'parameterCode', - hintText: 'Unit', - elementList: model - .itemMedicineListUnit, - okFunction: (selectedValue) { - setState(() { - units = selectedValue; - units['isDefault'] = true; - }); - }, - ), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - elementList: - model.itemMedicineListRoute, - element: model.itemMedicineListRoute - .length == - 1 - ? model.itemMedicineListRoute[0] - : route, - elementError: routeError, - keyId: 'parameterCode', - keyName: 'description', - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - route['isDefault'] = true; - }); - }, - hintText: - TranslationBase.of(context) - .route, - ), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - hintText: - TranslationBase.of(context) - .frequency, - elementError: frequencyError, - element: frequency, - elementList: - model.itemMedicineList, - keyId: 'parameterCode', - keyName: 'description', - okFunction: (selectedValue) { - setState(() { - frequency = selectedValue; - frequency['isDefault'] = true; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController.text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); - - return; - } - }); - }), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - hintText: - TranslationBase.of(context) - .doseTime, - elementError: doseTimeError, - element: doseTime, - elementList: - model.medicationDoseTimeList, - keyId: 'id', - keyName: 'nameEn', - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }), - SizedBox( - height: spaceBetweenTextFileds), - if (model - .patientAssessmentList.isNotEmpty) - Container( - height: screenSize.height * 0.070, - width: double.infinity, - color: Colors.white, - child: Row( - children: [ - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, - child: TextField( - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), - enabled: true, - readOnly: true, - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.57, - color: Colors.white, - child: TextField( - maxLines: 5, - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), - enabled: true, - readOnly: true, - ), - ), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: () => selectDate( - context, widget.model), - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - PrescriptionTextFiled( - element: duration, - elementError: durationError, - hintText: - TranslationBase.of(context) - .duration, - elementList: - model.medicationDurationList, - keyName: 'nameEn', - keyId: 'id', - okFunction: (selectedValue) { - setState(() { - duration = selectedValue; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController.text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text), - ); - box = model.boxQuintity; - - return; - } - }); - }, - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - color: Colors.white, - child: AppTextFieldCustom( - hintText: "UOM", - isTextFieldHasSuffix: false, - dropDownText: - uom != null ? uom : null, - enabled: false, - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - color: Colors.white, - child: AppTextFieldCustom( - hintText: - TranslationBase.of(context) - .boxQuantity, - isTextFieldHasSuffix: false, - dropDownText: box != null - ? model.boxQuintity.toString() - : null, - enabled: false, - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), - child: Stack( - children: [ - TextFields( - maxLines: 6, - minLines: 4, - hintText: TranslationBase.of( - context) - .instruction, - controller: - instructionController, - //keyboardType: TextInputType.number, - ), - Positioned( - top: 0, - right: 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - size: 35, - ), - onPressed: () { - initSpeechState().then( - (value) => - {onVoiceText()}); - }, - ), - ), - ], - ), - ), - SizedBox( - height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - color: Color(0xff359846), - title: TranslationBase.of( - context) - .addMedication, - fontWeight: FontWeight.w600, - onPressed: () async { - await locator< - AnalyticsService>() - .logEvent( - eventCategory: - "Add Prescription Form", - eventAction: - "Add Prescription", - ); - if (duration != null && - doseTime != null && - frequency != null && - selectedDate != null && - strengthController - .text != - "") { - if (_selectedMedication - .isNarcotic == - true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .narcoticMedicineCanOnlyBePrescribedFromVida); - Navigator.pop(context); - return; - } - - if (double.parse( - strengthController - .text) > - 1000.0) { - DrAppToastMsg - .showErrorToast( - "1000 is the MAX for the strength"); - return; - } - if (double.parse( - strengthController - .text) < - 0.0) { - DrAppToastMsg - .showErrorToast( - "strength can't be zero"); - return; - } - - if (formKey.currentState - .validate()) { - Navigator.pop(context); - openDrugToDrug(model); - { - // postProcedure( - // icdCode: model - // .patientAssessmentList - // .isNotEmpty - // ? model - // .patientAssessmentList[ - // 0] - // .icdCode10ID - // .isEmpty - // ? "test" - // : model - // .patientAssessmentList[ - // 0] - // .icdCode10ID - // .toString() - // : "test", - // // icdCode: model - // // .patientAssessmentList - // // .map((value) => value - // // .icdCode10ID - // // .trim()) - // // .toList() - // // .join(' '), - // dose: strengthController - // .text, - // doseUnit: model - // .itemMedicineListUnit - // .length == - // 1 - // ? model - // .itemMedicineListUnit[ - // 0][ - // 'parameterCode'] - // .toString() - // : units['parameterCode'] - // .toString(), - // patient: widget.patient, - // doseTimeIn: - // doseTime['id'] - // .toString(), - // model: widget.model, - // duration: duration['id'] - // .toString(), - // frequency: model - // .itemMedicineList - // .length == - // 1 - // ? model - // .itemMedicineList[ - // 0][ - // 'parameterCode'] - // .toString() - // : frequency[ - // 'parameterCode'] - // .toString(), - // route: model.itemMedicineListRoute - // .length == - // 1 - // ? model - // .itemMedicineListRoute[ - // 0][ - // 'parameterCode'] - // .toString() - // : route['parameterCode'] - // .toString(), - // drugId: - // _selectedMedication - // .itemId - // .toString(), - // strength: - // strengthController - // .text, - // indication: - // indicationController - // .text, - // instruction: - // instructionController - // .text, - // doseTime: selectedDate, - // ); - } - } - } else { - setState(() { - if (duration == null) { - durationError = - TranslationBase.of( - context) - .fieldRequired; - } else { - durationError = null; - } - if (doseTime == null) { - doseTimeError = - TranslationBase.of( - context) - .fieldRequired; - } else { - doseTimeError = null; - } - if (route == null) { - routeError = - TranslationBase.of( - context) - .fieldRequired; - } else { - routeError = null; - } - if (frequency == null) { - frequencyError = - TranslationBase.of( - context) - .fieldRequired; - } else { - frequencyError = null; - } - if (units == null) { - unitError = - TranslationBase.of( - context) - .fieldRequired; - } else { - unitError = null; - } - if (strengthController - .text == - "") { - strengthError = - TranslationBase.of( - context) - .fieldRequired; - } else { - strengthError = null; - } - }); - } - - formKey.currentState.save(); - }, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ); - }), - ), - ), - ); - } - - selectDate(BuildContext context, PrescriptionViewModel model) async { - Helpers.hideKeyboard(context); - DateTime selectedDate; - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now(), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - this.selectedDate = picked; - }); - } - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.keyboard_arrow_down_sharp, - color: Color(0xff2E303A), - ) - : null, - hintStyle: TextStyle( - fontSize: 13, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - labelText: selectedText != null ? '$hintText\n$selectedText' : null, - labelStyle: TextStyle( - fontSize: 13, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - ); - } - - openDrugToDrug(model) { - showModalBottomSheet( - context: context, - builder: (context) { - return Container( - height: SizeConfig.realScreenHeight * .8, - width: SizeConfig.realScreenWidth, - child: SingleChildScrollView( - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - DrugToDrug( - widget.patient, - getPriscriptionforDrug(widget.prescriptionList, model), - model.patientAssessmentList), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), - child: AppButton( - title: TranslationBase.of(context).addMedication, - onPressed: () { - Navigator.pop(context); - - postPrescription( - icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID - .isEmpty - ? "test" - : model.patientAssessmentList[0].icdCode10ID - .toString() - : "test", - dose: strengthController.text, - doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'] - .toString() - : units['parameterCode'].toString(), - patient: widget.patient, - doseTimeIn: doseTime['id'].toString(), - model: widget.model, - duration: duration['id'].toString(), - frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] - .toString() - : frequency['parameterCode'].toString(), - route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'] - .toString() - : route['parameterCode'].toString(), - drugId: _selectedMedication.itemId.toString(), - strength: strengthController.text, - indication: indicationController.text, - instruction: instructionController.text, - doseTime: selectedDate, - ); - }, - )) - ], - )), - - //], - //) - ); - }); - } - - getPriscriptionforDrug( - List prescriptionList, MedicineViewModel model) { - var prescriptionDetails = []; - if (prescriptionList.length > 0) { - prescriptionList[0].entityList.forEach((element) { - if (element.mediSpanGPICode != null) { - prescriptionDetails.add({ - 'DrugId': element.mediSpanGPICode, - 'DrugName': element.medicationName, - 'Dose': element.doseDailyQuantity, - 'DoseType': element.doseDailyUnitID, - 'Unit': element.uom, - 'FrequencyType': element.frequencyID, - 'Duration': element.doseDurationDays, - 'RouteID': element.routeID, - 'IsScreen': element.isSIG - }); - } - }); - } - if (_selectedMedication.mediSpanGPICode != null) { - prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, - 'Dose': strengthController.text, - 'DoseType': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'].toString() - : units['parameterCode'].toString(), - 'Unit': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['description'] - : units['description'], - 'FrequencyType': model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'].toString() - : frequency['parameterCode'].toString(), - 'Duration': duration['id'].toString(), - 'RouteID': model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'].toString() - : route['parameterCode'].toString(), - 'IsScreen': true - }); - } - return prescriptionDetails; - } - - searchMedicine(context, MedicineViewModel model) async { - FocusScope.of(context).unfocus(); - if (myController.text.length < 3) { - Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); - return; - } - await model.getMedicationList(drug: myController.text); - } -} diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart new file mode 100644 index 00000000..d6403602 --- /dev/null +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -0,0 +1,180 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../../util/helpers.dart'; +import '../../widgets/shared/errors/error_message.dart'; + +class NewPrescriptionsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; + bool isFromLiveCare = routeArgs['isFromLiveCare']; + return BaseView( + onModelReady: (model) async { + model.getPrescriptionListNew( + mrn: patient.patientMRN, appNo: patient.appointmentNo); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: FractionallySizedBox( + widthFactor: 1.0, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions, + ), + ], + ), + ), + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || + (isFromLiveCare && patient.appointmentNo != null)) + AddNewOrder( + onTap: () { + Navigator.push( + context, + SlideUpPageRoute( + widget: BaseAddProcedureTabPage( + patient: patient, + prescriptionModel: model, + procedureType: ProcedureType.PRESCRIPTION, + ), + settingRoute: 'AddProcedureTabPage'), + ); + }, + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.92, + child: ListView.builder( + physics: BouncingScrollPhysics(), + itemCount: model.prescriptionListNew.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Helpers.convertToTitleCase(model + .prescriptionListNew[index] + .medicationName), + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :", + value: model + .prescriptionListNew[index].doctorName, + ), + CustomRow( + label: TranslationBase.of(context).orderTypeDescription + ': ',//"Order Type Description :", + value: model.prescriptionListNew[index] + .orderTypeDescription, + ), + CustomRow( + label: TranslationBase.of(context).status + ': ', + value: + model.prescriptionListNew[index].status, + ), + CustomRow( + label: TranslationBase.of(context).indication + ': ', //"indication :", + value: model + .prescriptionListNew[index].indication, + ), + CustomRow( + label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :", + value: model + .prescriptionListNew[index].doseDetail, + ), + CustomRow( + label: TranslationBase.of(context).quantity + ': ',//"quantity :", + value: model + .prescriptionListNew[index].quantity + .toString(), + ),CustomRow( + label: TranslationBase.of(context).startDate + ': ', //"start Date :", + value: model + .prescriptionListNew[index].startDate + .toString(), + ),CustomRow( + label: TranslationBase.of(context).stopDate + ': ',//"stop Date :", + value: model + .prescriptionListNew[index].stopDate + .toString(), + ), + if(model + .prescriptionListNew[index].remarks != null&& model + .prescriptionListNew[index].remarks!= "") + CustomRow( + label: TranslationBase.of(context).remarks + ': ',//"Remark :", + value: model + .prescriptionListNew[index].remarks + .toString(), + ), + ], + ), + ),); + }), + ), + ), + if (model.prescriptionListNew.isEmpty && + patient.patientStatusType != 43) + Center( + child: ErrorMessage( + error: TranslationBase.of(context).noPrescriptionsFound, + )) + ], + ), + ), + )), + ); + } +} diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart new file mode 100644 index 00000000..19d12416 --- /dev/null +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -0,0 +1,234 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; +import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; +import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../../util/helpers.dart'; +import '../../widgets/shared/errors/error_message.dart'; + +class OldPrescriptionsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; + bool isFromLiveCare = routeArgs['isFromLiveCare']; + return BaseView( + onModelReady: (model) async { + patient.admissionNo == null + ? model.getPrescriptions(patient, + patientType: patientType, isLocalBusy: false) + : model.getMedicationForInPatient(patient); + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: patient.admissionNo == null + ? FractionallySizedBox( + widthFactor: 1.0, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context) + .prescriptions + "(${TranslationBase.of(context) + .old }) ", + ), + ], + ), + ), + ListView.builder( + physics: BouncingScrollPhysics(), + itemCount: model.prescriptionsList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: model + .prescriptionsList[index], + patient: patient, + arrivalType: arrivalType, + ), + ), + ), + child: Column( + children: [ + DoctorCard( + doctorName: + Helpers.convertToTitleCase(model + .prescriptionsList[index] + .doctorName), + profileUrl: model + .prescriptionsList[index] + .doctorImageURL, + branch: model + .prescriptionsList[index].name, + clinic: model.prescriptionsList[index] + .clinicDescription, + isPrescriptions: true, + appointmentDate: AppDateUtils + .getDateTimeFromServerFormat( + model.prescriptionsList[index] + .appointmentDate, + ), + ), + ], + )); + }), + if (model.prescriptionsList.isEmpty && + patient.patientStatusType != 43) + Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .noPrescriptionsFound, + )) + ], + ), + ), + ) + : Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context) + .prescriptions + "(${TranslationBase.of(context) + .old }) ", + ), + model.medicationForInPatient.length == 0? + Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .noPrescriptionsFound, + )): ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.medicationForInPatient.length, + itemBuilder: (context, index) { + //model.medicationForInPatient.length, + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .pHRItemDescription), + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: "Doctor Name :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .doctorName + .toString()), + ), + CustomRow( + label: "Status :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .statusDescription + .toString()), + ), + CustomRow( + label: "dose :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .dose + .toString()), + ), CustomRow( + label: "comments :", + value: Helpers.convertToTitleCase(model + .medicationForInPatient[index] + .comments + .toString()), + ), + + ], + ), + ), + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: + model.medicationForInPatient[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: AppDateUtils + .getDateTimeFromServerFormat( + model.medicationForInPatient[index] + .startDatetime, + ), + stopOn: AppDateUtils + .getDateTimeFromServerFormat( + model.medicationForInPatient[index] + .stopDatetime, + ), + ), + ), + ), + ); + }), + ], + ), + ), + ), + ))); + } +} diff --git a/lib/screens/prescription/prescription_authorazation_form.dart b/lib/screens/prescription/prescription_authorazation_form.dart deleted file mode 100644 index 8b137891..00000000 --- a/lib/screens/prescription/prescription_authorazation_form.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 608dd643..3930cffd 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -8,10 +8,10 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_template_detai import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -97,7 +97,7 @@ class _PrescriptionCheckOutScreenState Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); - DrAppToastMsg.showSuccesToast('Medication has been added'); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).medicationHasBeenAdded); } } @@ -114,8 +114,8 @@ class _PrescriptionCheckOutScreenState TextEditingController indicationController = TextEditingController(); TextEditingController instructionController = TextEditingController(); - bool visbiltyPrescriptionForm = true; - bool visbiltySearch = true; + bool visibilityPrescriptionForm = true; + bool visibilitySearch = true; final myController = TextEditingController(); DateTime selectedDate; @@ -129,10 +129,10 @@ class _PrescriptionCheckOutScreenState final searchController = TextEditingController(); stt.SpeechToText speech = stt.SpeechToText(); var event = RobotProvider(); - var reconizedWord; + var recognizedWord; final GlobalKey formKey = GlobalKey(); - final double spaceBetweenTextFileds = 12; + final double spaceBetweenTextFields = 12; dynamic route; dynamic frequency; dynamic duration; @@ -179,7 +179,7 @@ class _PrescriptionCheckOutScreenState } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -189,14 +189,14 @@ class _PrescriptionCheckOutScreenState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - instructionController.text += reconizedWord + '\n'; + instructionController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); @@ -221,6 +221,7 @@ class _PrescriptionCheckOutScreenState final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { + // TODO Elham* move this logic to the model model.getItem( itemID: int.parse( widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); @@ -299,7 +300,7 @@ class _PrescriptionCheckOutScreenState ], ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Container( child: Form( @@ -316,10 +317,10 @@ class _PrescriptionCheckOutScreenState ), ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Visibility( - visible: visbiltyPrescriptionForm, + visible: visibilityPrescriptionForm, child: Container( child: Column( children: [ @@ -337,7 +338,7 @@ class _PrescriptionCheckOutScreenState fontWeight: FontWeight.w600, ), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, value: 1, groupValue: selectedType, onChanged: (value) { @@ -349,7 +350,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( width: double.infinity, child: Row( @@ -362,7 +363,7 @@ class _PrescriptionCheckOutScreenState child: AppTextFieldCustom( height: 40, validationError: strengthError, - hintText: 'Strength', + hintText: TranslationBase.of(context).strength, isTextFieldHasSuffix: false, enabled: true, controller: strengthController, @@ -410,7 +411,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( elementList: model.itemMedicineListRoute, @@ -427,7 +428,7 @@ class _PrescriptionCheckOutScreenState hintText: TranslationBase.of(context).route, ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context) .frequency, @@ -460,7 +461,7 @@ class _PrescriptionCheckOutScreenState } }); }), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context) .doseTime, @@ -475,7 +476,7 @@ class _PrescriptionCheckOutScreenState doseTime = selectedValue; }); }), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), if (model .patientAssessmentList.isNotEmpty) Container( @@ -533,7 +534,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( height: screenSize.height * 0.070, color: Colors.white, @@ -556,7 +557,7 @@ class _PrescriptionCheckOutScreenState ), ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( element: duration, elementError: durationError, @@ -590,9 +591,9 @@ class _PrescriptionCheckOutScreenState }); }, ), - SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), + SizedBox(height: spaceBetweenTextFields), + SizedBox(height: spaceBetweenTextFields), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -630,7 +631,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), @@ -638,7 +639,7 @@ class _PrescriptionCheckOutScreenState alignment: WrapAlignment.center, children: [ AppButton( - color: Color(0xff359846), + color: AppGlobal.appGreenColor, title: TranslationBase.of(context) .addMedication, fontWeight: FontWeight.w600, @@ -651,19 +652,12 @@ class _PrescriptionCheckOutScreenState selectedDate != null && strengthController.text != "") { - // if (_selectedMedication.isNarcotic == true) { - // DrAppToastMsg.showErrorToast(TranslationBase.of(context) - // .narcoticMedicineCanOnlyBePrescribedFromVida); - // Navigator.pop(context); - // return; - // } - if (double.parse( strengthController .text) > 1000.0) { DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); + TranslationBase.of(context).thousandIsTheMAXForTheStrength,); return; } if (double.parse( @@ -671,14 +665,12 @@ class _PrescriptionCheckOutScreenState .text) < 0.0) { DrAppToastMsg.showErrorToast( - "strength can't be zero"); + TranslationBase.of(context).strengthCanNotBeZero,); return; } - if (formKey.currentState .validate()) { Navigator.pop(context); - // openDrugToDrug(model); { postPrescription( icdCode: model @@ -696,13 +688,6 @@ class _PrescriptionCheckOutScreenState .icdCode10ID .toString() : "test", - // icdCode: model - // .patientAssessmentList - // .map((value) => value - // .icdCode10ID - // .trim()) - // .toList() - // .join(' '), dose: strengthController .text, doseUnit: model @@ -862,6 +847,8 @@ class _PrescriptionCheckOutScreenState } } + /// TODO Elham* Use it from the textfeild utils + InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart deleted file mode 100644 index 623cee90..00000000 --- a/lib/screens/prescription/prescription_details_page.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class PrescriptionDetailsPage extends StatelessWidget { - final PrescriptionReport prescriptionReport; - - PrescriptionDetailsPage({Key key, this.prescriptionReport}); - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - prescriptionReport.imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: AppText( - prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), - ), - ), - ) - ], - ), - ), - Container( - color: Colors.white, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - child: Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - outside: BorderSide(width: 0.5)), - children: [ - TableRow( - children: [ - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).route, - fontSize: 14, - ))), - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).frequency, - fontSize: 14, - ))), - Container( - color: Colors.white, - width: double.infinity, - padding: EdgeInsets.symmetric(horizontal: 4), - child: Center( - child: AppText( - "${TranslationBase.of(context).dailyDoses}", - fontSize: 14, - ))), - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).duration, - fontSize: 14, - ))), - ], - ), - TableRow( - children: [ - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: - Center(child: Text(prescriptionReport.routeN))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: Center( - child: - Text(prescriptionReport.frequencyN ?? ''))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: Center( - child: Text( - '${prescriptionReport.doseDailyQuantity}'))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: - Center(child: Text('${prescriptionReport.days}'))) - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - width: double.infinity, - color: Colors.white, - padding: EdgeInsets.all(5), - child: Center( - child: Column( - children: [ - AppText(TranslationBase.of(context).notes), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[300], - ), - SizedBox( - height: 5, - ), - AppText(prescriptionReport.remarks ?? ''), - ], - ), - ), - ) - ], - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart deleted file mode 100644 index eb95257b..00000000 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ /dev/null @@ -1,235 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class PrescriptionItemsInPatientPage extends StatelessWidget { - final GetMedicationForInPatientModel prescriptions; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final DateTime startOn; - final DateTime stopOn; - final int prescriptionIndex; - - PrescriptionItemsInPatientPage( - {Key key, - this.prescriptions, - this.patient, - this.patientType, - this.arrivalType, - this.stopOn, - this.startOn, - this.prescriptionIndex}); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) async { - if (model.medicationForInPatient.length == 0) { - await model.getMedicationForInPatient(patient); - } - }, - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - backgroundColor: Colors.grey[100], - baseViewModel: model, - appBar: PatientProfileAppBar(patient), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18, right: 18), - child: AppText( - prescriptions.pHRItemDescription, - bold: true, - ), - ), - SizedBox( - height: 12, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 18, - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).direction, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + - prescriptions - .directionDescription - .toString() ?? - '')), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - AppText(" " + - prescriptions.routeDescription - .toString() ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).refill, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + - prescriptions - .refillDescription - .toString() ?? - '')), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).startDate, - color: Colors.grey, - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).stopDate, - color: Colors.grey, - ), - Expanded( - child: AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ), - ], - ), - Row( - children: [ - AppText( - 'UOM', - color: Colors.grey, - ), - AppText(" " + - prescriptions.uomDescription - .toString() ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText( - " " + prescriptions.dose.toString() ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).status, - color: Colors.grey, - ), - AppText(" " + - prescriptions.statusDescription - .toString() ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).processed, - color: Colors.grey, - ), - AppText(" " + - prescriptions.doctorName - .toString() ?? - ''), - ], - ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).num, - // color: Colors.grey, - // ), - // AppText(" " + prescriptions.dose.toString() ?? ''), - // ], - // ), - SizedBox( - height: 12, - ), - AppText(prescriptions.comments ?? ''), - ], - ), - ) - ], - ) - ], - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart deleted file mode 100644 index 751a3deb..00000000 --- a/lib/screens/prescription/prescription_items_page.dart +++ /dev/null @@ -1,373 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class PrescriptionItemsPage extends StatelessWidget { - final Prescriptions prescriptions; - final PatiantInformtion patient; - final String patientType; - final String arrivalType; - - PrescriptionItemsPage( - {Key key, - this.prescriptions, - this.patient, - this.patientType, - this.arrivalType}); - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getPrescriptionReport( - prescriptions: prescriptions, patient: patient), - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - backgroundColor: Colors.grey[100], - baseViewModel: model, - appBar: PatientProfileAppBar( - patient, - clinic: prescriptions.clinicDescription, - branch: prescriptions.name, - isPrescriptions: true, - appointmentDate: AppDateUtils.getDateTimeFromServerFormat( - prescriptions.appointmentDate), - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - isAppointmentHeader: true, - ), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - if (!prescriptions.isInOutPatient) - ...List.generate( - model.prescriptionReportList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: - EdgeInsets.only(left: 18, right: 18), - child: AppText( - model.prescriptionReportList[index] - .itemDescription.isNotEmpty - ? model - .prescriptionReportList[index] - .itemDescription - : model - .prescriptionReportList[index] - .itemDescriptionN, - bold: true, - )), - SizedBox( - height: 12, - ), - Row( - children: [ - SizedBox( - width: 18, - ), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all( - width: 0.5, - color: Colors.grey)), - height: 55, - width: 55, - child: InkWell( - onTap: () { - showDialog( - context: context, - builder: (ctx) => - ShowImageDialog( - imageUrl: model - .prescriptionReportEnhList[ - index] - .imageSRCUrl, - )); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model - .prescriptionReportList[index] - .imageSRCUrl, - fit: BoxFit.cover, - ), - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context) - .route, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + - model - .prescriptionReportList[ - index] - .routeN)), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .frequency, - color: Colors.grey, - ), - AppText(" " + - model - .prescriptionReportList[ - index] - .frequencyN ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .dailyDoses, - color: Colors.grey, - ), - AppText(" " + - model - .prescriptionReportList[ - index] - .doseDailyQuantity ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .duration, - color: Colors.grey, - ), - AppText(" " + - model - .prescriptionReportList[ - index] - .days - .toString() ?? - ''), - ], - ), - SizedBox( - height: 12, - ), - AppText(model - .prescriptionReportList[ - index] - .remarks ?? - ''), - ], - ), - ) - ], - ) - ], - ), - ), - )) - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white, - ), - margin: EdgeInsets.all(12), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(left: 18, right: 18), - child: AppText( - model.prescriptionReportEnhList[index] - .itemDescription, - bold: true, - ), - ), - SizedBox( - height: 12, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 18, - ), - Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all( - width: 0.5, color: Colors.grey)), - height: 55, - width: 55, - child: InkWell( - onTap: () { - showDialog( - context: context, - builder: (ctx) => ShowImageDialog( - imageUrl: model - .prescriptionReportEnhList[ - index] - .imageSRCUrl, - )); - }, - child: Stack( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.network( - model - .prescriptionReportEnhList[ - index] - .imageSRCUrl, - fit: BoxFit.cover, - ), - ), - Positioned( - top: 10, - right: 10, - child: Icon( - EvaIcons.search, - color: Colors.grey, - size: 35, - )) - ], - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).route, - color: Colors.grey, - ), - Expanded( - child: AppText(" " + - model - .prescriptionReportEnhList[ - index] - .route ?? - '')), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .frequency, - color: Colors.grey, - ), - AppText(" " + - model - .prescriptionReportEnhList[ - index] - .frequency ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .dailyDoses, - color: Colors.grey, - ), - AppText(" " + - model - .prescriptionReportEnhList[ - index] - .doseDailyQuantity - .toString() ?? - ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .duration, - color: Colors.grey, - ), - AppText(" " + - model - .prescriptionReportList[ - index] - .days - .toString() ?? - ''), - ], - ), - SizedBox( - height: 12, - ), - AppText(model - .prescriptionReportEnhList[index] - .remarks ?? - ''), - ], - ), - ) - ], - ) - ], - ), - ), - ), - ), - ], - ), - ), - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 8f2676bc..95b70182 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -44,7 +44,7 @@ class _PrescriptionTextFiledState extends State { list: widget.elementList, attributeName: '${widget.keyName}', attributeValueId: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyId}'] + ? widget.elementList[0]['${widget.keyId}'].toString() : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart deleted file mode 100644 index c91ce9c9..00000000 --- a/lib/screens/prescription/prescription_warnings.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -void prescriptionWarning(context) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Container( - height: 600, - child: Column( - children: [ - ...List.generate( - 5, - (index) => Container( - child: ExpansionTile( - title: AppText('Prescription warning and alerts(0)'), - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - 'DOSESCREENINGRESULTFORETCETC', - color: Color(0XFFB8382C), - ) - ], - ) - ], - ), - ), - ), - SizedBox( - height: 10.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: - Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Remarks', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox( - height: 95.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'CONTINUE', - onPressed: () { - Navigator.pop(context); - authorizationForm(context); - }, - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - color: Colors.white, - title: 'remove', - fontColor: Colors.red, - onPressed: () { - Navigator.pop(context); - prescriptionWarning(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} - -void authorizationForm(context) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: 500, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Prescription authorization'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 30.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Auth ID', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Password', - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - obscureText: true, - ), - ), - SizedBox( - height: 190.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'CONTINUE', - onPressed: () { - Navigator.pop(context); - authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} diff --git a/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart b/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart new file mode 100644 index 00000000..70fa1765 --- /dev/null +++ b/lib/screens/prescription/prescriptions_items/preacription_items_widget.dart @@ -0,0 +1,157 @@ +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../../../widgets/shared/dialogs/ShowImageDialog.dart'; + + +class PrescriptionItemsWidget extends StatelessWidget { + final String itemDescription; + final String route; + final String frequency; + final dynamic dailyDoses; + final String imageSRCUrl; + final String remarks; + final int days; + final PrescriptionViewModel prescriptionViewModel; + + + + PrescriptionItemsWidget( + {this.itemDescription, + this.route, + this.frequency, + this.dailyDoses, + this.imageSRCUrl, + this.remarks, + this.days, this.prescriptionViewModel, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + ...List.generate( + // TODO Elham* List.generate to list.builder + prescriptionViewModel.prescriptionReportEnhList.length, + (index) => Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + prescriptionViewModel.prescriptionReportEnhList[index].itemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + width: 0.5, color: Colors.grey)), + height: 55, + width: 55, + child: InkWell( + onTap: () { + showDialog( + context: context, + builder: (ctx) => ShowImageDialog( + imageUrl: prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl, + )); + }, + child: Stack( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.network( + prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + ), + ), + Positioned( + top: 10, + right: 10, + child: Icon( + EvaIcons.search, + color: Colors.grey, + size: 35, + )) + ], + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of(context).route + ' : ', + value: " " + prescriptionViewModel.prescriptionReportEnhList[index].route ?? '', + labelSize: 13, + valueSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).frequency + ' : ', + value: " " + prescriptionViewModel.prescriptionReportEnhList[index].frequency ?? '', + labelSize: 13, + valueSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).dailyDoses + ' : ', + value: " " + prescriptionViewModel.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? '', + labelSize: 13, + valueSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).duration + ' : ', + value: " " + prescriptionViewModel.prescriptionReportList[index].days.toString() ?? '', + labelSize: 13, + valueSize: 13, + ), + SizedBox( + height: 12, + ), + CustomRow( + label: '', + value: prescriptionViewModel.prescriptionReportList[index].remarks ?? '', + valueSize: 14, + ), + ], + ), + ) + ], + ) + ], + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/screens/prescription/prescriptions_items/prescription_items_in_patient.dart b/lib/screens/prescription/prescriptions_items/prescription_items_in_patient.dart new file mode 100644 index 00000000..cc21e1e3 --- /dev/null +++ b/lib/screens/prescription/prescriptions_items/prescription_items_in_patient.dart @@ -0,0 +1,187 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionItemsInPatientPage extends StatelessWidget { + final GetMedicationForInPatientModel prescriptions; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final DateTime startOn; + final DateTime stopOn; + final int prescriptionIndex; + + PrescriptionItemsInPatientPage( + {Key key, + this.prescriptions, + this.patient, + this.patientType, + this.arrivalType, + this.stopOn, + this.startOn, + this.prescriptionIndex}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) async { + if (model.medicationForInPatient.length == 0) { + await model.getMedicationForInPatient(patient); + } + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + backgroundColor: Colors.grey[100], + baseViewModel: model, + appBar: PatientProfileAppBar(patient), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + prescriptions.pHRItemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomRow( + label: TranslationBase.of(context).direction + ' :', + value: " " + prescriptions.directionDescription.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).route + ' :', + value: " " + prescriptions.routeDescription ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).refill + ' :', + value: " " + prescriptions.refillDescription ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).startDate + ' :', + value: " " + AppDateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic) ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).stopDate + ' :', + value: " " + AppDateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic) ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: 'UOM' + ' :', + value: " " + prescriptions.uomDescription.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).dailyDoses, + value: " " + prescriptions.dose.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).status, + value: " " + prescriptions.statusDescription.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + CustomRow( + label: TranslationBase.of(context).processed, + value: " " + prescriptions.doctorName.toString() ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + SizedBox( + height: 12, + ), + CustomRow( + label: '', + value: prescriptions.comments ?? '', + isCopyable: false, + isExpanded: false, + valueSize: 13, + labelSize: 13, + ), + ], + ), + ) + ], + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_items/prescription_items_out_patient.dart b/lib/screens/prescription/prescriptions_items/prescription_items_out_patient.dart new file mode 100644 index 00000000..e49fb5e2 --- /dev/null +++ b/lib/screens/prescription/prescriptions_items/prescription_items_out_patient.dart @@ -0,0 +1,74 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/preacription_items_widget.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionItemsPage extends StatelessWidget { + final Prescriptions prescriptions; + final PatiantInformtion patient; + final String arrivalType; + + PrescriptionItemsPage( + {Key key, + this.prescriptions, + this.patient, + this.arrivalType}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPrescriptionReport( + prescriptions: prescriptions, patient: patient), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + backgroundColor: Colors.grey[100], + baseViewModel: model, + appBar: PatientProfileAppBar( + patient, + clinic: prescriptions.clinicDescription, + branch: prescriptions.name, + isPrescriptions: true, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + prescriptions.appointmentDate), + doctorName: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + isAppointmentHeader: true, + ), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.prescriptionReportEnhList.length, + itemBuilder: (context, index) => PrescriptionItemsWidget( + frequency: model.prescriptionReportEnhList[index].frequency, + itemDescription: model.prescriptionReportEnhList[index].itemDescription, + days: model.prescriptionReportEnhList[index].days, + route: model.prescriptionReportEnhList[index].route, + dailyDoses: model.prescriptionReportEnhList[index].doseDailyQuantity, + imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl, + remarks: model.prescriptionReportEnhList[index].remarks, + prescriptionViewModel: model, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart deleted file mode 100644 index ef66b82b..00000000 --- a/lib/screens/prescription/prescriptions_page.dart +++ /dev/null @@ -1,218 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.dart'; -import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; -import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; -import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import '../../widgets/shared/errors/error_message.dart'; - -class PrescriptionsPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; - bool isFromLiveCare = routeArgs['isFromLiveCare']; - bool isSelectInpatient = routeArgs['isSelectInpatient']; - return BaseView( - onModelReady: (model) => patient.admissionNo == null - ? model.getPrescriptions(patient, patientType: patientType) - : model.getMedicationForInPatient(patient), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - body: patient.admissionNo == null - ? FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), - children: [ - SizedBox( - height: 12, - ), - if (model.prescriptionsList.isNotEmpty && - patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: - TranslationBase.of(context).prescriptions, - ), - ], - ), - ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: - TranslationBase.of(context).prescriptions, - ), - ], - ), - ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || - (isFromLiveCare && patient.appointmentNo != null)) - AddNewOrder( - onTap: () { - Navigator.push( - context, - SlideUpPageRoute( - widget: BaseAddProcedureTabPage( - patient: patient, - prescriptionModel: model, - procedureType: ProcedureType.PRESCRIPTION, - ), - settingRoute: 'AddProcedureTabPage'), - ); - }, - label: TranslationBase.of(context) - .applyForNewPrescriptionsOrder, - ), - ...List.generate( - model.prescriptionsList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: - model.prescriptionsList[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), - ), - ), - child: DoctorCard( - doctorName: - model.prescriptionsList[index].doctorName, - profileUrl: model - .prescriptionsList[index].doctorImageURL, - branch: model.prescriptionsList[index].name, - clinic: model.prescriptionsList[index] - .clinicDescription, - isPrescriptions: true, - appointmentDate: - AppDateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index] - .appointmentDate, - ), - ))), - if (model.prescriptionsList.isEmpty && - patient.patientStatusType != 43) - Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, - )) - ], - ), - ) - : NetworkBaseView( - baseViewModel: model, - child: FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: model.medicationForInPatient.length, - itemBuilder: (context, index) { - //model.medicationForInPatient.length, - return InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: - PrescriptionItemsInPatientPage( - prescriptionIndex: index, - prescriptions: - model.medicationForInPatient[ - index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - startOn: AppDateUtils - .getDateTimeFromServerFormat( - model - .medicationForInPatient[ - index] - .startDatetime, - ), - stopOn: AppDateUtils - .getDateTimeFromServerFormat( - model - .medicationForInPatient[ - index] - .stopDatetime, - ), - ), - ), - ), - child: InPatientDoctorCard( - doctorName: model - .medicationForInPatient[index] - .pHRItemDescription, - profileUrl: 'sss', - branch: 'hamza', - clinic: 'basheer', - isPrescriptions: true, - appointmentDate: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .prescriptionDatetime, - ), - createdBy: model - .medicationForInPatient[index] - .doctorName - .toString(), - )); - }), - if (model.medicationForInPatient.length == 0) - Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, - )) - ], - ), - ), - ))); - } -} diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart deleted file mode 100644 index 1a39f7e6..00000000 --- a/lib/screens/prescription/update_prescription_form.dart +++ /dev/null @@ -1,1060 +0,0 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class UpdatePrescriptionForm extends StatefulWidget { - final String drugName; - final String doseStreangth; - final int drugId; - final String remarks; - final PatiantInformtion patient; - final String duration; - final String route; - final String dose; - final String doseUnit; - final String enteredRemarks; - final String startDate; - final String frequency; - final String drugNameGeneric; - final String uom; - final int box; - - final PrescriptionViewModel model; - - UpdatePrescriptionForm( - {this.drugName, - this.doseStreangth, - this.drugId, - this.remarks, - this.patient, - this.duration, - this.route, - this.dose, - this.startDate, - this.doseUnit, - this.enteredRemarks, - this.frequency, - this.model, - this.drugNameGeneric, - this.uom, - this.box}); - - @override - _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); -} - -class _UpdatePrescriptionFormState extends State { - TextEditingController strengthController = TextEditingController(); - TextEditingController remarksController = TextEditingController(); - int testNum = 0; - int strengthChar; - PatiantInformtion patient; - dynamic route; - dynamic doseTime; - dynamic frequencyUpdate; - dynamic updatedDuration; - dynamic units; - GetMedicationResponseModel newSelectedMedication; - GlobalKey key = - new GlobalKey>(); - List indicationList; - dynamic indication; - DateTime selectedDate; - - @override - void initState() { - super.initState(); - strengthController.text = widget.doseStreangth; - remarksController.text = widget.remarks; - indicationList = List(); - - dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; - dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; - dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; - dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; - dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; - dynamic indication7 = {"id": 551, "name": "Asterixis"}; - dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; - dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; - dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; - - indicationList.add(indication1); - indicationList.add(indication2); - indicationList.add(indication3); - indicationList.add(indication4); - indicationList.add(indication5); - indicationList.add(indication6); - indicationList.add(indication7); - indicationList.add(indication8); - indicationList.add(indication9); - indicationList.add(indication10); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return StatefulBuilder(builder: - (BuildContext context, StateSetter setState /*You can rename this!*/) { - return BaseView( - onModelReady: (model) async { - await model.getMedicationList(); - await model.getMedicationStrength(); - await model.getMedicationDuration(); - await model.getMedicationRoute(); - await model.getMedicationFrequency(); - await model.getMedicationDoseTime(); - await model.getItem(itemID: widget.drugId); - //await model.getMedicationIndications(); - route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); - doseTime = - model.getLookupById(model.medicationDoseTimeList, widget.dose); - updatedDuration = model.getLookupById( - model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); - frequencyUpdate = model.getLookupById( - model.medicationFrequencyList, widget.frequency); - }, - builder: - (BuildContext context, MedicineViewModel model, Widget child) => - NetworkBaseView( - baseViewModel: model, - child: GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: DraggableScrollableSheet( - initialChildSize: 0.98, - maxChildSize: 0.99, - minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.5, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Column( - children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // setState(() { - // newSelectedMedication = null; - // }); - // } - // : null, - // child: newSelectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // decoration: - // textFieldSelectorDecoration( - // widget.drugNameGeneric, - // newSelectedMedication != null - // ? newSelectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => newSelectedMedication = - // item), - // key: key, - // suggestions: - // model.allMedicationList, - // itemBuilder: (context, - // suggestion) => - // new Padding( - // child: AppText(suggestion - // .description + - // '/' + - // suggestion.genericName), - // padding: - // EdgeInsets.all(8.0)), - // itemSorter: (a, b) => 1, - // itemFilter: (suggestion, input) => - // suggestion.genericName - // .toLowerCase() - // .startsWith( - // input.toLowerCase()) || - // suggestion.description - // .toLowerCase() - // .startsWith( - // input.toLowerCase()) || - // suggestion.keywords - // .toLowerCase() - // .startsWith( - // input.toLowerCase()), - // ) - // : TextField( - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // newSelectedMedication != null - // ? newSelectedMedication - // .description + - // ('${newSelectedMedication.genericName}') - // : null, - // true, - // ), - // enabled: false, - // ), - // ), - // ), - // SizedBox( - // height: 12, - // ), - Container( - height: - MediaQuery.of(context).size.height * - 0.060, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.4900, - height: MediaQuery.of(context) - .size - .height * - 0.55, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), - // WhitelistingTextInputFormatter - // .digitsOnly - ], - - hintText: widget.doseStreangth, - fontSize: 15.0, - controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( - decimal: true, - ), - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - "Only 5 Digits allowed for strength"); - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, - child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units[ - 'description'] - : null, - true), - enabled: false, - ), - ), - ), - ], - ), - ), - SizedBox( - height: 12, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.itemMedicineListRoute != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, - attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'Route', - route != null - ? route['description'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDoseTimeList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationFrequencyList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate[ - 'nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDurationList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration[ - 'nameEn'] - .toString() - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: model.patientAssessmentList - .isNotEmpty - ? screenSize.height * 0.070 - : 0.0, - width: model.patientAssessmentList - .isNotEmpty - ? double.infinity - : 0.0, - child: model.patientAssessmentList - .isNotEmpty - ? Row( - children: [ - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, - child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() - : '', - indication != null - ? indication[ - 'name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.61, - child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - maxLines: 3, - decoration: textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .asciiDesc - .toString() - : '', - indication != null - ? indication[ - 'name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - ], - ) - : null), - SizedBox( - height: 12.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - AppDateUtils.getDateFormatted( - DateTime.parse( - widget.startDate)), - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - // duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - "UOM", - widget.uom != null - ? widget.uom - : null, - true), - // enabled: false, - readOnly: true, - ), - ), - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - // duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'Box Quantity', - widget.box != null - ? "Box Quantity: " + - widget.box.toString() - : null, - true), - // enabled: false, - readOnly: true, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - controller: remarksController, - maxLines: 7, - minLines: 4, - ), - ), - SizedBox( - height: 10.0, - ), - SizedBox( - height: - MediaQuery.of(context).size.height * - 0.08, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription' - .toUpperCase(), - onPressed: () { - if (double.parse( - strengthController.text) > - 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); - return; - } - if (double.parse( - strengthController - .text) == - 0.0) { - DrAppToastMsg.showErrorToast( - "strength can't be zero"); - return; - } - if (strengthController - .text.length > - 4) { - DrAppToastMsg.showErrorToast( - "strength can't be more then 4 digits "); - return; - } - // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) - updatePrescription( - newStartDate: selectedDate, - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : widget - .doseStreangth, - newUnit: units != null - ? units['parameterCode'] - .toString() - : widget.doseUnit, - doseUnit: widget.doseUnit, - doseStreangth: - widget.doseStreangth, - duration: widget.duration, - startDate: widget.startDate, - doseId: widget.dose, - frequencyId: widget.frequency, - routeId: widget.route, - patient: widget.patient, - model: widget.model, - newDuration: - updatedDuration != null - ? updatedDuration['id'] - .toString() - : widget.duration, - drugId: widget.drugId, - remarks: remarksController - .text, - route: route != null - ? route['parameterCode'] - .toString() - : widget.route, - frequency: - frequencyUpdate != null - ? frequencyUpdate[ - 'id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'] - .toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); - Navigator.pop(context); - }, - ), - ], - ), - ), - ], - ), - ], - ), - ), - )), - ); - }), - ), - ), - ); - }); - } - - selectDate(BuildContext context, PrescriptionViewModel model) async { - Helpers.hideKeyboard(context); - DateTime selectedDate; - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now(), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - this.selectedDate = picked; - }); - } - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - updatePrescription( - {PrescriptionViewModel model, - int drugId, - String newDrugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - DateTime newStartDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { - //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = - new PostPrescriptionReqModel(); - List sss = List(); - - updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; - updatePrescriptionReqModel.clinicID = patient.clinicId; - updatePrescriptionReqModel.episodeID = patient.episodeNo; - updatePrescriptionReqModel.patientMRN = patient.patientMRN; - - sss.add(PrescriptionRequestModel( - covered: true, - dose: newDoseStreangth.isNotEmpty - ? double.parse(newDoseStreangth) - : double.parse(doseStreangth), - //frequency.isNotEmpty ? int.parse(dose) : 1, - itemId: drugId, - doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), - route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty - ? int.parse(frequency) - : int.parse(frequencyId), - remarks: remarks.isEmpty ? enteredRemarks : remarks, - approvalRequired: true, - icdcode10Id: "test2", - doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty - ? int.parse(newDuration) - : int.parse(duration), - doseStartDate: - newStartDate != null ? newStartDate.toIso8601String() : startDate)); - updatePrescriptionReqModel.prescriptionRequestModel = sss; - //postProcedureReqModel.procedures = controlsProcedure; - - await model.updatePrescription( - updatePrescriptionReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('Medication has been updated'); - } - } -} - -void updatePrescriptionForm( - {context, - String drugName, - String drugNameGeneric, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String uom, - int box, - String startDate}) { - TextEditingController remarksController = TextEditingController(); - TextEditingController doseController = TextEditingController(); - TextEditingController frequencyController = TextEditingController(); - TextEditingController routeController = TextEditingController(); - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext context) { - return UpdatePrescriptionForm( - box: box, - uom: uom, - drugName: drugName, - patient: patient, - doseStreangth: doseStreangth, - remarks: remarks, - drugId: drugId, - enteredRemarks: enteredRemarks, - duration: duration, - dose: dose, - doseUnit: doseUnit, - frequency: frequency, - route: rouat, - startDate: startDate, - model: model, - drugNameGeneric: drugNameGeneric, - ); - }); -} diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 228ca33e..b0593b06 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; @@ -59,14 +60,16 @@ class _ExpansionProcedureState extends State { Radius.circular(5.0), )), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Row( - children: [ + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Icon( Icons.folder, size: 20, - color: Color(0xff575757), + color: AppGlobal.appTextColor, ), Expanded( child: Padding( @@ -78,10 +81,12 @@ class _ExpansionProcedureState extends State { widget.procedureTempleteModel.templateName : "Prescription for " + widget.procedureTempleteModel.templateName, + letterSpacing: -0.72, fontSize: 16.0, - variant: "bodyText", - bold: true, - color: Color(0xff575757)), + color: AppGlobal.appTextColor, + fontWeight: FontWeight.w600, + ), + ), ), ], @@ -93,8 +98,8 @@ class _ExpansionProcedureState extends State { _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.grey[800], - size: 22, + color: AppGlobal.appTextColor, + size: 28, ), ) ], diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 26216c94..f0f8b9ed 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -13,6 +13,8 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + class ProcedureCard extends StatelessWidget { final Function onTap; diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 0a2a943e..85261de2 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_fav_procedure.dart'; @@ -11,22 +11,21 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'ProcedureType.dart'; class AddFavouriteProcedure extends StatefulWidget { - final ProcedureViewModel model; + final ProcedureViewModel previousProcedureViewModel; final PrescriptionViewModel prescriptionModel; final PatiantInformtion patient; final ProcedureType procedureType; AddFavouriteProcedure({ Key key, - this.model, + this.previousProcedureViewModel, this.prescriptionModel, this.patient, @required this.procedureType, @@ -47,112 +46,91 @@ class _AddFavouriteProcedureState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getProcedureTemplate( - categoryID: widget.procedureType.getCategoryId()), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => + builder: (BuildContext context, ProcedureViewModel model_, + Widget child) => AppScaffold( - isShowAppBar: false, - baseViewModel: model, - body: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - (model.templateList.length != 0) - ? Expanded( - child: EntityListCheckboxSearchFavProceduresWidget( - isProcedure: - !(widget.procedureType == ProcedureType.PRESCRIPTION), - model: model, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), - groupProcedures: groupProcedures, - selectProcedures: (selectedProcedure) { - setState(() { - groupProcedures = selectedProcedure; - }); - }, - ), - ) - : Container( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 50.0), - child: AppText('You Don\'t have favorite prescription'), - ), - ), - ], - ), - bottomSheet: Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.procedureType.getAddButtonTitle(context) ?? - TranslationBase.of(context).addSelectedProcedures, - color: Color(0xff359846), - disabled: model.templateList.length == 0 ? true : false, - fontWeight: FontWeight.w700, - onPressed: () { - if (widget.procedureType == ProcedureType.PRESCRIPTION) { - if (groupProcedures == null) { - DrAppToastMsg.showErrorToast( - 'Please Select item ', - ); - return; - } + isShowAppBar: false, + baseViewModel: model, + body: Column(children: [ + (widget.previousProcedureViewModel.templateList.length != 0) + ? Expanded( + child: EntityListCheckboxSearchFavProceduresWidget( + isProcedure: !(widget.procedureType == + ProcedureType.PRESCRIPTION), + model: widget.previousProcedureViewModel, + removeFavProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addFavProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + isEntityFavListSelected: (master) => + isEntityListSelected(master), + groupProcedures: groupProcedures, + selectProcedures: (selectedProcedure) { + setState(() { + groupProcedures = selectedProcedure; + }); + }, + ), + ) + : ErrorMessage( + error: TranslationBase.of(context) + .youDoNotHaveFavoritePrescription, + ), + ]), + bottomSheet: BottomSheetDialogButton( + label: widget.procedureType.getAddButtonTitle(context) ?? + TranslationBase.of(context).addSelectedProcedures, + onTap: () async { + if (widget.procedureType == ProcedureType.PRESCRIPTION) { + if (groupProcedures == null) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseSelectItem, + ); + return; + } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PrescriptionCheckOutScreen( - patient: widget.patient, - model: widget.prescriptionModel, - groupProcedures: groupProcedures, - ), - settings: RouteSettings( - name: 'PrescriptionCheckOutScreen')), - ); - } else { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .fillTheMandatoryProcedureDetails, + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PrescriptionCheckOutScreen( + patient: widget.patient, + model: widget.prescriptionModel, + groupProcedures: groupProcedures, + ), + settings: RouteSettings( + name: 'PrescriptionCheckOutScreen')), + ); + } else { + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); + return; + } + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProcedureCheckOutScreen( + items: entityList, + model: model, + patient: widget.patient, + addButtonTitle: widget.procedureType + .getAddButtonTitle(context), + toolbarTitle: widget.procedureType + .getToolbarLabel(context), + ), + settings: + RouteSettings(name: 'ProcedureCheckOutScreen')), ); - return; } - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ProcedureCheckOutScreen( - items: entityList, - model: model, - patient: widget.patient, - addButtonTitle: widget.procedureType - .getAddButtonTitle(context), - toolbarTitle: widget.procedureType - .getToolbarLabel(context), - ), - settings: - RouteSettings(name: 'ProcedureCheckOutScreen')), - ); - } - }, - ), - ], - ), - ), - ), + })), ); } diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index e0b7374f..609c6808 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; import 'ProcedureType.dart'; import 'entity_list_checkbox_search_widget.dart'; @@ -183,7 +184,7 @@ class _AddProcedurePageState extends State { AppButton( title: procedureType.getAddButtonTitle(context), fontWeight: FontWeight.w700, - color: Color(0xff359846), + color: AppGlobal.appGreenColor, onPressed: () async { if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index e9ab695b..921b90b4 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -1,15 +1,15 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; - +import 'package:provider/provider.dart'; +import '../../core/viewModel/project_view_model.dart'; +import '../../util/tab_helper.dart'; import 'ProcedureType.dart'; import 'add-favourite-procedure.dart'; import 'add-procedure-page.dart'; @@ -68,172 +68,115 @@ class _BaseAddProcedureTabPageState extends State final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) async { + await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); + }, builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( - isShowAppBar: false, - body: NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.25, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle(title: procedureType.getToolbarLabel(context),), + body: NetworkBaseView( + baseViewModel: model, + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + + procedureType + .getFavouriteTabName(context), + isFirst: true,context: context + ), + tabWidget( + screenSize, + _activeTab == 1, + procedureType.getAllLabelName(context), + isLast: true,context: context + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - procedureType.getToolbarLabel(context), - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), - onTap: () { - Navigator.pop(context); - }, - ) - ]), - SizedBox( - height: MediaQuery.of(context).size.height * 0.04, + AddFavouriteProcedure( + previousProcedureViewModel: model, + prescriptionModel: + widget.prescriptionModel, + patient: patient, + procedureType: procedureType, ), - Expanded( - child: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight( - MediaQuery.of(context).size.height * 0.070), - child: Container( - height: - MediaQuery.of(context).size.height * 0.070, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.5), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorColor: Colors.transparent, - indicatorWeight: 1.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only( - top: 0, left: 0, right: 0, bottom: 0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - tabWidget( - screenSize, - _activeTab == 0, - procedureType - .getFavouriteTabName(context), - ), - tabWidget( - screenSize, - _activeTab == 1, - procedureType.getAllLabelName(context), - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - AddFavouriteProcedure( - model: this.model, - prescriptionModel: - widget.prescriptionModel, - patient: patient, - procedureType: procedureType, - ), - if (widget.procedureType == - ProcedureType.PRESCRIPTION) - PrescriptionFormWidget( - widget.prescriptionModel, - widget.patient, - widget.prescriptionModel - .prescriptionList) - else - AddProcedurePage( - model: this.model, - patient: patient, - procedureType: procedureType, - ), - ], - ), - ), - ], - ), + if (widget.procedureType == + ProcedureType.PRESCRIPTION) + AddPrescription( + widget.prescriptionModel, + widget.patient, + widget.prescriptionModel.prescriptionList, + ) + else + AddProcedurePage( + model: this.model, + patient: patient, + procedureType: procedureType, ), - ), ], ), ), - ); - }), + ], + ), + ) ), ), ); } - Widget tabWidget(Size screenSize, bool isActive, String title, - {int counter = -1}) { + Widget tabWidget( + Size screenSize, + bool isActive, + String title, { + int counter = -1, + bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + context, + }) { + ProjectViewModel projectViewModel = Provider.of(context); + return Center( child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), + height: TabHelper.getTabHeight(context), + decoration: TabHelper.getBoxTabsBoxDecoration( + isActive: isActive, + isFirst: isFirst, + isMiddle: isMiddle, + isLast: isLast, + projectViewModel: projectViewModel), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.5, - color: isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), + + TabHelper.getTabText(title: title, isActive: isActive), if (counter != -1) - Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : Color(0xFFD02127), - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : Color(0xFFD02127), - fontWeight: FontWeight.w700, - ), - ), - ), - ), + TabHelper.getTabCounter(isActive: isActive, counter: counter) ], ), ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 361ec695..7038fbc9 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -9,6 +9,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; + class EntityListCheckboxSearchWidget extends StatefulWidget { final ProcedureViewModel model; final Function addSelectedHistories; @@ -229,7 +231,7 @@ class _EntityListCheckboxSearchWidgetState : Center( child: Container( child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), + color: AppGlobal.appRedColor), ), ) ], diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 494540b1..1aa73c25 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -1,13 +1,14 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import 'package:flutter/services.dart'; +import '../../config/config.dart'; +import '../../widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { @@ -74,66 +75,71 @@ class _EntityListCheckboxSearchFavProceduresWidgetState } TextEditingController remarksController = TextEditingController(); + TextEditingController patientFileInfoController = TextEditingController(); + @override Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: widget.model, - child: Container( - height: MediaQuery.of(context).size.height * 0.60, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: Colors.white), - child: ListView( - children: [ - TextFields( - hintText: 'Search Favourite templates', - suffixIcon: EvaIcons.search, - suffixIconColor: Color(0xff2B353E), - onChanged: (value) { - filterSearchResults(value); - }, - hasBorder: false, - ), - SizedBox( - height: 15, - ), - widget.model.templateList.length != 0 - ? Column( - children: - widget.model.templateList.map((historyInfo) { - return ExpansionProcedure( - procedureTempleteModel: historyInfo, - model: widget.model, - removeFavProcedure: widget.removeFavProcedure, - addFavProcedure: widget.addFavProcedure, - selectProcedures: widget.selectProcedures, - isEntityListSelected: - widget.isEntityListSelected, - isEntityFavListSelected: - widget.isEntityFavListSelected, - isProcedure: widget.isProcedure, - groupProcedures: widget.groupProcedures); - }).toList(), - ) - : Center( - child: Container( - child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), - ), - ) + return SingleChildScrollView( + child: NetworkBaseView( + baseViewModel: widget.model, + child: Container( + height: MediaQuery.of(context).size.height * 0.90, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white), + child: ListView( + children: [ + AppTextFieldCustomSearch( + searchController: patientFileInfoController, + onChangeFun: (value) { + filterSearchResults(value); + }, + marginTop: 5, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_LETTERS)) ], + inputType: TextInputType.text, + hintText: TranslationBase.of(context).searchFavoriteTemplate, + // validationError: TranslationBase.of(context).emptyMessage + // : null, + ), + SizedBox( + height: 15, ), - )), + widget.model.templateList.length != 0 + ? Column( + children: + widget.model.templateList.map((historyInfo) { + return ExpansionProcedure( + procedureTempleteModel: historyInfo, + model: widget.model, + removeFavProcedure: widget.removeFavProcedure, + addFavProcedure: widget.addFavProcedure, + selectProcedures: widget.selectProcedures, + isEntityListSelected: + widget.isEntityListSelected, + isEntityFavListSelected: + widget.isEntityFavListSelected, + isProcedure: widget.isProcedure, + groupProcedures: widget.groupProcedures); + }).toList(), + ) + : Center( + child: Container( + child: AppText( + TranslationBase.of(context).sorryNoMatch, + color: AppGlobal.appRedColor), + ), + ) + ], ), - ), - ], + )), + ), ), ); } diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index 7c8b1074..daed9c2d 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_template_detai import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; @@ -14,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; + class ProcedureCheckOutScreen extends StatefulWidget { final List items; final ProcedureViewModel model; @@ -214,7 +216,7 @@ class _ProcedureCheckOutScreenState extends State { AppButton( title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, - color: Color(0xff359846), + color: AppGlobal.appGreenColor, fontWeight: FontWeight.w700, onPressed: () async { List entityList = List(); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 289170d2..4fdc9602 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -2,14 +2,14 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index a1f3615e..a7e0d22f 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -247,7 +247,7 @@ class _UpdateProcedureWidgetState extends State { children: [ AppText(TranslationBase.of(context).orderType), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, value: 0, groupValue: selectedType, onChanged: (value) { @@ -256,7 +256,7 @@ class _UpdateProcedureWidgetState extends State { ), Text('routine'), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, groupValue: selectedType, value: 1, onChanged: (value) { @@ -297,7 +297,7 @@ class _UpdateProcedureWidgetState extends State { //alignment: WrapAlignment.center, children: [ AppButton( - color: Color(0xff359846), + color: AppGlobal.appGreenColor, title: TranslationBase.of(context) .updateProcedure .toUpperCase(), diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index 5ce83044..b9f99bee 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; +import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 7c68d649..b9d9e060 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -28,6 +28,10 @@ class AppDateUtils { return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/'; } + static String convertDateToServerFormat(DateTime date) { + return '/Date(${date.millisecondsSinceEpoch})/'; + } + static convertDateFromServerFormat(String str, dateFormat) { var date = getDateTimeFromServerFormat(str); @@ -301,7 +305,7 @@ class AppDateUtils { /// get data formatted like 26 Apr 2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime, - {bool isArabic = false, bool isMonthShort = false}) { + {bool isArabic = false, bool isMonthShort = true}) { if (dateTime != null) return dateTime.day.toString() + " " + diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 3d9a0b1d..a69ff3e0 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -327,107 +327,7 @@ class Helpers { return kpi; } - static getBoxTabsBoxDecoration( - {bool isFirst = false, - bool isMiddle = false, - bool isLast = false, - bool isActive = false, - double radius = 6.0, - ProjectViewModel projectViewModel}) { - return BoxDecoration( - color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic - ? Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0) - : Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0), - topLeft: projectViewModel.isArabic - ? Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0) - : Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0) - : Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(isActive - ? isFirst || isMiddle - ? radius - : 0 - : 0) - : Radius.circular(isActive - ? isLast || isMiddle - ? radius - : 0 - : 0)), - ); - } - - static getBgTabColor() { - return Color(0xFFEAEAEA); - } - - static getTabText({ - String title, - bool isActive = false, - }) { - return AppText( - title, - fontSize: SizeConfig.textMultiplier * 1.8, - color: isActive ? Colors.white : AppGlobal.appTextColor, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - ); - } - - static getTabHeight(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return screenSize.height * 0.07; - } - static getTabCounter({bool isActive: false, int counter}) { - return Container( - margin: EdgeInsets.all(4), - width: 15, - height: 15, - decoration: BoxDecoration( - color: isActive ? Colors.white : AppGlobal.appRedColor, - shape: BoxShape.circle, - ), - child: Center( - child: FittedBox( - child: AppText( - "$counter", - fontSize: SizeConfig.textMultiplier * 1.5, - color: !isActive ? Colors.white : AppGlobal.appRedColor, - fontWeight: FontWeight.w700, - ), - ), - ), - ); - } static String convertToTitleCase(String text) { if (text == null) { diff --git a/lib/util/tab_helper.dart b/lib/util/tab_helper.dart new file mode 100644 index 00000000..c4a023d4 --- /dev/null +++ b/lib/util/tab_helper.dart @@ -0,0 +1,113 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +import '../config/config.dart'; +import '../config/size_config.dart'; +import '../core/viewModel/project_view_model.dart'; +import '../widgets/shared/app_texts_widget.dart'; + +class TabHelper { + + static getBoxTabsBoxDecoration( + {bool isFirst = false, + bool isMiddle = false, + bool isLast = false, + bool isActive = false, + double radius = 6.0, + ProjectViewModel projectViewModel}) { + return BoxDecoration( + color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic + ? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + topLeft: projectViewModel.isArabic + ? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(isActive + ? isFirst || isMiddle + ? radius + : 0 + : 0) + : Radius.circular(isActive + ? isLast || isMiddle + ? radius + : 0 + : 0)), + ); + } + + static getBgTabColor() { + return Color(0xFFEAEAEA); + } + + static getTabText({ + String title, + bool isActive = false, + }) { + return AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.8, + color: isActive ? Colors.white : AppGlobal.appTextColor, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ); + } + + static getTabHeight(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return screenSize.height * 0.07; + } + + static getTabCounter({bool isActive: false, int counter}) { + return Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : AppGlobal.appRedColor, + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : AppGlobal.appRedColor, + fontWeight: FontWeight.w700, + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6aa9c6c7..e433df63 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -13,13 +13,11 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; - String get areYouSureYouWantTo => - localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; String get language => localizedValues['language'][locale.languageCode]; @@ -37,48 +35,37 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; + String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule'][locale.languageCode]; + String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; String get verify => localizedValues['verify'][locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor'][locale.languageCode]; + String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic'][locale.languageCode]; + String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; String get frequency => localizedValues['frequency'][locale.languageCode]; String get priority => localizedValues['priority'][locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime'][locale.languageCode]; + String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions'][locale.languageCode]; + String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String get searchPatient => - localizedValues['searchPatient'][locale.languageCode]; + String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => - localizedValues['searchPatientDashBoard'][locale.languageCode]; + String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name'][locale.languageCode]; + String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; @@ -88,11 +75,9 @@ class TranslationBase { String get labResult => localizedValues['labResult'][locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics'][locale.languageCode]; + String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine'][locale.languageCode]; + String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; @@ -112,36 +97,27 @@ class TranslationBase { String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => - localizedValues['myInPatientTitle'][locale.languageCode]; + String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel'][locale.languageCode]; + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; - String get patientServices => - localizedValues['patientServices'][locale.languageCode]; + String get patientServices => localizedValues['patientServices'][locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => - localizedValues['searchMedicineDashboard'][locale.languageCode]; + String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; - String get referPatient => - localizedValues['referPatient'][locale.languageCode]; + String get referPatient => localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient'][locale.languageCode]; + String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; @@ -150,18 +126,15 @@ class TranslationBase { String get firstName => localizedValues['firstName'][locale.languageCode]; - String get firstNameInAr => - localizedValues['firstNameInAr'][locale.languageCode]; + String get firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; String get middleName => localizedValues['middleName'][locale.languageCode]; - String get middleNameInAr => - localizedValues['middleNameInAr'][locale.languageCode]; + String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; String get lastName => localizedValues['lastName'][locale.languageCode]; - String get lastNameInAr => - localizedValues['lastNameInAr'][locale.languageCode]; + String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; @@ -171,23 +144,19 @@ class TranslationBase { String get search => localizedValues['search'][locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String get itemsInSearch => - localizedValues['itemsInSearch'][locale.languageCode]; + String get medicineSearchResult => localizedValues['medicineSearchResult'][locale.languageCode]; String get qr => localizedValues['qr'][locale.languageCode]; String get reader => localizedValues['reader'][locale.languageCode]; - String get startScanning => - localizedValues['startScanning'][locale.languageCode]; + String get startScanning => localizedValues['startScanning'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; @@ -199,21 +168,17 @@ class TranslationBase { String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect'][locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect'][locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage'][locale.languageCode]; + String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile'][locale.languageCode]; + String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; @@ -229,18 +194,15 @@ class TranslationBase { String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; + String get prescription => localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -248,34 +210,27 @@ class TranslationBase { String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign'][locale.languageCode]; + String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders'][locale.languageCode]; + String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient'][locale.languageCode]; + String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; - String get operationReports => - localizedValues['operationReports'][locale.languageCode]; + String get operationReports => localizedValues['operationReports'][locale.languageCode]; String get reports => localizedValues['reports'][locale.languageCode]; @@ -287,15 +242,13 @@ class TranslationBase { String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote'][locale.languageCode]; + String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String get generalResult => - localizedValues['generalResult'][locale.languageCode]; + String get generalResult => localizedValues['generalResult'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; @@ -305,30 +258,23 @@ class TranslationBase { String get enterId => localizedValues['enterId'][locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword'][locale.languageCode]; + String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject'][locale.languageCode]; + String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo'][locale.languageCode]; + String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; String get home => localizedValues['home'][locale.languageCode]; @@ -344,23 +290,19 @@ class TranslationBase { String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose'][locale.languageCode]; + String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; String get choose => localizedValues['choose'][locale.languageCode]; - String get verification => - localizedValues['verification'][locale.languageCode]; + String get verification => localizedValues['verification'][locale.languageCode]; String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!'][locale.languageCode]; + String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; String get verify1 => localizedValues['verify1'][locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA'][locale.languageCode]; + String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; String get loginCode => localizedValues['loginCode'][locale.languageCode]; @@ -580,6 +522,9 @@ class TranslationBase { String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get pharmacyIntervention => + localizedValues['pharmacy-intervention'][locale.languageCode]; + String get add => localizedValues['add'][locale.languageCode]; String get addSickLeaverequest => @@ -906,6 +851,14 @@ class TranslationBase { String get medications => localizedValues['medications'][locale.languageCode]; + String get medication => localizedValues['medication'][locale.languageCode]; + + String get doctorComments => localizedValues['doctorComments'][locale.languageCode]; + + String get statusDescription => localizedValues['statusDescription'][locale.languageCode]; + + String get createdByName => localizedValues['createdByName'][locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; String get chiefComplaints => @@ -1123,6 +1076,8 @@ class TranslationBase { String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String get riskScore => localizedValues['riskScore'][locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get currentMedications => @@ -1723,18 +1678,53 @@ class TranslationBase { String get diabetic => localizedValues['diabetic'][locale.languageCode]; + String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + + String get intervention => localizedValues['intervention'][locale.languageCode]; + String get chart => localizedValues['chart'][locale.languageCode]; - String get investigation => - localizedValues['investigation'][locale.languageCode]; + String get investigation => localizedValues['investigation'][locale.languageCode]; - String get conditionOnDischarge => - localizedValues['conditionOnDischarge'][locale.languageCode]; + String get conditionOnDischarge => localizedValues['conditionOnDischarge'][locale.languageCode]; - String get planedProcedure => - localizedValues['planedProcedure'][locale.languageCode]; + String get planedProcedure => localizedValues['planedProcedure'][locale.languageCode]; String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; + + String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode]; + + String get pharmacology => localizedValues['pharmacology'][locale.languageCode]; + + String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; + + String get youDoNotHaveFavoritePrescription => localizedValues['youDoNotHaveFavoritePrescription'][locale.languageCode]; + + String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; + + String get searchFavoriteTemplate => localizedValues['searchFavoriteTemplate'][locale.languageCode]; + + String get sorryNoMatch => localizedValues['sorryNoMatch'][locale.languageCode]; + + String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength'][locale.languageCode]; + + String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero'][locale.languageCode]; + + String get old => localizedValues['old'][locale.languageCode]; + + String get orderTypeDescription => localizedValues['orderTypeDescription'][locale.languageCode]; + + String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; + + String get selectCondition => localizedValues['selectCondition'][locale.languageCode]; + + String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully'][locale.languageCode]; + + String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces'][locale.languageCode]; + + String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart index afce5f30..3c433917 100644 --- a/lib/widgets/dashboard/out_patient_stack.dart +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/screens/home/label.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index 9de818a5..3862826d 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index d73c5d3f..9544967b 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 7b9100a6..afc79d2a 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -25,7 +25,6 @@ class MyScheduleWidget extends StatelessWidget { return Container( color: HexColor("#EFEFEF"), child: Row( - //mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( @@ -36,36 +35,45 @@ class MyScheduleWidget extends StatelessWidget { SizedBox( height: 10, ), - AppText( - projectViewModel.isArabic - ? AppDateUtils.getWeekDayArabic( - workingHoursTable.date.weekday) - : AppDateUtils.getWeekDay(workingHoursTable.date.weekday), - fontSize: MediaQuery.of(context).size.width*0.032, - fontFamily: 'Poppins', - // fontSize: 18 + Padding( + padding: const EdgeInsets.only(left: 21), + child: AppText( + projectViewModel.isArabic + ? AppDateUtils.getWeekDayArabic( + workingHoursTable.date.weekday) + : AppDateUtils.getWeekDay(workingHoursTable.date.weekday), + fontSize: MediaQuery.of(context).size.width*0.032, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + letterSpacing: -0.52, + color: AppGlobal.scheduleTextColor, + ), ), - AppText( - ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', - fontSize: MediaQuery.of(context).size.width*0.05, - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - // fontSize: 18 + Padding( + padding: const EdgeInsets.only(left: 19), + child: AppText( + ' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + fontSize: MediaQuery.of(context).size.width*0.051, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + letterSpacing: -0.72, + color: AppGlobal.scheduleTextColor, + ), ), ], ), ), Container( - width: MediaQuery.of(context).size.width * 0.65, - // width: SizeConfig.getWidthMultiplier()*64, - // height: SizeConfig.getHeightMultiplier()*18, + width: MediaQuery.of(context).size.width * 0.70, + // height: MediaQuery.of(context).size.height * 0.16, child: CardWithBgWidget( + padding: 12, + marginLeft: 8, marginSymmetric: 7, hasBorder: false, bgColor: AppDateUtils.isToday(workingHoursTable.date) ? AppGlobal.appGreenColor : Colors.transparent, - // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -73,14 +81,10 @@ class MyScheduleWidget extends StatelessWidget { if (AppDateUtils.isToday(workingHoursTable.date)) AppText( "Today", - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, fontFamily: 'Poppins', color: AppGlobal.appGreenColor, - // fontSize: 18 ), - SizedBox( - height: 4, - ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { @@ -101,25 +105,30 @@ class MyScheduleWidget extends StatelessWidget { .convertToTitleCase( workingHoursTable.clinicName ?? ""), fontSize: MediaQuery.of(context).size.width*0.04, - fontWeight: FontWeight.w700,), + fontWeight: FontWeight.w700, + letterSpacing: -0.64, + color: AppGlobal.scheduleTextColor, + ), ), // AppText( - // workingHoursTable.clinicName ?? "", - // fontSize: 15, - // fontWeight: FontWeight.w700, - // ), Container( child: AppText( '${work.from} - ${work.to}', fontSize: MediaQuery.of(context).size.width*0.03, fontWeight: FontWeight.w300, + letterSpacing: -0.4, ), ), + SizedBox( + height: 12, + ), if (workingHoursTable.projectName != null) AppText( workingHoursTable.projectName ?? "", fontSize: MediaQuery.of(context).size.width*0.04, fontWeight: FontWeight.w700, + letterSpacing: -0.64, + color: AppGlobal.scheduleTextColor, ), ], ), diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index 9768d4d1..8db9b036 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -1,34 +1,33 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; import '../shared/rounded_container_widget.dart'; -/* - *@author: ibrahim albitar - *@Date:28/4/2020 - *@param: - *@return: - *@desc: - */ - class MedicineItemWidget extends StatefulWidget { final String label; final Color backgroundColor; final bool showBorder; + final bool showArrow; + final bool showPrice; final Color borderColor; final String url; + final String price; MedicineItemWidget( {@required this.label, this.backgroundColor = Colors.white, - this.showBorder = false, + this.showBorder = true, this.borderColor = Colors.white, - this.url}); + this.url, + this.showArrow = true, this.showPrice = false, this.price}); @override _MedicineItemWidgetState createState() => _MedicineItemWidgetState(); @@ -37,43 +36,72 @@ class MedicineItemWidget extends StatefulWidget { class _MedicineItemWidgetState extends State { @override Widget build(BuildContext context) { - return new RoundedContainer( - height: SizeConfig.heightMultiplier * 8, - child: Padding( - padding: const EdgeInsets.all(5.0), + return CardWithBgWidget( + // height: SizeConfig.heightMultiplier * 12.9, + bgColor: Colors.transparent, + hasBorder: false, + widget: Padding( + padding: const EdgeInsets.symmetric( + vertical: 4, + ), child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.start, children: [ if (widget.url != null) - Container( - height: 39, - width: 39, - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7)), + ClipRRect( + borderRadius: BorderRadius.circular(20.0), child: Image.network( widget.url, - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, + height: 25, + width: 30, + errorBuilder: (BuildContext context, Object exception, + StackTrace stackTrace) { + return Text(''); + }, + )), + Expanded( + child: Center( + child: Padding( + padding: EdgeInsets.all(2.5), + child: Align( + alignment: Alignment.centerLeft, + child: Column( + crossAxisAlignment:CrossAxisAlignment.start, + children: [ + AppText( + Helpers.convertToTitleCase(widget.label ?? ''), + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + if(widget.showPrice) + AppText( + Helpers.convertToTitleCase(widget.price ?? ''), + fontHeight: 1.4, + color: AppGlobal.appTextColor, + textAlign: TextAlign.start, + fontWeight: FontWeight.w600, + letterSpacing: -0.33, + ), + ], + ), ), ), ), - Expanded( - child: Padding( - padding: EdgeInsets.all(5), - child: Align( - alignment: Alignment.centerLeft, - child: AppText(widget.label)))), - Icon(EvaIcons.eye) + ), + if(widget.showArrow) + Icon(EvaIcons.arrowForward) ], ), ), - backgroundColor: widget.backgroundColor, - showBorder: widget.showBorder, - borderColor: widget.borderColor, - margin: EdgeInsets.all(4), - raduis: 10, + // backgroundColor: widget.backgroundColor, + // showBorder: widget.showBorder, + // borderColor: widget.borderColor, + // // margin: 4.0, + // // margin: EdgeInsets.all(4), + // raduis: 10, ); } diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart deleted file mode 100644 index bca60f5b..00000000 --- a/lib/widgets/patients/dynamic_elements.dart +++ /dev/null @@ -1,166 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -class DynamicElements extends StatefulWidget { - final PatientModel _patientSearchFormValues; - final bool isFormSubmitted; - - DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); - - @override - _DynamicElementsState createState() => _DynamicElementsState(); -} - -class _DynamicElementsState extends State { - TextEditingController _toDateController = new TextEditingController(); - TextEditingController _fromDateController = new TextEditingController(); - - void _presentDatePicker(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - print(id); - var selectedDate = DateFormat.yMd().format(pickedDate); - - if (id == '_selectedFromDate') { - // _fromDateController.text = selectedDate; - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _fromDateController.text = selectedDate; - } else { - selectedDate = pickedDate.year.toString() + - "-" + - pickedDate.month.toString().padLeft(2, '0') + - "-" + - pickedDate.day.toString().padLeft(2, '0'); - - _toDateController.text = selectedDate; - // _toDateController.text = selectedDate; - } - }); - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - {String hintText, - String selectedText, - bool isDropDown, - IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - return LayoutBuilder( - builder: (ctx, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - borderColor: Colors.white, - onTap: () => _presentDatePicker('_selectedFromDate'), - hintText: TranslationBase.of(context).fromDate, - controller: _fromDateController, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_fromDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.From = "0"; - } else { - widget._patientSearchFormValues.From = - _fromDateController.text.replaceAll("/", "-"); - } - }, - readOnly: true, - )), - SizedBox( - height: 5, - ), - if (widget._patientSearchFormValues.From == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - border: Border.all(width: 1.0, color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6.0))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - readOnly: true, - borderColor: Colors.white, - hintText: TranslationBase.of(context).toDate, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) { - if (_toDateController.text.toString().trim().isEmpty) { - widget._patientSearchFormValues.To = "0"; - } else { - widget._patientSearchFormValues.To = - _toDateController.text.replaceAll("/", "-"); - } - }, - )), - if (widget._patientSearchFormValues.To == "0" && - widget.isFormSubmitted) - CustomValidationError(), - SizedBox( - height: 10, - ), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 3935bb6b..3487c4fa 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,13 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; +import '../../util/helpers.dart'; class PatientReferralItemWidget extends StatelessWidget { final String referralStatus; @@ -51,7 +49,6 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), @@ -60,7 +57,8 @@ class PatientReferralItemWidget extends StatelessWidget { Container( child: CardWithBgWidget( bgColor: referralStatusCode == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor + //Color(0xffc4aa54) : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 @@ -81,11 +79,11 @@ class PatientReferralItemWidget extends StatelessWidget { AppText( referralStatus != null ? referralStatus : "", fontFamily: 'Poppins', - fontSize: 10.0, - letterSpacing: -0.4, + fontSize: 12.0, + letterSpacing: -0.48, fontWeight: FontWeight.w600, color: referralStatusCode == 1 - ? Color(0xffc4aa54) + ? AppGlobal.inProgressColor : referralStatusCode == 2 ? AppGlobal.appGreenColor : referralStatusCode == 46 @@ -94,21 +92,37 @@ class PatientReferralItemWidget extends StatelessWidget { ? Colors.red[700] : Colors.red[900], ), - AppText( - referredDate ?? "", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - fontSize: 12.0, - color: Color(0XFF28353E), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + referredDate ?? "", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + fontSize: 12.0, + color: Color(0XFF28353E), + ), + AppText( + referredTime ?? "", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 12.0, + color: Color(0XFF575757), + letterSpacing: -0.48, + ), + ], ) ], ), + SizedBox( + height: 7, + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - patientName ?? "", + Helpers.convertToTitleCase(patientName ?? ""), fontSize: 16.0, fontWeight: FontWeight.w600, color: Color(0xff2E303A), @@ -125,22 +139,10 @@ class PatientReferralItemWidget extends StatelessWidget { ) : Icon(DoctorApp.female_1, color: Color(0xffF0448D)), - SizedBox( - width: 4, - ), - AppText( - referredTime ?? "", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 12.0, - color: Color(0XFF575757), - letterSpacing: 0.48, - ) ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( @@ -158,35 +160,39 @@ class PatientReferralItemWidget extends StatelessWidget { ? TranslationBase.of(context).sameBranch : TranslationBase.of(context) .otherBranch - : " " + referralClinic, + : " " + Helpers.convertToTitleCase(referralClinic ?? ""), ), ], ), ), - Row( - children: [ - AppText( - nationality != null ? nationality : "", - fontWeight: FontWeight.w600, - color: Color(0xFF2E303A), - fontSize: 10.0, - letterSpacing: -0.4, - ), - nationalityFlag != null - ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - nationalityFlag, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text(''); - }, - )) - : SizedBox() - ], + Padding( + padding: const EdgeInsets.only(right: 0.1), + child: Row( + children: [ + AppText( + nationality != null ? nationality : "", + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: 10.0, + letterSpacing: -0.4, + ), + nationalityFlag != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + nationalityFlag, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text(''); + }, + ) + ) + : SizedBox() + ], + ), ) ], ), @@ -198,7 +204,7 @@ class PatientReferralItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 3, right: 0, top: 0.1), child: Image.asset( isReferral ? 'assets/images/patient/ic_ref_arrow_up.png' @@ -209,8 +215,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), Container( margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + left: 0, top: 18, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 1.0), child: Container( width: 40, height: 40, @@ -219,8 +225,8 @@ class PatientReferralItemWidget extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( doctorAvatar, - height: 25, - width: 30, + height: 28, + width: 28, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { @@ -241,12 +247,12 @@ class PatientReferralItemWidget extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + left: 10, top: 17, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - referralDoctorName ?? "", + Helpers.convertToTitleCase(referralDoctorName ?? ""), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 14.0, @@ -255,7 +261,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), if (clinicDescription != null) AppText( - clinicDescription, + Helpers.convertToTitleCase(clinicDescription ?? "") + , fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 10.0, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 1ec30afb..4ea7f789 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -2,7 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/widgets/patients/patient_card/ShowTimer.dart b/lib/widgets/patients/patient_card/ShowTimer.dart index 5b255f84..36064110 100644 --- a/lib/widgets/patients/patient_card/ShowTimer.dart +++ b/lib/widgets/patients/patient_card/ShowTimer.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 8588afb0..13b7f20d 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart index e0eb5b12..4068c7e5 100644 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:flutter/material.dart'; import './profile_general_info_content_widget.dart'; diff --git a/lib/widgets/patients/profile/app_bar/header_row.dart b/lib/widgets/patients/profile/app_bar/header_row.dart new file mode 100644 index 00000000..c5a0cd42 --- /dev/null +++ b/lib/widgets/patients/profile/app_bar/header_row.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class HeaderRow extends StatelessWidget { + final String label; + final String value; + final bool isExpanded; + + const HeaderRow({Key key, this.label, this.value, this.isExpanded = false}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + label, + isCopyable: true, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + isExpanded?Expanded(child: AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), ): + AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart similarity index 94% rename from lib/widgets/patients/profile/patient-profile-app-bar.dart rename to lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index 974d3590..60a48403 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -11,7 +11,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'large_avatar.dart'; +import '../large_avatar.dart'; +import 'header_row.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; @@ -342,7 +343,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase.of(context).dr}$doctorName', + Helpers.convertToTitleCase( + '${TranslationBase.of(context).dr}$doctorName'), color: Color(0xFF2E303A), fontWeight: FontWeight.w700, fontSize: SizeConfig @@ -366,9 +368,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { value: branch ?? '', ), if (clinic != null) - HeaderRow( - label: 'Clinic: ', - value: clinic ?? '', + Container( + width: + MediaQuery.of(context).size.width * + 0.51, + child: HeaderRow( + label: 'Clinic: ', + value: Helpers.convertToTitleCase( + clinic) ?? + '', + isExpanded: true), ), if (isMedicalFile && episode != null) HeaderRow( @@ -410,7 +419,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? isInpatient ? (isFromLabResult ? 210 : 200) : isAppointmentHeader - ? 290 + ? 340 : SizeConfig.isHeightVeryShort ? 137 : SizeConfig.isHeightShort @@ -419,35 +428,3 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { (SizeConfig.isWidthLarge ? 25 : 20) : height); } - -class HeaderRow extends StatelessWidget { - final String label; - final String value; - - const HeaderRow({Key key, this.label, this.value}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Row( - children: [ - AppText( - label, - isCopyable: true, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - SizedBox( - width: 1, - ), - AppText( - value, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - isCopyable: true, - ), - ], - ); - } -} diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart similarity index 98% rename from lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart rename to lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 72e0bc59..bd90d1e4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -3,17 +3,18 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'header_row.dart'; + class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 52af839c..84ea642d 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index 0d2c668b..b0e79268 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/medication.dart'; diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 95e47ed3..abf548ed 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -102,7 +102,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, + route: ORDER_PRESCRIPTION_OLD, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'assets/images/svgs/profile_screen/order prescription.svg'), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index b07982ea..9de84de2 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -70,6 +70,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).result, icon: 'assets/images/svgs/profile_screen/health summary.svg'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_OLD, + nameLine1: TranslationBase.of(context).patient, + nameLine2:TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', + icon: 'assets/images/svgs/profile_screen/order prescription.svg'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index d340555d..297b9d75 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -114,7 +114,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, + route: ORDER_PRESCRIPTION_OLD, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index a4c9d1a7..718c3081 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 880109cc..c214a040 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -49,7 +49,8 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: backgroundColor ?? Colors.white, + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor + , drawer: drawer, extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, diff --git a/lib/widgets/shared/charts/app_time_series_chart.dart b/lib/widgets/shared/charts/app_time_series_chart.dart index f4bd354e..cb89d635 100644 --- a/lib/widgets/shared/charts/app_time_series_chart.dart +++ b/lib/widgets/shared/charts/app_time_series_chart.dart @@ -1,8 +1,8 @@ import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; import 'package:flutter/material.dart'; import '../../../config/size_config.dart'; -import '../../../models/patient/vital_sign/vital_sign_res_model.dart'; import '../../../widgets/shared/rounded_container_widget.dart'; /* diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index bebd644d..aa03320d 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import '../../../config/config.dart'; + class ListSelectDialog extends StatefulWidget { final List list; final String attributeName; @@ -44,7 +46,6 @@ class _ListSelectDialogState extends State { } showAlertDialog(BuildContext context) { - // set up the buttons Widget cancelButton = FlatButton( child: Text(TranslationBase.of(context).cancel), onPressed: () { @@ -56,9 +57,7 @@ class _ListSelectDialogState extends State { Navigator.of(context).pop(); this.widget.okFunction(widget.selectedValue); }); -// set up the AlertDialog AlertDialog alert = AlertDialog( - // title: Text(widget.title), content: createDialogList(), actions: [ cancelButton, @@ -104,7 +103,7 @@ class _ListSelectDialogState extends State { .selectedValue[widget.attributeValueId] .toString(), value: item[widget.attributeValueId].toString(), - activeColor: Colors.blue.shade700, + activeColor: AppGlobal.appRedColor, selected: item[widget.attributeValueId] .toString() == widget.selectedValue[widget.attributeValueId] diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 80f0b3b1..9c407367 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 23feacc5..28a0278d 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -139,6 +139,14 @@ class DoctorCard extends StatelessWidget { valueSize: 13, labelSize: 13, ), + CustomRow( + label: TranslationBase.of(context).branch + + ": ", + value: branch, + valueSize: 13, + labelSize: 13, + ), + ]), ), ), diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index abb8efcc..dbcd8556 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/config.dart'; + class DoctorCardInsurance extends StatelessWidget { final String doctorName; final String approvalNo; @@ -63,7 +65,7 @@ class DoctorCardInsurance extends StatelessWidget { ), color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127), ), ), @@ -84,7 +86,7 @@ class DoctorCardInsurance extends StatelessWidget { "$approvalStatus", color: approvalStatus == "Approved" || approvalStatus == "تمت الموافقة" - ? Color(0xff359846) + ? AppGlobal.appGreenColor : Color(0xffD02127), letterSpacing: -0.4, fontSize: diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 5da2c10a..6370be77 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 355a0dc8..823b79aa 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -18,7 +18,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.inputFormatters, this.searchController, this.onFieldSubmitted, - this.hintText, + this.hintText, this.height, }); final TextEditingController searchController; @@ -34,6 +34,8 @@ class AppTextFieldCustomSearch extends StatelessWidget { final TextInputType inputType; final List inputFormatters; + final double height; + @override Widget build(BuildContext context) { @@ -43,6 +45,7 @@ class AppTextFieldCustomSearch extends StatelessWidget { child: Stack( children: [ AppTextFieldCustom( + height: height??0, hintText: hintText ?? TranslationBase.of(context).searchPatientName, isTextFieldHasSuffix: true, diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 79e9829f..d249ead0 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -134,7 +134,7 @@ class _HtmlRichEditorState extends State { } void statusListener(String status) { - recognizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { diff --git a/lib/widgets/shared/text_fields/new_text_Field.dart b/lib/widgets/shared/text_fields/new_text_Field.dart deleted file mode 100644 index 77cd0262..00000000 --- a/lib/widgets/shared/text_fields/new_text_Field.dart +++ /dev/null @@ -1,237 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class NumberTextInputFormatter extends TextInputFormatter { - @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { - final int newTextLength = newValue.text.length; - int selectionIndex = newValue.selection.end; - int usedSubstringIndex = 0; - final StringBuffer newText = StringBuffer(); - if (newTextLength >= 1) { - newText.write('('); - if (newValue.selection.end >= 1) selectionIndex++; - } - if (newTextLength >= 4) { - newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); - if (newValue.selection.end >= 3) selectionIndex += 2; - } - if (newTextLength >= 7) { - newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); - if (newValue.selection.end >= 6) selectionIndex++; - } - if (newTextLength >= 11) { - newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); - if (newValue.selection.end >= 10) selectionIndex++; - } - // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); - return TextEditingValue( - text: newText.toString(), - selection: TextSelection.collapsed(offset: selectionIndex), - ); - } -} - -final _mobileFormatter = NumberTextInputFormatter(); - -class NewTextFields extends StatefulWidget { - NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 15.0, - this.fontWeight = FontWeight.w500, - this.autoValidate = false, - this.hintColor, - this.isEnabled = true}) - : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; - - @override - _NewTextFieldsState createState() => _NewTextFieldsState(); -} - -class _NewTextFieldsState extends State { - final FocusNode _focusNode = FocusNode(); - bool focus = false; - bool view = false; - - @override - void initState() { - super.initState(); - _focusNode.addListener(() { - setState(() { - focus = _focusNode.hasFocus; - }); - }); - } - - @override - void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - _focusNode.dispose(); - super.dispose(); - } - - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { - _focusNode.unfocus(); - return true; - } else { - return false; - } - } - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - border: Border.all(color: HexColor('#707070'), width: 0.30), - color: Colors.white), - child: Container( - margin: EdgeInsets.only(top: 8), - padding: EdgeInsets.only(top: 8), - child: TextFormField( - enabled: widget.isEnabled, - initialValue: widget.initialValue, - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - // autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) - : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type == "password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( - fontSize: widget.fontSize, - fontWeight: widget.fontWeight, - color: Color(0xFF575757), - fontFamily: 'Poppins'), - inputFormatters: widget.keyboardType == TextInputType.phone - ? [ - // WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] - : widget.inputFormatters, - decoration: InputDecoration( - labelText: widget.hintText, - labelStyle: TextStyle( - color: Color(0xFF2E303A), - fontSize: 15, - fontWeight: FontWeight.w700), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context).errorColor.withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(8.0)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ); - } -} diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 21875e4d..006e0fa4 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -12,6 +12,7 @@ class CustomRow extends StatelessWidget { this.valueSize, this.width, this.isCopyable = true, + this.isExpanded = true, }) : super(key: key); final String label; @@ -20,6 +21,7 @@ class CustomRow extends StatelessWidget { final double valueSize; final double width; final bool isCopyable; + final bool isExpanded; @override Widget build(BuildContext context) { @@ -38,6 +40,7 @@ class CustomRow extends StatelessWidget { width: 1, ), Expanded( + flex: isExpanded ? 1 : 0, child: AppText( value, fontSize: diff --git a/pubspec.lock b/pubspec.lock index 85e7f11e..59acfac9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.2.0" args: dependency: transitive description: @@ -140,7 +140,7 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.3" + version: "8.1.4" cached_network_image: dependency: "direct main" description: @@ -210,7 +210,7 @@ packages: name: chewie_audio url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" cli_util: dependency: transitive description: @@ -413,21 +413,21 @@ packages: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.10.6" + version: "1.12.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.3" + version: "4.2.4" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.5.3" + version: "1.5.4" firebase_messaging: dependency: "direct main" description: @@ -441,14 +441,14 @@ packages: name: firebase_messaging_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "3.1.6" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web url: "https://pub.dartlang.org" source: hosted - version: "2.2.5" + version: "2.2.7" fixnum: dependency: transitive description: @@ -489,6 +489,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.5.0" + flutter_datetime_picker: + dependency: "direct main" + description: + name: flutter_datetime_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" flutter_device_type: dependency: "direct main" description: @@ -523,7 +530,7 @@ packages: name: flutter_keyboard_visibility url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.1.1" flutter_keyboard_visibility_platform_interface: dependency: transitive description: @@ -643,7 +650,7 @@ packages: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" hijri: dependency: transitive description: @@ -741,7 +748,7 @@ packages: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "1.1.9" + version: "1.1.10" logging: dependency: transitive description: @@ -846,7 +853,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.9" path_provider_android: dependency: transitive description: @@ -867,28 +874,28 @@ packages: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" pedantic: dependency: transitive description: @@ -937,14 +944,14 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.2" pointer_interceptor: dependency: transitive description: name: pointer_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.9.0+1" + version: "0.9.1" pool: dependency: transitive description: @@ -972,7 +979,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.1" + version: "6.0.2" pub_semver: dependency: transitive description: @@ -1014,35 +1021,35 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.13" shared_preferences_android: dependency: transitive description: name: shared_preferences_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.11" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.10" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_platform_interface: dependency: transitive description: @@ -1056,14 +1063,14 @@ packages: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.0" shelf: dependency: transitive description: @@ -1110,14 +1117,14 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" stack_trace: dependency: transitive description: @@ -1208,56 +1215,56 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.17" + version: "6.0.20" url_launcher_android: dependency: transitive description: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.13" + version: "6.0.15" url_launcher_ios: dependency: transitive description: name: url_launcher_ios url: "https://pub.dartlang.org" source: hosted - version: "6.0.13" + version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" uuid: dependency: transitive description: @@ -1278,21 +1285,35 @@ packages: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.2.10" + version: "2.2.18" + video_player_android: + dependency: transitive + description: + name: video_player_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.17" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.18" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.0.2" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.7" visibility_detector: dependency: transitive description: @@ -1369,7 +1390,7 @@ packages: name: webview_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" webview_flutter_wkwebview: dependency: transitive description: @@ -1383,14 +1404,14 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.3" + version: "2.3.11" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: @@ -1407,4 +1428,4 @@ packages: version: "3.1.0" sdks: dart: ">=2.15.0 <3.0.0" - flutter: ">=2.5.0" + flutter: ">=2.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index 766f55cb..dfc76868 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -112,6 +112,7 @@ dependencies: # Hijri # hijri: ^2.0.3 hijri_picker: ^3.0.0 + flutter_datetime_picker: ^1.5.1 # flutter_math_fork: ^0.6.0 # flutter_math_fork: ^0.6.0