diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index bc62109b..aa108809 100644 Binary files a/assets/fonts/DoctorApp.ttf and b/assets/fonts/DoctorApp.ttf differ diff --git a/assets/images/DrAppEmblemAnimation_v2.gif b/assets/images/DrAppEmblemAnimation_v2.gif new file mode 100644 index 00000000..fd2248b5 Binary files /dev/null and b/assets/images/DrAppEmblemAnimation_v2.gif differ diff --git a/assets/images/habib-logo.png b/assets/images/habib-logo.png new file mode 100644 index 00000000..bcb6a42b Binary files /dev/null and b/assets/images/habib-logo.png differ diff --git a/assets/images/inpatient.png b/assets/images/inpatient.png new file mode 100644 index 00000000..7a715654 Binary files /dev/null and b/assets/images/inpatient.png differ diff --git a/assets/images/patient/vital_signs/oxg.png b/assets/images/patient/vital_signs/oxg.png new file mode 100644 index 00000000..344344e5 Binary files /dev/null and b/assets/images/patient/vital_signs/oxg.png differ diff --git a/assets/images/patient/vital_signs/painScale.png b/assets/images/patient/vital_signs/painScale.png new file mode 100644 index 00000000..36b6b9f0 Binary files /dev/null and b/assets/images/patient/vital_signs/painScale.png differ diff --git a/assets/images/soundWaveAnimation.gif b/assets/images/soundWaveAnimation.gif new file mode 100644 index 00000000..730e27eb Binary files /dev/null and b/assets/images/soundWaveAnimation.gif differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 171125d9..645c587b 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -27,7 +27,10 @@ NSFaceIDUsageDescription We are using it for authentication - + NSAppleMusicUsageDescription + ${PRODUCT_NAME} requires access to use voice command + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index dc94b6e6..16284ed1 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -1,11 +1,13 @@ +import 'dart:io' show Platform; + import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'dart:io' show Platform; + +import 'widgets/shared/buttons/secondary_button.dart'; class UpdatePage extends StatelessWidget { final String message; @@ -32,14 +34,14 @@ class UpdatePage extends StatelessWidget { ), Image.asset('assets/images/HMG_logo.png'), SizedBox(height: 8,), - Texts( + AppText( TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, fontWeight: FontWeight.w600, ), SizedBox(height: 12,), Padding( padding: const EdgeInsets.all(8.0), - child: Texts(message??"Update the app",fontSize: 12,), + child: AppText(message??"Update the app",fontSize: 12,), ) ], ), diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 0ba19289..e92a921c 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; @@ -6,32 +7,12 @@ 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/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import 'dart:io' show Platform; - -import '../UpdatePage.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); -//ProjectProvider projectsProvider = new ProjectProvider(); -/* - *@author: Mohammad Aljammal - *@Date:28/5/2020 - *@param: url, onSuccess callBack, onFailure callBack - *@return: - *@desc: - */ - -///Example -/* - await BaseAppClient.post('', - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) {}, - body: null); -* */ class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, @@ -86,11 +67,15 @@ class BaseAppClient { await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } + if (body['ProjectID'] != null && + (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { + body['PatientOutSA'] = true; + } + print("URL : $url"); print("Body : ${json.encode(body)}"); - String req = json.encode(body); - var asd=""; - + var asd = json.encode(body); + var asd2; if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), @@ -100,20 +85,21 @@ class BaseAppClient { }); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { - onFailure('Error While Fetching data', statusCode); + onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],parsed['AndroidLink'],parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (!parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await helpers.logout(); - helpers.showErrorToast('Your session expired Please login agian'); + await Helpers.logout(); + Helpers.showErrorToast('Your session expired Please login agian'); } if (isAllowAny) { onFailure(getError(parsed), statusCode); @@ -161,11 +147,11 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 6.3; + body['VersionID'] = 8.3; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; - body['IPAdress'] = IP_ADDRESS; + body['IPAdress'] = "10.20.10.20"; body['generalid'] = GENERAL_ID; body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null @@ -208,6 +194,11 @@ class BaseAppClient { body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe + if (body['ProjectID'] != null && + (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { + body['PatientOutSA'] = true; + } + print("URL : $url"); print("Body : ${json.encode(body)}"); @@ -225,7 +216,8 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],parsed['AndroidLink'],parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], + parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -289,7 +281,6 @@ class BaseAppClient { } } - String getError(parsed) { //TODO change this fun String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; @@ -308,7 +299,7 @@ class BaseAppClient { } } if (error == null || error == "null" || error == "null\n") { - return helpers.generateContactAdminMsg(); + return Helpers.generateContactAdminMsg(); } return error; } diff --git a/lib/config/config.dart b/lib/config/config.dart index b00c3960..07151d1d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -68,6 +68,8 @@ const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; + const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; @@ -127,7 +129,7 @@ const GET_SICKLEAVE_STATISTIC = const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; -const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; +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'; @@ -150,6 +152,12 @@ 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'; + +const Verify_Referral_Doctor_Remarks = + 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; + ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = @@ -233,11 +241,21 @@ const GET_BOX_QUANTITY = ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; +const GET_MY_REFERRAL_INPATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; + +const GET_MY_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; + const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +const GET_IN_PATIENT_ORDERS = + 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; @@ -250,6 +268,19 @@ const SEND_PRESCRIPTION_EMAIL = 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"; var selectedPatientType = 1; @@ -275,8 +306,8 @@ var SERVICES_PATIANT2 = [ "patientArrivalList" ]; var SERVICES_PATIANT_HEADER = [ - "Search Out-Patient", - "Search In-Patient", + "My OutPatient", + "My InPatient", "Discharge", "Referred", "Referral Discharge", @@ -305,7 +336,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.5; +const VERSION_ID = 5.9; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a133ef7a..ea99a982 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -30,7 +30,9 @@ const Map> localizedValues = { 'ar': 'ملاحضات وتفاصيل العيادة' }, 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, - 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, + 'myOutPatient': {'en': 'My OutPatients', 'ar': 'المريض الخارجي'}, + + 'searchPatient': {'en': 'Search Patients', 'ar': 'البحث عن مريض'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'patient': {'en': 'Patient', 'ar': ' مريض'}, 'patients': {'en': "Patient's", 'ar': ' مريض'}, @@ -45,10 +47,12 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'}, + 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, - 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, + 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, @@ -381,8 +385,8 @@ const Map> localizedValues = { 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, 'yourBodyMassIndex': { - 'en': "Your Body Mass Index is", - 'ar': 'مؤشر كتلة جسمك هو' + 'en': "Body Mass Index is", + 'ar': 'مؤشر كتلة الجسم هو' }, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, @@ -437,6 +441,7 @@ const Map> localizedValues = { 'en': "Expected Admission Date", 'ar': 'تاريخ القبول المتوقع' }, + 'admissionDate': {'en': "Admission Date", 'ar': 'تاريخ القبول'}, // 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, 'isSickLeaveRequired': { 'en': "Is Sick Leave Required", @@ -765,7 +770,7 @@ const Map> localizedValues = { 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, "liveCare": {"en": "Live Care", "ar": "لايف كير"}, - "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "sendSuc": { @@ -779,7 +784,7 @@ const Map> localizedValues = { }, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, 'searchPatient-name': { @@ -852,4 +857,17 @@ const Map> localizedValues = { }, "updateNow": {"en": "Update Now", "ar": "تحديث الان"}, "updateTheApp": {"en": "Update The App", "ar": "تحديث التطبيق"}, + "admission-date": {"en": "Admission Date", "ar": "تاريخ القبول"}, + "noOfDays": {"en": "No of days", "ar": "عدد الأيام"}, + "numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"}, + "replayBefore": {"en": "Replay Before", "ar": "رد قبل"}, + "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, + "refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, + "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, + "didntCatch": { + "en": "Didn't catch that. Try Speaking again", + "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" + }, + "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, + "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, }; diff --git a/lib/core/enum/patient_type.dart b/lib/core/enum/patient_type.dart new file mode 100644 index 00000000..efea543c --- /dev/null +++ b/lib/core/enum/patient_type.dart @@ -0,0 +1,2 @@ +enum PatientType { inPatient, OutPatient } + diff --git a/lib/core/insurance_approval_request_model.dart b/lib/core/insurance_approval_request_model.dart new file mode 100644 index 00000000..02f71ecb --- /dev/null +++ b/lib/core/insurance_approval_request_model.dart @@ -0,0 +1,64 @@ +class InsuranceApprovalInPatientRequestModel { + int patientID; + int patientTypeID; + int eXuldAPPNO; + int projectID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + InsuranceApprovalInPatientRequestModel( + {this.patientID, + this.patientTypeID, + this.eXuldAPPNO, + this.projectID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); + + InsuranceApprovalInPatientRequestModel.fromJson(Map json) { + patientID = json['PatientID']; + patientTypeID = json['PatientTypeID']; + eXuldAPPNO = json['EXuldAPPNO']; + projectID = json['ProjectID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + data['EXuldAPPNO'] = this.eXuldAPPNO; + data['ProjectID'] = this.projectID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/core/model/DischargeReferralPatient.dart b/lib/core/model/DischargeReferralPatient.dart new file mode 100644 index 00000000..523d8d0a --- /dev/null +++ b/lib/core/model/DischargeReferralPatient.dart @@ -0,0 +1,218 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class DischargeReferralPatient { + dynamic rowID; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; + dynamic doctorNameN; + String firstName; + String middleName; + String lastName; + dynamic firstNameN; + dynamic middleNameN; + dynamic lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; + dynamic nursingStationID; + dynamic description; + String nationalityName; + dynamic nationalityNameN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + DateTime referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + String mAXResponseTime; + String dischargeDate; + dynamic clinicID; + String age; + String clinicDescription; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; + + DischargeReferralPatient( + {this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.dischargeDate, + this.clinicID, + this.age, + this.clinicDescription, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); + + DischargeReferralPatient.fromJson(Map json) { + rowID = json['RowID']; + projectID = json['ProjectID']; + lineItemNo = json['LineItemNo']; + doctorID = json['DoctorID']; + patientID = json['PatientID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + patientIdentificationNo = json['PatientIdentificationNo']; + patientType = json['PatientType']; + admissionNo = json['AdmissionNo']; + admissionDate = json['AdmissionDate']; + roomID = json['RoomID']; + bedID = json['BedID']; + nursingStationID = json['NursingStationID']; + description = json['Description']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + referralDoctor = json['ReferralDoctor']; + referringDoctor = json['ReferringDoctor']; + referralClinic = json['ReferralClinic']; + referringClinic = json['ReferringClinic']; + referralStatus = json['ReferralStatus']; + referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referringDoctorRemarks = json['ReferringDoctorRemarks']; + referredDoctorRemarks = json['ReferredDoctorRemarks']; + referralResponseOn = json['ReferralResponseOn']; + priority = json['Priority']; + frequency = json['Frequency']; + mAXResponseTime = json['MAXResponseTime']; + dischargeDate = json['DischargeDate']; + clinicID = json['ClinicID']; + age = json['Age']; + clinicDescription = json['ClinicDescription']; + frequencyDescription = json['FrequencyDescription']; + genderDescription = json['GenderDescription']; + isDoctorLate = json['IsDoctorLate']; + isDoctorResponse = json['IsDoctorResponse']; + nursingStationName = json['NursingStationName']; + priorityDescription = json['PriorityDescription']; + referringClinicDescription = json['ReferringClinicDescription']; + referringDoctorName = json['ReferringDoctorName']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['ProjectID'] = this.projectID; + data['LineItemNo'] = this.lineItemNo; + data['DoctorID'] = this.doctorID; + data['PatientID'] = this.patientID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['PatientType'] = this.patientType; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionDate'] = this.admissionDate; + data['RoomID'] = this.roomID; + data['BedID'] = this.bedID; + data['NursingStationID'] = this.nursingStationID; + data['Description'] = this.description; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['ReferralDoctor'] = this.referralDoctor; + data['ReferringDoctor'] = this.referringDoctor; + data['ReferralClinic'] = this.referralClinic; + data['ReferringClinic'] = this.referringClinic; + data['ReferralStatus'] = this.referralStatus; + data['ReferralDate'] = this.referralDate; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; + data['ReferralResponseOn'] = this.referralResponseOn; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['MAXResponseTime'] = this.mAXResponseTime; + data['DischargeDate'] = this.dischargeDate; + data['ClinicID'] = this.clinicID; + data['Age'] = this.age; + data['ClinicDescription'] = this.clinicDescription; + data['FrequencyDescription'] = this.frequencyDescription; + data['GenderDescription'] = this.genderDescription; + data['IsDoctorLate'] = this.isDoctorLate; + data['IsDoctorResponse'] = this.isDoctorResponse; + data['NursingStationName'] = this.nursingStationName; + data['PriorityDescription'] = this.priorityDescription; + data['ReferringClinicDescription'] = this.referringClinicDescription; + data['ReferringDoctorName'] = this.referringDoctorName; + return data; + } +} diff --git a/lib/core/model/MyReferralPatientModel.dart b/lib/core/model/MyReferralPatientModel.dart new file mode 100644 index 00000000..f2c9c425 --- /dev/null +++ b/lib/core/model/MyReferralPatientModel.dart @@ -0,0 +1,258 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class MyReferralPatientModel { + dynamic rowID; + int projectID; + int lineItemNo; + int doctorID; + int patientID; + String doctorName; + dynamic doctorNameN; + String firstName; + String middleName; + String lastName; + dynamic firstNameN; + dynamic middleNameN; + dynamic lastNameN; + int gender; + String dateofBirth; + String mobileNumber; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomID; + String bedID; + dynamic nursingStationID; + dynamic description; + String nationalityName; + dynamic nationalityNameN; + String clinicDescription; + String clinicDescriptionN; + int referralDoctor; + int referringDoctor; + int referralClinic; + int referringClinic; + int referralStatus; + DateTime referralDate; + String referringDoctorRemarks; + String referredDoctorRemarks; + String referralResponseOn; + int priority; + int frequency; + String mAXResponseTime; + int episodeID; + int appointmentNo; + String appointmentDate; + int appointmentType; + int patientMRN; + String createdOn; + int clinicID; + String nationalityID; + String age; + String doctorImageURL; + String frequencyDescription; + String genderDescription; + bool isDoctorLate; + bool isDoctorResponse; + String nationalityFlagURL; + String nursingStationName; + String priorityDescription; + String referringClinicDescription; + String referringDoctorName; + + MyReferralPatientModel( + {this.rowID, + this.projectID, + this.lineItemNo, + this.doctorID, + this.patientID, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomID, + this.bedID, + this.nursingStationID, + this.description, + this.nationalityName, + this.nationalityNameN, + this.clinicDescription, + this.clinicDescriptionN, + this.referralDoctor, + this.referringDoctor, + this.referralClinic, + this.referringClinic, + this.referralStatus, + this.referralDate, + this.referringDoctorRemarks, + this.referredDoctorRemarks, + this.referralResponseOn, + this.priority, + this.frequency, + this.mAXResponseTime, + this.episodeID, + this.appointmentNo, + this.appointmentDate, + this.appointmentType, + this.patientMRN, + this.createdOn, + this.clinicID, + this.nationalityID, + this.age, + this.doctorImageURL, + this.frequencyDescription, + this.genderDescription, + this.isDoctorLate, + this.isDoctorResponse, + this.nationalityFlagURL, + this.nursingStationName, + this.priorityDescription, + this.referringClinicDescription, + this.referringDoctorName}); + + MyReferralPatientModel.fromJson(Map json) { + rowID = json['RowID']; + projectID = json['ProjectID']; + lineItemNo = json['LineItemNo']; + doctorID = json['DoctorID']; + patientID = json['PatientID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + patientIdentificationNo = json['PatientIdentificationNo']; + patientType = json['PatientType']; + admissionNo = json['AdmissionNo']; + admissionDate = json['AdmissionDate']; + roomID = json['RoomID']; + bedID = json['BedID']; + nursingStationID = json['NursingStationID']; + description = json['Description']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + referralDoctor = json['ReferralDoctor']; + referringDoctor = json['ReferringDoctor']; + referralClinic = json['ReferralClinic']; + referringClinic = json['ReferringClinic']; + referralStatus = json['ReferralStatus']; + referralDate = DateUtils.convertStringToDate(json['ReferralDate']); + referringDoctorRemarks = json['ReferringDoctorRemarks']; + referredDoctorRemarks = json['ReferredDoctorRemarks']; + referralResponseOn = json['ReferralResponseOn']; + priority = json['Priority']; + frequency = json['Frequency']; + mAXResponseTime = json['MAXResponseTime']; + episodeID = json['EpisodeID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentType = json['AppointmentType']; + patientMRN = json['PatientMRN']; + createdOn = json['CreatedOn']; + clinicID = json['ClinicID']; + nationalityID = json['NationalityID']; + age = json['Age']; + doctorImageURL = json['DoctorImageURL']; + frequencyDescription = json['FrequencyDescription']; + genderDescription = json['GenderDescription']; + isDoctorLate = json['IsDoctorLate']; + isDoctorResponse = json['IsDoctorResponse']; + nationalityFlagURL = json['NationalityFlagURL']; + nursingStationName = json['NursingStationName']; + priorityDescription = json['PriorityDescription']; + referringClinicDescription = json['ReferringClinicDescription']; + referringDoctorName = json['ReferringDoctorName']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['ProjectID'] = this.projectID; + data['LineItemNo'] = this.lineItemNo; + data['DoctorID'] = this.doctorID; + data['PatientID'] = this.patientID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['PatientIdentificationNo'] = this.patientIdentificationNo; + data['PatientType'] = this.patientType; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionDate'] = this.admissionDate; + data['RoomID'] = this.roomID; + data['BedID'] = this.bedID; + data['NursingStationID'] = this.nursingStationID; + data['Description'] = this.description; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ReferralDoctor'] = this.referralDoctor; + data['ReferringDoctor'] = this.referringDoctor; + data['ReferralClinic'] = this.referralClinic; + data['ReferringClinic'] = this.referringClinic; + data['ReferralStatus'] = this.referralStatus; + data['ReferralDate'] = this.referralDate; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['ReferredDoctorRemarks'] = this.referredDoctorRemarks; + data['ReferralResponseOn'] = this.referralResponseOn; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['MAXResponseTime'] = this.mAXResponseTime; + data['EpisodeID'] = this.episodeID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentType'] = this.appointmentType; + data['PatientMRN'] = this.patientMRN; + data['CreatedOn'] = this.createdOn; + data['ClinicID'] = this.clinicID; + data['NationalityID'] = this.nationalityID; + data['Age'] = this.age; + data['DoctorImageURL'] = this.doctorImageURL; + data['FrequencyDescription'] = this.frequencyDescription; + data['GenderDescription'] = this.genderDescription; + data['IsDoctorLate'] = this.isDoctorLate; + data['IsDoctorResponse'] = this.isDoctorResponse; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NursingStationName'] = this.nursingStationName; + data['PriorityDescription'] = this.priorityDescription; + data['ReferringClinicDescription'] = this.referringClinicDescription; + data['ReferringDoctorName'] = this.referringDoctorName; + return data; + } + + get patientName { + return this.firstName+" "+this.lastName; + } +} diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart new file mode 100644 index 00000000..437c5885 --- /dev/null +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -0,0 +1,60 @@ +class PatientSearchRequestModel { + int doctorID; + String firstName; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + int patientID; + String from; + String to; + int searchType; + String mobileNo; + String identificationNo; + + PatientSearchRequestModel( + {this.doctorID =0, + this.firstName ="0", + this.middleName ="0", + this.lastName ="0", + this.patientMobileNumber ="0", + this.patientIdentificationID ="0", + this.patientID =0, + this.searchType =1, + this.mobileNo="", + this.identificationNo="0", + this.from ="0", + this.to ="0"}); + + PatientSearchRequestModel.fromJson(Map json) { + doctorID = json['DoctorID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + patientMobileNumber = json['PatientMobileNumber']; + patientIdentificationID = json['PatientIdentificationID']; + patientID = json['PatientID']; + from = json['From']; + to = json['To']; + searchType = json['SearchType']; + mobileNo = json['MobileNo']; + identificationNo = json['IdentificationNo']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientID'] = this.patientID; + data['From'] = this.from; + data['To'] = this.to; + data['SearchType'] = this.searchType; + data['MobileNo'] = this.mobileNo; + data['IdentificationNo'] = this.identificationNo; + return data; + } +} diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart new file mode 100644 index 00000000..f6e88bf7 --- /dev/null +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -0,0 +1,26 @@ +class InPatientPrescriptionRequestModel { + String vidaAuthTokenID; + dynamic patientMRN; + dynamic appNo; + dynamic admissionNo; + + InPatientPrescriptionRequestModel( + {this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); + + InPatientPrescriptionRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + patientMRN = json['PatientID']; + appNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientID'] = this.patientMRN; + data['AppointmentNo'] = this.appNo; + data['AdmissionNo'] = this.admissionNo; + + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart new file mode 100644 index 00000000..c66bc8a4 --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -0,0 +1,200 @@ +class PrescriotionInPatient { + int admissionNo; + int authorizedBy; + dynamic bedNo; + String comments; + int createdBy; + String createdByName; + dynamic createdByNameN; + String createdOn; + String direction; + int directionID; + dynamic directionN; + String dose; + int editedBy; + dynamic iVDiluentLine; + int iVDiluentType; + dynamic iVDiluentVolume; + dynamic iVRate; + dynamic iVStability; + String itemDescription; + int itemID; + int lineItemNo; + int locationId; + int noOfDoses; + int orderNo; + int patientID; + String pharmacyRemarks; + String prescriptionDatetime; + int prescriptionNo; + String processedBy; + int projectID; + int refillID; + String refillType; + dynamic refillTypeN; + int reviewedPharmacist; + dynamic roomId; + String route; + int routeId; + dynamic routeN; + dynamic setupID; + String startDatetime; + int status; + String statusDescription; + dynamic statusDescriptionN; + String stopDatetime; + int unitofMeasurement; + String unitofMeasurementDescription; + dynamic unitofMeasurementDescriptionN; + + PrescriotionInPatient( + {this.admissionNo, + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); + + PrescriotionInPatient.fromJson(Map json) { + admissionNo = json['AdmissionNo']; + authorizedBy = json['AuthorizedBy']; + bedNo = json['BedNo']; + comments = json['Comments']; + createdBy = json['CreatedBy']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + createdOn = json['CreatedOn']; + direction = json['Direction']; + directionID = json['DirectionID']; + directionN = json['DirectionN']; + dose = json['Dose']; + editedBy = json['EditedBy']; + iVDiluentLine = json['IVDiluentLine']; + iVDiluentType = json['IVDiluentType']; + iVDiluentVolume = json['IVDiluentVolume']; + iVRate = json['IVRate']; + iVStability = json['IVStability']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + lineItemNo = json['LineItemNo']; + locationId = json['LocationId']; + noOfDoses = json['NoOfDoses']; + orderNo = json['OrderNo']; + patientID = json['PatientID']; + pharmacyRemarks = json['PharmacyRemarks']; + prescriptionDatetime = json['PrescriptionDatetime']; + prescriptionNo = json['PrescriptionNo']; + processedBy = json['ProcessedBy']; + projectID = json['ProjectID']; + refillID = json['RefillID']; + refillType = json['RefillType']; + refillTypeN = json['RefillTypeN']; + reviewedPharmacist = json['ReviewedPharmacist']; + roomId = json['RoomId']; + route = json['Route']; + routeId = json['RouteId']; + routeN = json['RouteN']; + setupID = json['SetupID']; + startDatetime = json['StartDatetime']; + status = json['Status']; + statusDescription = json['StatusDescription']; + statusDescriptionN = json['StatusDescriptionN']; + stopDatetime = json['StopDatetime']; + unitofMeasurement = json['UnitofMeasurement']; + unitofMeasurementDescription = json['UnitofMeasurementDescription']; + unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionNo'] = this.admissionNo; + data['AuthorizedBy'] = this.authorizedBy; + data['BedNo'] = this.bedNo; + data['Comments'] = this.comments; + data['CreatedBy'] = this.createdBy; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['CreatedOn'] = this.createdOn; + data['Direction'] = this.direction; + data['DirectionID'] = this.directionID; + data['DirectionN'] = this.directionN; + data['Dose'] = this.dose; + data['EditedBy'] = this.editedBy; + data['IVDiluentLine'] = this.iVDiluentLine; + data['IVDiluentType'] = this.iVDiluentType; + data['IVDiluentVolume'] = this.iVDiluentVolume; + data['IVRate'] = this.iVRate; + data['IVStability'] = this.iVStability; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['LineItemNo'] = this.lineItemNo; + data['LocationId'] = this.locationId; + data['NoOfDoses'] = this.noOfDoses; + data['OrderNo'] = this.orderNo; + data['PatientID'] = this.patientID; + data['PharmacyRemarks'] = this.pharmacyRemarks; + data['PrescriptionDatetime'] = this.prescriptionDatetime; + data['PrescriptionNo'] = this.prescriptionNo; + data['ProcessedBy'] = this.processedBy; + data['ProjectID'] = this.projectID; + data['RefillID'] = this.refillID; + data['RefillType'] = this.refillType; + data['RefillTypeN'] = this.refillTypeN; + data['ReviewedPharmacist'] = this.reviewedPharmacist; + data['RoomId'] = this.roomId; + data['Route'] = this.route; + data['RouteId'] = this.routeId; + data['RouteN'] = this.routeN; + data['SetupID'] = this.setupID; + data['StartDatetime'] = this.startDatetime; + data['Status'] = this.status; + data['StatusDescription'] = this.statusDescription; + data['StatusDescriptionN'] = this.statusDescriptionN; + data['StopDatetime'] = this.stopDatetime; + data['UnitofMeasurement'] = this.unitofMeasurement; + data['UnitofMeasurementDescription'] = this.unitofMeasurementDescription; + data['UnitofMeasurementDescriptionN'] = this.unitofMeasurementDescriptionN; + return data; + } +} diff --git a/lib/core/model/ReferralRequest.dart b/lib/core/model/ReferralRequest.dart new file mode 100644 index 00000000..b3ad1f03 --- /dev/null +++ b/lib/core/model/ReferralRequest.dart @@ -0,0 +1,108 @@ +class ReferralRequest { + String roomID; + String referralClinic; + String referralDoctor; + int createdBy; + int editedBy; + int patientID; + int patientTypeID; + int referringClinic; + int referringDoctor; + int projectID; + int admissionNo; + String referringDoctorRemarks; + String priority; + String frequency; + String extension; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + ReferralRequest( + {this.roomID, + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); + + ReferralRequest.fromJson(Map json) { + roomID = json['RoomID']; + referralClinic = json['ReferralClinic']; + referralDoctor = json['ReferralDoctor']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + patientID = json['PatientID']; + patientTypeID = json['PatientTypeID']; + referringClinic = json['ReferringClinic']; + referringDoctor = json['ReferringDoctor']; + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + referringDoctorRemarks = json['ReferringDoctorRemarks']; + priority = json['Priority']; + frequency = json['Frequency']; + extension = json['Extension']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['RoomID'] = this.roomID; + data['ReferralClinic'] = this.referralClinic; + data['ReferralDoctor'] = this.referralDoctor; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + data['ReferringClinic'] = this.referringClinic; + data['ReferringDoctor'] = this.referringDoctor; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['Extension'] = this.extension; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/core/model/insurance_approval_in_patient_model.dart b/lib/core/model/insurance_approval_in_patient_model.dart new file mode 100644 index 00000000..f185a8bf --- /dev/null +++ b/lib/core/model/insurance_approval_in_patient_model.dart @@ -0,0 +1,277 @@ +class InsuranceApprovalInPatientModel { + String setupID; + int projectID; + int approvalNo; + int status; + String approvalDate; + int patientType; + int patientID; + int companyID; + bool subCategoryID; + int doctorID; + int clinicID; + int approvalType; + int inpatientApprovalSubType; + dynamic isApprovalOnGross; + String companyApprovalNo; + dynamic progNoteOrderNo; + String submitOn; + String receiptOn; + String expiryDate; + int admissionNo; + int admissionRequestNo; + String approvalStatusDescption; + dynamic approvalStatusDescptionN; + dynamic remarks; + List apporvalDetails; + String clinicName; + dynamic companyName; + String doctorName; + String projectName; + int totaUnUsedCount; + int unUsedCount; + String doctorImage; + + InsuranceApprovalInPatientModel( + {this.setupID, + this.projectID, + this.approvalNo, + this.status, + this.approvalDate, + this.patientType, + this.patientID, + this.companyID, + this.subCategoryID, + this.doctorID, + this.clinicID, + this.approvalType, + this.inpatientApprovalSubType, + this.isApprovalOnGross, + this.companyApprovalNo, + this.progNoteOrderNo, + this.submitOn, + this.receiptOn, + this.expiryDate, + this.admissionNo, + this.admissionRequestNo, + this.approvalStatusDescption, + this.approvalStatusDescptionN, + this.remarks, + this.apporvalDetails, + this.clinicName, + this.companyName, + this.doctorName, + this.projectName, + this.totaUnUsedCount, + this.unUsedCount, + this.doctorImage}); + + InsuranceApprovalInPatientModel.fromJson(Map json) { + setupID = json['SetupID']; + doctorImage = json['DoctorImageURL']; + projectID = json['ProjectID']; + approvalNo = json['ApprovalNo']; + status = json['Status']; + approvalDate = json['ApprovalDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + companyID = json['CompanyID']; + subCategoryID = json['SubCategoryID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + approvalType = json['ApprovalType']; + inpatientApprovalSubType = json['InpatientApprovalSubType']; + isApprovalOnGross = json['IsApprovalOnGross']; + companyApprovalNo = json['CompanyApprovalNo']; + progNoteOrderNo = json['ProgNoteOrderNo']; + submitOn = json['SubmitOn']; + receiptOn = json['ReceiptOn']; + expiryDate = json['ExpiryDate']; + admissionNo = json['AdmissionNo']; + admissionRequestNo = json['AdmissionRequestNo']; + approvalStatusDescption = json['ApprovalStatusDescption']; + approvalStatusDescptionN = json['ApprovalStatusDescptionN']; + remarks = json['Remarks']; + if (json['ApporvalDetails'] != null) { + apporvalDetails = new List(); + json['ApporvalDetails'].forEach((v) { + apporvalDetails.add(new ApporvalDetails.fromJson(v)); + }); + } + clinicName = json['ClinicName']; + companyName = json['CompanyName']; + doctorName = json['DoctorName']; + projectName = json['ProjectName']; + totaUnUsedCount = json['TotaUnUsedCount']; + unUsedCount = json['UnUsedCount']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['DoctorImageURL'] = this.doctorImage; + data['ProjectID'] = this.projectID; + data['ApprovalNo'] = this.approvalNo; + data['Status'] = this.status; + data['ApprovalDate'] = this.approvalDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['CompanyID'] = this.companyID; + data['SubCategoryID'] = this.subCategoryID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['ApprovalType'] = this.approvalType; + data['InpatientApprovalSubType'] = this.inpatientApprovalSubType; + data['IsApprovalOnGross'] = this.isApprovalOnGross; + data['CompanyApprovalNo'] = this.companyApprovalNo; + data['ProgNoteOrderNo'] = this.progNoteOrderNo; + data['SubmitOn'] = this.submitOn; + data['ReceiptOn'] = this.receiptOn; + data['ExpiryDate'] = this.expiryDate; + data['AdmissionNo'] = this.admissionNo; + data['AdmissionRequestNo'] = this.admissionRequestNo; + data['ApprovalStatusDescption'] = this.approvalStatusDescption; + data['ApprovalStatusDescptionN'] = this.approvalStatusDescptionN; + data['Remarks'] = this.remarks; + if (this.apporvalDetails != null) { + data['ApporvalDetails'] = + this.apporvalDetails.map((v) => v.toJson()).toList(); + } + data['ClinicName'] = this.clinicName; + data['CompanyName'] = this.companyName; + data['DoctorName'] = this.doctorName; + data['ProjectName'] = this.projectName; + data['TotaUnUsedCount'] = this.totaUnUsedCount; + data['UnUsedCount'] = this.unUsedCount; + return data; + } +} + +class ApporvalDetails { + Null setupID; + Null projectID; + int approvalNo; + Null lineItemNo; + Null orderType; + Null procedureID; + Null toothNo; + Null price; + Null approvedAmount; + Null unapprovedPatientShare; + Null waivedAmount; + Null discountType; + Null discountValue; + Null shareType; + Null patientShareTypeValue; + Null companyShareTypeValue; + Null patientShare; + Null companyShare; + Null deductableAmount; + String disapprovedRemarks; + Null progNoteOrderNo; + Null progNoteLineItemNo; + Null invoiceTransactionType; + Null invoiceNo; + String procedureName; + String procedureNameN; + String status; + Null isInvoiced; + String isInvoicedDesc; + + ApporvalDetails( + {this.setupID, + this.projectID, + this.approvalNo, + this.lineItemNo, + this.orderType, + this.procedureID, + this.toothNo, + this.price, + this.approvedAmount, + this.unapprovedPatientShare, + this.waivedAmount, + this.discountType, + this.discountValue, + this.shareType, + this.patientShareTypeValue, + this.companyShareTypeValue, + this.patientShare, + this.companyShare, + this.deductableAmount, + this.disapprovedRemarks, + this.progNoteOrderNo, + this.progNoteLineItemNo, + this.invoiceTransactionType, + this.invoiceNo, + this.procedureName, + this.procedureNameN, + this.status, + this.isInvoiced, + this.isInvoicedDesc}); + + ApporvalDetails.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + approvalNo = json['ApprovalNo']; + lineItemNo = json['LineItemNo']; + orderType = json['OrderType']; + procedureID = json['ProcedureID']; + toothNo = json['ToothNo']; + price = json['Price']; + approvedAmount = json['ApprovedAmount']; + unapprovedPatientShare = json['UnapprovedPatientShare']; + waivedAmount = json['WaivedAmount']; + discountType = json['DiscountType']; + discountValue = json['DiscountValue']; + shareType = json['ShareType']; + patientShareTypeValue = json['PatientShareTypeValue']; + companyShareTypeValue = json['CompanyShareTypeValue']; + patientShare = json['PatientShare']; + companyShare = json['CompanyShare']; + deductableAmount = json['DeductableAmount']; + disapprovedRemarks = json['DisapprovedRemarks']; + progNoteOrderNo = json['ProgNoteOrderNo']; + progNoteLineItemNo = json['ProgNoteLineItemNo']; + invoiceTransactionType = json['InvoiceTransactionType']; + invoiceNo = json['InvoiceNo']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + status = json['Status']; + isInvoiced = json['IsInvoiced']; + isInvoicedDesc = json['IsInvoicedDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ApprovalNo'] = this.approvalNo; + data['LineItemNo'] = this.lineItemNo; + data['OrderType'] = this.orderType; + data['ProcedureID'] = this.procedureID; + data['ToothNo'] = this.toothNo; + data['Price'] = this.price; + data['ApprovedAmount'] = this.approvedAmount; + data['UnapprovedPatientShare'] = this.unapprovedPatientShare; + data['WaivedAmount'] = this.waivedAmount; + data['DiscountType'] = this.discountType; + data['DiscountValue'] = this.discountValue; + data['ShareType'] = this.shareType; + data['PatientShareTypeValue'] = this.patientShareTypeValue; + data['CompanyShareTypeValue'] = this.companyShareTypeValue; + data['PatientShare'] = this.patientShare; + data['CompanyShare'] = this.companyShare; + data['DeductableAmount'] = this.deductableAmount; + data['DisapprovedRemarks'] = this.disapprovedRemarks; + data['ProgNoteOrderNo'] = this.progNoteOrderNo; + data['ProgNoteLineItemNo'] = this.progNoteLineItemNo; + data['InvoiceTransactionType'] = this.invoiceTransactionType; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['Status'] = this.status; + data['IsInvoiced'] = this.isInvoiced; + data['IsInvoicedDesc'] = this.isInvoicedDesc; + return data; + } +} diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 2deb13f3..1c09696b 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -47,10 +47,10 @@ class LabResult { lineItemNo = json['LineItemNo']; maleInterpretativeData = json['MaleInterpretativeData']; notes = json['Notes']; - packageID = json['PackageID']; + packageID = json['PackageID'].toString(); patientID = json['PatientID']; - projectID = json['ProjectID']; - referanceRange = json['ReferanceRange']; + projectID = json['ProjectID'].toString(); + referanceRange = json['ReferenceRange'] ?? json['ReferanceRange']; resultValue = json['ResultValue']; sampleCollectedOn = json['SampleCollectedOn']; sampleReceivedOn = json['SampleReceivedOn']; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 07044b0e..6f989543 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -72,7 +72,7 @@ class PatientLabOrders { PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; + clinicDescription = json['ClinicDescription']?? json['ClinicName']; clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; clinicDescriptionN = json['ClinicDescriptionN']; clinicID = json['ClinicID']; @@ -85,7 +85,7 @@ class PatientLabOrders { doctorTitle = json['DoctorTitle']; gender = json['Gender']; genderDescription = json['GenderDescription']; - invoiceNo = json['InvoiceNo']; + invoiceNo = json['InvoiceNo'].toString(); isActiveDoctorProfile = json['IsActiveDoctorProfile']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isExecludeDoctor = json['IsExecludeDoctor']; @@ -96,9 +96,9 @@ class PatientLabOrders { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; orderDate = DateUtils.convertStringToDate(json['OrderDate']); - orderNo = json['OrderNo']; - patientID = json['PatientID']; - projectID = json['ProjectID']; + orderNo = json['OrderNo'].toString(); + patientID = json['PatientID'].toString(); + projectID = json['ProjectID'].toString(); projectName = json['ProjectName']; projectNameN = json['ProjectNameN']; qR = json['QR']; diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index bdeb3930..b48cf0e1 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -65,7 +65,7 @@ class RequestPatientLabSpecialResult { data['OrderNo'] = this.orderNo; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; - data['ClinicID'] = this.clinicID; + data['ClinicID'] = this.clinicID ?? 0; data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart new file mode 100644 index 00000000..ce076705 --- /dev/null +++ b/lib/core/model/note/CreateNoteModel.dart @@ -0,0 +1,88 @@ +class CreateNoteModel { + int visitType; + int admissionNo; + int projectID; + int patientTypeID; + int patientID; + int clinicID; + String notes; + int createdBy; + int editedBy; + String nursingRemarks; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + CreateNoteModel( + {this.visitType, + this.admissionNo, + this.projectID, + this.patientTypeID, + this.patientID, + this.clinicID, + this.notes, + this.createdBy, + this.editedBy, + this.nursingRemarks, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); + + CreateNoteModel.fromJson(Map json) { + visitType = json['VisitType']; + admissionNo = json['AdmissionNo']; + projectID = json['ProjectID']; + patientTypeID = json['PatientTypeID']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + notes = json['Notes']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + nursingRemarks = json['NursingRemarks']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['VisitType'] = this.visitType; + data['AdmissionNo'] = this.admissionNo; + data['ProjectID'] = this.projectID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['Notes'] = this.notes; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['NursingRemarks'] = this.nursingRemarks; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart new file mode 100644 index 00000000..797f9b6d --- /dev/null +++ b/lib/core/model/note/note_model.dart @@ -0,0 +1,92 @@ +class NoteModel { + String setupID; + int projectID; + int patientID; + int patientType; + String admissionNo; + int lineItemNo; + int visitType; + String notes; + String assessmentDate; + String visitTime; + int status; + String nursingRemarks; + String createdOn; + String editedOn; + int createdBy; + int admissionClinicID; + String admissionClinicName; + Null doctorClinicName; + String doctorName; + String visitTypeDesc; + + NoteModel( + {this.setupID, + this.projectID, + this.patientID, + this.patientType, + this.admissionNo, + this.lineItemNo, + this.visitType, + this.notes, + this.assessmentDate, + this.visitTime, + this.status, + this.nursingRemarks, + this.createdOn, + this.editedOn, + this.createdBy, + this.admissionClinicID, + this.admissionClinicName, + this.doctorClinicName, + this.doctorName, + this.visitTypeDesc}); + + NoteModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + admissionNo = json['AdmissionNo']; + lineItemNo = json['LineItemNo']; + visitType = json['VisitType']; + notes = json['Notes']; + assessmentDate = json['AssessmentDate']; + visitTime = json['VisitTime']; + status = json['Status']; + nursingRemarks = json['NursingRemarks']; + createdOn = json['CreatedOn']; + editedOn = json['EditedOn']; + createdBy = json['CreatedBy']; + admissionClinicID = json['AdmissionClinicID']; + admissionClinicName = json['AdmissionClinicName']; + doctorClinicName = json['DoctorClinicName']; + doctorName = json['DoctorName']; + visitTypeDesc = json['VisitTypeDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['AdmissionNo'] = this.admissionNo; + data['LineItemNo'] = this.lineItemNo; + data['VisitType'] = this.visitType; + data['Notes'] = this.notes; + data['AssessmentDate'] = this.assessmentDate; + data['VisitTime'] = this.visitTime; + data['Status'] = this.status; + data['NursingRemarks'] = this.nursingRemarks; + data['CreatedOn'] = this.createdOn; + data['EditedOn'] = this.editedOn; + data['CreatedBy'] = this.createdBy; + data['AdmissionClinicID'] = this.admissionClinicID; + data['AdmissionClinicName'] = this.admissionClinicName; + data['DoctorClinicName'] = this.doctorClinicName; + data['DoctorName'] = this.doctorName; + data['VisitTypeDesc'] = this.visitTypeDesc; + return data; + } +} diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart new file mode 100644 index 00000000..20fd4b86 --- /dev/null +++ b/lib/core/model/note/update_note_model.dart @@ -0,0 +1,80 @@ +class UpdateNoteReqModel { + int projectID; + int createdBy; + int admissionNo; + int lineItemNo; + String notes; + bool verifiedNote; + bool cancelledNote; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + UpdateNoteReqModel( + {this.projectID, + this.createdBy, + this.admissionNo, + this.lineItemNo, + this.notes, + this.verifiedNote, + this.cancelledNote, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.patientTypeID}); + + UpdateNoteReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + createdBy = json['CreatedBy']; + admissionNo = json['AdmissionNo']; + lineItemNo = json['LineItemNo']; + notes = json['Notes']; + verifiedNote = json['VerifiedNote']; + cancelledNote = json['CancelledNote']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['CreatedBy'] = this.createdBy; + data['AdmissionNo'] = this.admissionNo; + data['LineItemNo'] = this.lineItemNo; + data['Notes'] = this.notes; + data['VerifiedNote'] = this.verifiedNote; + data['CancelledNote'] = this.cancelledNote; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + return data; + } +} diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/prescription_req_model.dart index 3eb71072..a45878d8 100644 --- a/lib/core/model/prescription_req_model.dart +++ b/lib/core/model/prescription_req_model.dart @@ -2,13 +2,16 @@ class PrescriptionReqModel { String vidaAuthTokenID; dynamic patientMRN; dynamic appNo; + dynamic admissionNo; - PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN, this.appNo}); + PrescriptionReqModel( + {this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); PrescriptionReqModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; appNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; } Map toJson() { @@ -16,6 +19,8 @@ class PrescriptionReqModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appNo; + data['AdmissionNo'] = this.admissionNo; + return data; } } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 66433091..fdccf5f5 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -1,47 +1,48 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; class FinalRadiology { - String setupID; - int projectID; - Null patientID; - int invoiceLineItemNo; - int invoiceNo; - int doctorID; - int clinicID; + dynamic setupID; + dynamic projectID; + dynamic patientID; + dynamic invoiceLineItemNo; + dynamic invoiceNo; + dynamic doctorID; + dynamic clinicID; DateTime orderDate; - String reportData; - String imageURL; - String procedureID; - int appointmentNo; - Null dIAPacsURL; + DateTime reportDate; + dynamic reportData; + dynamic imageURL; + dynamic procedureID; + dynamic appodynamicmentNo; + dynamic dIAPacsURL; bool isRead; - String readOn; + dynamic readOn; var admissionNo; bool isInOutPatient; - int actualDoctorRate; - String clinicDescription; - String dIAPACSURL; - String doctorImageURL; - String doctorName; - int doctorRate; - String doctorTitle; - int gender; - String genderDescription; + dynamic actualDoctorRate; + dynamic clinicDescription; + dynamic dIAPACSURL; + dynamic doctorImageURL; + dynamic doctorName; + dynamic doctorRate; + dynamic doctorTitle; + dynamic gender; + dynamic genderDescription; bool isActiveDoctorProfile; bool isExecludeDoctor; - String isInOutPatientDescription; - String isInOutPatientDescriptionN; - String nationalityFlagURL; - int noOfPatientsRate; - int orderNo; - String projectName; - String qR; - String reportDataHTML; - String reportDataTextString; - List speciality; + dynamic isInOutPatientDescription; + dynamic isInOutPatientDescriptionN; + dynamic nationalityFlagURL; + dynamic noOfPatientsRate; + dynamic orderNo; + dynamic projectName; + dynamic qR; + dynamic reportDataHTML; + dynamic reportDataTextdynamic; + List speciality; bool isCVI; bool isRadMedicalReport; - bool isLiveCareAppointment; + bool isLiveCareAppodynamicment; FinalRadiology( {this.setupID, @@ -52,10 +53,11 @@ class FinalRadiology { this.doctorID, this.clinicID, this.orderDate, + this.reportDate, this.reportData, this.imageURL, this.procedureID, - this.appointmentNo, + this.appodynamicmentNo, this.dIAPacsURL, this.isRead, this.readOn, @@ -80,12 +82,12 @@ class FinalRadiology { this.projectName, this.qR, this.reportDataHTML, - this.reportDataTextString, + this.reportDataTextdynamic, this.speciality, this.isCVI, - this.isRadMedicalReport,this.isLiveCareAppointment}); + this.isRadMedicalReport,this.isLiveCareAppodynamicment}); - FinalRadiology.fromJson(Map json) { + FinalRadiology.fromJson(Map json) { try { setupID = json['SetupID']; projectID = json['ProjectID']; @@ -95,17 +97,18 @@ class FinalRadiology { doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = DateUtils.convertStringToDate(json['OrderDate']); + reportDate = DateUtils.convertStringToDate(json['ReportDate']); reportData = json['ReportData']; imageURL = json['ImageURL']; procedureID = json['ProcedureID']; - appointmentNo = json['AppointmentNo']; + appodynamicmentNo = json['AppodynamicmentNo']; dIAPacsURL = json['DIAPacsURL']; isRead = json['IsRead']; readOn = json['ReadOn']; admissionNo = json['AdmissionNo']; isInOutPatient = json['IsInOutPatient']; actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; + clinicDescription = json['ClinicDescription']?? json['ClinicName']; dIAPACSURL = json['DIA_PACS_URL']; doctorImageURL = json['DoctorImageURL']; doctorName = json['DoctorName']; @@ -122,20 +125,21 @@ class FinalRadiology { orderNo = json['OrderNo']; projectName = json['ProjectName']; qR = json['QR']; - isLiveCareAppointment = json['IsLiveCareAppointment']; + isLiveCareAppodynamicment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; - reportDataTextString = json['ReportDataTextString']; - // speciality = json['Speciality'].cast(); + reportDataTextdynamic = json['ReportDataTextdynamic']; + // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; } catch (e) { print(e); + } } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; @@ -147,7 +151,7 @@ class FinalRadiology { data['ReportData'] = this.reportData; data['ImageURL'] = this.imageURL; data['ProcedureID'] = this.procedureID; - data['AppointmentNo'] = this.appointmentNo; + data['AppodynamicmentNo'] = this.appodynamicmentNo; data['DIAPacsURL'] = this.dIAPacsURL; data['IsRead'] = this.isRead; data['ReadOn'] = this.readOn; @@ -172,7 +176,7 @@ class FinalRadiology { data['ProjectName'] = this.projectName; data['QR'] = this.qR; data['ReportDataHTML'] = this.reportDataHTML; - data['ReportDataTextString'] = this.reportDataTextString; + data['ReportDataTextdynamic'] = this.reportDataTextdynamic; data['Speciality'] = this.speciality; data['isCVI'] = this.isCVI; data['isRadMedicalReport'] = this.isRadMedicalReport; @@ -181,7 +185,7 @@ class FinalRadiology { } class FinalRadiologyList { - String filterName = ""; + dynamic filterName = ""; List finalRadiologyList = List(); FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { diff --git a/lib/core/model/sick_leave_patient_model.dart b/lib/core/model/sick_leave_patient_model.dart new file mode 100644 index 00000000..3c78f1ff --- /dev/null +++ b/lib/core/model/sick_leave_patient_model.dart @@ -0,0 +1,156 @@ +import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; + +class SickLeavePatientModel { + String setupID; + int projectID; + int patientID; + int patientType; + int clinicID; + int doctorID; + int requestNo; + String requestDate; + int sickLeaveDays; + int appointmentNo; + int admissionNo; + int actualDoctorRate; + String appointmentDate; + String clinicName; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isLiveCareAppointment; + int noOfPatientsRate; + dynamic patientName; + String projectName; + String qR; + // List speciality; + String strRequestDate; + String startDate; + String endDate; + + SickLeavePatientModel( + {this.setupID, + this.projectID, + this.patientID, + this.patientType, + this.clinicID, + this.doctorID, + this.requestNo, + this.requestDate, + this.sickLeaveDays, + this.appointmentNo, + this.admissionNo, + this.actualDoctorRate, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isLiveCareAppointment, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + // this.speciality, + this.strRequestDate, + this.startDate, + this.endDate}); + + SickLeavePatientModel.fromJson(Map json) { + setupID = json['SetupID']; + + projectID = json['ProjectID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + requestNo = json['RequestNo']; + requestDate = json['RequestDate']; + sickLeaveDays = json['SickLeaveDays']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + actualDoctorRate = json['ActualDoctorRate']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + // speciality = json['Speciality'].cast(); + strRequestDate = json['StrRequestDate']; + startDate = json['StartDate']; + endDate = json['EndDate']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['RequestNo'] = this.requestNo; + data['RequestDate'] = this.requestDate; + data['SickLeaveDays'] = this.sickLeaveDays; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + // data['Speciality'] = this.speciality; + data['StrRequestDate'] = this.strRequestDate; + data['StartDate'] = this.startDate; + data['EndDate'] = this.endDate; + return data; + } +} diff --git a/lib/core/model/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave_patient_request_model.dart new file mode 100644 index 00000000..ec588316 --- /dev/null +++ b/lib/core/model/sick_leave_patient_request_model.dart @@ -0,0 +1,60 @@ +class SickLeavePatientRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + int deviceTypeID; + int patientType; + int patientTypeID; + String tokenID; + int patientID; + String sessionID; + + SickLeavePatientRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.deviceTypeID, + this.patientType, + this.patientTypeID, + this.tokenID, + this.patientID, + this.sessionID}); + + SickLeavePatientRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + deviceTypeID = json['DeviceTypeID']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + sessionID = json['SessionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['SessionID'] = this.sessionID; + return data; + } +} diff --git a/lib/core/provider/robot_provider.dart b/lib/core/provider/robot_provider.dart new file mode 100644 index 00000000..a01b1318 --- /dev/null +++ b/lib/core/provider/robot_provider.dart @@ -0,0 +1,25 @@ +import 'dart:async'; + +class RobotProvider { + static final RobotProvider _singleton = RobotProvider._internal(); + var value; + StreamController controller = StreamController.broadcast(); + + getData() { + // return data; + } + intStream() { + controller.add({}); + } + + setValue(Map data) { + value = data; + controller.add(value); + } + + factory RobotProvider() { + return _singleton; + } + + RobotProvider._internal(); +} diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart new file mode 100644 index 00000000..2d43afc6 --- /dev/null +++ b/lib/core/service/DischargedPatientService.dart @@ -0,0 +1,76 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class DischargedPatientService extends BaseService { + List myDischargedPatients = List(); + + List myDischargeReferralPatients = List(); + + Future getDischargedPatient() async { + hasError = false; + Map body = Map(); + await getDoctorProfile(isGetProfile: true); + body['DoctorID'] = doctorProfile.doctorID; + body['FirstName'] = "0"; + body['MiddleName'] = "0"; + body['LastName'] = "0"; + body['PatientMobileNumber'] = "0"; + body['PatientIdentificationID'] = "0"; + body['PatientID'] = 0; + body['From'] = "0"; + body['To'] = "0"; + body['stamp'] = DateTime.now().toIso8601String(); + body['IsLoginForDoctorApp'] = true; + body['IPAdress'] = "11.11.11.11"; + body['PatientOutSA'] = false; + body['PatientTypeID'] = 1; + hasError = false; + myDischargedPatients.clear(); + await baseAppClient.post(GET_DISCHARGE_PATIENT, + onSuccess: (dynamic response, int statusCode) { + if (response['List_MyDischargePatient'] != null) { + response['List_MyDischargePatient'].forEach((v) { + myDischargedPatients.add(PatiantInformtion.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future gtMyDischargeReferralPatient() async { + hasError = false; + Map body = Map(); + await getDoctorProfile(); + body['DoctorID'] = doctorProfile.doctorID; + body['FirstName'] = "0"; + body['MiddleName'] = "0"; + body['LastName'] = "0"; + body['PatientMobileNumber'] = "0"; + body['PatientIdentificationID'] = "0"; + body['PatientID'] = 0; + body['From'] = "0"; + body['To'] = "0"; + body['stamp'] = DateTime.now().toIso8601String(); + body['IsLoginForDoctorApp'] = true; + body['IPAdress'] = "11.11.11.11"; + body['PatientOutSA'] = false; + body['PatientTypeID'] = 1; + hasError = false; + myDischargeReferralPatients.clear(); + await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, + onSuccess: (dynamic response, int statusCode) { + if (response['List_MyDischargeReferralPatient'] != null) { + response['List_MyDischargeReferralPatient'].forEach((v) { + myDischargeReferralPatients.add(DischargeReferralPatient.fromJson(v)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/InsuranceCardService.dart b/lib/core/service/InsuranceCardService.dart index de7ee433..b736c34f 100644 --- a/lib/core/service/InsuranceCardService.dart +++ b/lib/core/service/InsuranceCardService.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/insurance_approval_request_model.dart'; import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; +import 'package:doctor_app_flutter/core/model/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'; @@ -10,27 +12,55 @@ class InsuranceCardService extends BaseService { patientType: 1, eXuldAPPNO: 0, projectID: 0); + InsuranceApprovalInPatientRequestModel + _insuranceApprovalInPatientRequestModel = + InsuranceApprovalInPatientRequestModel(); List _insuranceApproval = List(); - List get insuranceApproval => _insuranceApproval; - Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo , int projectId}) async { + List _insuranceApprovalInPatient = List(); + List get insuranceApprovalInPatient => + _insuranceApprovalInPatient; + + Future getInsuranceApprovalInPatient({int mrn}) async { + _insuranceApprovalInPatientRequestModel = + InsuranceApprovalInPatientRequestModel( + patientID: mrn, + patientTypeID: 1, + ); + hasError = false; + insuranceApprovalInPatient.clear(); + + await baseAppClient.post(GET_INSURANCE_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { + //prescriptionsList.clear(); + response['List_ApprovalMain_InPatient'].forEach((prescriptions) { + insuranceApprovalInPatient + .add(InsuranceApprovalInPatientModel.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _insuranceApprovalInPatientRequestModel.toJson()); + } + + Future getInsuranceApproval(PatiantInformtion patient, + {int appointmentNo, int projectId}) async { hasError = false; // _cardList.clear(); - // if (appointmentNo != null) { - // _insuranceApprovalModel.appointmentNo = appointmentNo; - // _insuranceApprovalModel.eXuldAPPNO = null; + // if (appointmentNo != null) { + // _insuranceApprovalModel.appointmentNo = appointmentNo; + // _insuranceApprovalModel.eXuldAPPNO = null; // _insuranceApprovalModel.projectID = projectId; - // } else { - _insuranceApprovalModel.appointmentNo = null; - _insuranceApprovalModel.eXuldAPPNO = 0; - _insuranceApprovalModel.projectID = 0; - // } + // } else { + _insuranceApprovalModel.appointmentNo = null; + _insuranceApprovalModel.eXuldAPPNO = 0; + _insuranceApprovalModel.projectID = 0; + // } await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { print(response['HIS_Approval_List'].length); _insuranceApproval.clear(); _insuranceApproval.length = 0; diff --git a/lib/core/service/MyReferralPatientService.dart b/lib/core/service/MyReferralPatientService.dart new file mode 100644 index 00000000..f58cea48 --- /dev/null +++ b/lib/core/service/MyReferralPatientService.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.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'; + +class MyReferralInPatientService extends BaseService { + List myReferralPatients = List(); + + Future getMyReferralPatientService() async { + hasError = false; + Map body = Map(); + await getDoctorProfile(); + body['DoctorID'] = doctorProfile.doctorID; + body['FirstName'] = "0"; + body['MiddleName'] = "0"; + body['LastName'] = "0"; + body['PatientMobileNumber'] = "0"; + body['PatientIdentificationID'] = "0"; + body['PatientID'] = 0; + body['From'] = "0"; + body['To'] = "0"; + body['stamp'] = DateTime.now().toIso8601String(); + body['IsLoginForDoctorApp'] = true; + body['IPAdress'] = "11.11.11.11"; + body['PatientOutSA'] = false; + body['PatientTypeID'] = 1; + myReferralPatients.clear(); + await baseAppClient.post( + GET_MY_REFERRAL_INPATIENT, + onSuccess: (dynamic response, int statusCode) { + if (response['List_MyReferralPatient'] != null) { + response['List_MyReferralPatient'].forEach((v) { + myReferralPatients.add(MyReferralPatientModel.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async { + hasError = false; + await getDoctorProfile(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); + _requestAddReferredDoctorRemarks.projectID = referral.projectID; + _requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString(); + _requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks; + _requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID; + _requestAddReferredDoctorRemarks.patientID = referral.patientID; + _requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor; + await baseAppClient.post( + ADD_REFERRED_DOCTOR_REMARKS, + body: _requestAddReferredDoctorRemarks.toJson(), + onSuccess: (dynamic body, int statusCode) { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } +} diff --git a/lib/core/service/ReferralService.dart b/lib/core/service/ReferralService.dart new file mode 100644 index 00000000..2887abde --- /dev/null +++ b/lib/core/service/ReferralService.dart @@ -0,0 +1,46 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/ReferralRequest.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class ReferralService extends BaseService { + + Future referralPatient( + {int admissionNo, + String roomID, + int referralClinic, + int referralDoctor, + int patientID, + int patientTypeID, + int priority, + int frequency, + String referringDoctorRemarks, + String extension}) async { + await getDoctorProfile(); + ReferralRequest referralRequest = ReferralRequest(); + referralRequest.admissionNo = admissionNo; + referralRequest.roomID = roomID; + referralRequest.referralClinic = referralClinic.toString(); + referralRequest.referralDoctor = referralDoctor.toString(); + referralRequest.patientID = patientID; + referralRequest.patientTypeID = patientTypeID; + referralRequest.priority = priority.toString(); + referralRequest.frequency = frequency.toString(); + referralRequest.referringDoctorRemarks = referringDoctorRemarks; + referralRequest.referringClinic = doctorProfile.clinicID; + referralRequest.referringDoctor = doctorProfile.doctorID; + referralRequest.extension = extension; + referralRequest.editedBy = doctorProfile.doctorID; + referralRequest.createdBy = doctorProfile.doctorID; + referralRequest.patientOutSA = false; + + await baseAppClient.post( + REFER_TO_DOCTOR, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: referralRequest.toJson(), + ); + } +} diff --git a/lib/core/service/auth_service.dart b/lib/core/service/auth_service.dart index e116ccdd..adb2d646 100644 --- a/lib/core/service/auth_service.dart +++ b/lib/core/service/auth_service.dart @@ -1,12 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/imei_details.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/models/doctor/user_model.dart'; class AuthService extends BaseService { List _imeiDetails = []; List get dashboardItemsList => _imeiDetails; - + Map _loginInfo = {}; + Map get loginInfo => _loginInfo; Future selectDeviceImei(imei) async { try { // dynamic localRes; @@ -26,4 +27,36 @@ class AuthService extends BaseService { super.error = error; } } + + Future login(UserModel userInfo) async { + hasError = false; + _loginInfo = {}; + try { + await baseAppClient.post(LOGIN_URL, + onSuccess: (dynamic response, int statusCode) { + _loginInfo = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userInfo.toJson()); + } catch (error) { + hasError = true; + super.error = error; + } + + // await baseAppClient.post(SELECT_DEVICE_IMEI, + // onSuccess: (dynamic response, int statusCode) { + // _imeiDetails = []; + // response['List_DoctorDeviceDetails'].forEach((v) { + // _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); + // }); + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: {}); + // } catch (error) { + // hasError = true; + // super.error = error; + // } + } } diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 719b1465..09ee7c49 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,10 +1,9 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { String error; @@ -16,7 +15,17 @@ class BaseService { List patientArrivalList = []; //TODO add the user login model when we need it - Future getDoctorProfile() async { + Future getDoctorProfile({bool isGetProfile = false}) async { + if(isGetProfile) + { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + } if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index dd6310e8..7f277fa8 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -2,7 +2,6 @@ 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:flutter/cupertino.dart'; import 'base_service.dart'; diff --git a/lib/core/service/doctor_reply_service.dart b/lib/core/service/doctor_reply_service.dart index 4096c8b2..2ffb3ee8 100644 --- a/lib/core/service/doctor_reply_service.dart +++ b/lib/core/service/doctor_reply_service.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/hospitals_model.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/request_add_referred_doctor_remarks.dart'; diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index 1a641d1f..8af2121f 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -12,16 +12,34 @@ import 'base/base_service.dart'; class LabsService extends BaseService { List patientLabOrdersList = List(); - Future getPatientLabOrdersList(PatiantInformtion patient) async { + Future getPatientLabOrdersList( + PatiantInformtion patient, bool isInpatient) async { hasError = false; Map body = Map(); - body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS, patient: patient, + String url = ""; + if (isInpatient) { + await getDoctorProfile(); + body['ProjectID'] = doctorProfile.projectID; + url = GET_PATIENT_LAB_OREDERS; + } else { + body['isDentalAllowedBackend'] = false; + url = GET_Patient_LAB_ORDERS; + } + patientLabOrdersList=[]; + patientLabOrdersList.clear(); + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - patientLabOrdersList.clear(); - response['ListPLO'].forEach((hospital) { - patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); - }); + patientLabOrdersList=[]; + if (!isInpatient) { + response['ListPLO'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + var asd=""; + } else { + response['List_GetLabOreders'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -40,43 +58,65 @@ class LabsService extends BaseService { int clinicID, String invoiceNo, String orderNo, - PatiantInformtion patient}) async { + PatiantInformtion patient, + bool isInpatient = false}) async { hasError = false; + + Map body = Map(); _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.orderNo = orderNo; + body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient, + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); + response['ListPLSR'].forEach((hospital) { patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); }); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestPatientLabSpecialResult.toJson()); + }, body: body); } - Future getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { + Future getPatientLabResult( + {PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { hasError = false; + + String url = ""; + if (isInpatient) { + url = GET_PATIENT_LAB_RESULTS; + } else { + url = GET_Patient_LAB_RESULT; + } + Map body = Map(); body['InvoiceNo'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; - body['ClinicID'] = patientLabOrder.clinicID; - await baseAppClient.postPatient(GET_Patient_LAB_RESULT, - patient: patient, + body['ClinicID'] = patientLabOrder.clinicID ?? 0; + + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); labResultList.clear(); - response['ListPLR'].forEach((lab) { - labResultList.add(LabResult.fromJson(lab)); - }); + + if(isInpatient){ + response['List_GetLabNormal'].forEach((hospital) { + labResultList.add(LabResult.fromJson(hospital)); + }); + }else { + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + } + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -84,19 +124,22 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; - body['OrderNo'] = patientLabOrder.orderNo; + if (patientLabOrder != null) { + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID ?? 0; + } body['isDentalAllowedBackend'] = false; - body['SetupID'] = patientLabOrder.setupID; - body['ProjectID'] = patientLabOrder.projectID; - body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); diff --git a/lib/core/service/medical_file_service.dart b/lib/core/service/medical_file_service.dart index fb6c2449..75fade97 100644 --- a/lib/core/service/medical_file_service.dart +++ b/lib/core/service/medical_file_service.dart @@ -1,7 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/medical_file_request_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class MedicalFileService extends BaseService { diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/medicine_service.dart index 5c716d6d..a734354d 100644 --- a/lib/core/service/medicine_service.dart +++ b/lib/core/service/medicine_service.dart @@ -1,8 +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/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; -import 'package:doctor_app_flutter/models/doctor/request_schedule.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'; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index 097047cf..bdbf125e 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -1,8 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; -import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class AdmissionRequestService extends LookupService { List clinicList = []; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 989d0a3c..76f9f18a 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -1,8 +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/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.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'; @@ -22,6 +20,8 @@ class PatientReferralService extends LookupService { List patientReferralList = []; String setupID = "0"; + var frequencyList = []; + Future getProjectsList() async { hasError = false; const url = GET_PROJECTS; @@ -191,7 +191,7 @@ class PatientReferralService extends LookupService { Future getPatientReferral(PatiantInformtion patient) async { hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN; + body['PatientMRN'] = patient.patientMRN ?? patient.patientId; body['AppointmentNo'] = patient.appointmentNo; await baseAppClient.post( @@ -258,7 +258,7 @@ class PatientReferralService extends LookupService { .add({"goalId": element.id, "remarks": element.remarks}); }); - body['PatientMRN'] = patient.patientMRN; + body['PatientMRN'] = patient.patientMRN ?? patient.patientId; body['AppointmentNo'] = patient.appointmentNo; body['SetupID'] = setupID; body['appointmentDate'] = isoStringDate; @@ -284,4 +284,45 @@ class PatientReferralService extends LookupService { body: body, ); } + + Future getReferralFrequencyList() async { + hasError = false; + + Map body = Map(); + + await baseAppClient.post( + PATIENT_GET_LIST_REFERAL_URL, + onSuccess: (dynamic response, int statusCode) { + frequencyList = []; + frequencyList = response['list_STPReferralFrequency']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + + + Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async { + hasError = false; + + Map body = Map(); + body['ProjectID'] = referredPatient.projectID; + body['AdmissionNo'] = referredPatient.admissionNo; + body['LineItemNo'] = referredPatient.lineItemNo; + + await baseAppClient.post( + Verify_Referral_Doctor_Remarks, + onSuccess: (dynamic response, int statusCode) { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } } diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index 90a45ee2..e53df1d0 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -1,18 +1,16 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/prescription_model.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-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/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-data.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { List patientChiefComplaintList = []; - VitalSignData patientVitalSigns; + List patientVitalSignsHistory = []; List patientAssessmentList = []; List orderProcedureList = []; PrescriptionModel prescriptionList; @@ -38,21 +36,57 @@ class UcafService extends LookupService { }, body: body); } - Future getPatientVitalSign(PatiantInformtion patient) async { - patientVitalSigns = null; + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN; - body['AppointmentNo'] = patient.appointmentNo; + body['PatientID'] = patient.patientId; + body['PatientTypeID'] = 1; + if(isInPatient){ + body['InOutPatientType'] = 1; + }else { + body['InOutPatientType'] = 2; + } + + await baseAppClient.post( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + ); + } + + Future getPatientVitalSignsHistory( + PatiantInformtion patient, String fromDate, String toDate) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientId; // patient.patientMRN + // body['AppointmentNo'] = patient.appointmentNo; // body['EpisodeID'] = patient.episodeNo; + body['PatientTypeID'] = 1; + body['PatientType'] = 1; + body['DeviceTypeID'] = 1; + body['isDentalAllowedBackend'] = false; + body['From'] = fromDate; + body['To'] = toDate; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { - if(response['VitalSignsList'] != null){ - if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ - patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); - } + patientVitalSignsHistory.clear(); + if (response['VitalSignsHistory'] != null) { + response['VitalSignsHistory'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); } }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 75bc955f..1c07aa48 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -1,10 +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/PatientArrivalEntity.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/models/patient/vital_sign/vital_sign_res_model.dart'; class VitalSignsService extends BaseService { VitalSignData patientVitalSigns; @@ -41,31 +39,67 @@ class VitalSignsService extends BaseService { patientVitalSigns = null; hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientId; // patient.patientMRN - // body['AppointmentNo'] = patient.appointmentNo; - // body['EpisodeID'] = patient.episodeNo; + body['PatientID'] = patient.patientId; // patient.patientMRN + body['InOutPatientType'] = 1; body['PatientTypeID'] = 1; body['PatientType'] = 1; body['DeviceTypeID'] = 1; body['isDentalAllowedBackend'] = false; - body['From'] = fromDate; - body['To'] = toDate; + body['ProjectID'] = patient.projectId; + // body['From'] = fromDate; + // body['To'] = toDate; + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; + } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN_DATA, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['VitalSignsHistory'] != null) { - response['VitalSignsHistory'].forEach((v) { + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + ); + } + + Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async { + hasError = false; + Map body = Map(); + body['PatientID'] = patient.patientId; + body['PatientTypeID'] = patient.patientType; + // if(isInPatient){ + body['InOutPatientType'] = 0; + body['isDentalAllowedBackend'] = false; + body['IPAdress'] = "10.20.10.20"; + // }else { + // body['InOutPatientType'] = 2; + // } + + + await baseAppClient.postPatient( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + });} }, onFailure: (String error, int statusCode) { hasError = true; super.error = error.toString(); }, body: body, + patient: patient ); } } diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart new file mode 100644 index 00000000..606bfc5d --- /dev/null +++ b/lib/core/service/patient/out_patient_service.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class OutPatientService extends BaseService { + List _patientList = []; + List get patientList => _patientList; + + + Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + hasError = false; + await baseAppClient.post( + GET_MY_OUT_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['List_MyOutPatient'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patientSearchRequestModel.toJson(), + ); + } + Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + hasError = false; + await baseAppClient.post( + PRM_SEARCH_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['GetPatientFileInformation_PRMList'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patientSearchRequestModel.toJson(), + ); + } +} diff --git a/lib/core/service/patientInPatientService.dart b/lib/core/service/patientInPatientService.dart new file mode 100644 index 00000000..3e0ba4a4 --- /dev/null +++ b/lib/core/service/patientInPatientService.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class PatientInPatientService extends BaseService { + List inPatientList = List(); + + Future getInPatientList( + PatientSearchRequestModel requestModel, bool isMyInpatient) async { + hasError = false; + await getDoctorProfile(); + + if (isMyInpatient) { + requestModel.doctorID = doctorProfile.doctorID; + }else { + requestModel.doctorID = 0; + } + + await baseAppClient.post( + GET_PATIENT_IN_PATIENT_LIST, + onSuccess: (dynamic response, int statusCode) { + inPatientList.clear(); + + response['List_MyInPatient'].forEach((v) { + inPatientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: requestModel.toJson(), + ); + } +} diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index aea26e8a..e15cc8d1 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -1,17 +1,17 @@ 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/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/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/request_schedule.dart'; -import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.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/patient_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'; @@ -51,9 +51,9 @@ class PatientService extends BaseService { List get labResultList => _labResultList; // TODO: replace var with model - var _patientProgressNoteList = []; + List _patientProgressNoteList = []; - get patientProgressNoteList => _patientProgressNoteList; + List get patientProgressNoteList => _patientProgressNoteList; // TODO: replace var with model var _insuranceApporvalsList = []; @@ -138,42 +138,6 @@ class PatientService extends BaseService { return Future.value(localRes); } - Future getPatientVitalSign(patient) async { - hasError = false; - await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, - onSuccess: (dynamic response, int statusCode) { - _patientVitalSignList = []; - response['List_DoctorPatientVitalSign'].forEach((v) { - _patientVitalSignList.add(new VitalSignResModel.fromJson(v)); - }); - - if (_patientVitalSignList.length > 0) { - List patientVitalSignOrderdSubListTemp = []; - patientVitalSignOrderdSubListTemp = _patientVitalSignList; - patientVitalSignOrderdSubListTemp - .sort((VitalSignResModel a, VitalSignResModel b) { - return b.vitalSignDate.microsecondsSinceEpoch - - a.vitalSignDate.microsecondsSinceEpoch; - }); - patientVitalSignOrderdSubList.clear(); - int length = patientVitalSignOrderdSubListTemp.length >= 20 - ? 20 - : patientVitalSignOrderdSubListTemp.length; - for (int x = 0; x < length; x++) { - patientVitalSignOrderdSubList - .add(patientVitalSignOrderdSubListTemp[x]); - } - } - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: patient, - ); - } - Future getLabResultOrders(patient) async { hasError = false; await baseAppClient.post( @@ -313,7 +277,10 @@ class PatientService extends BaseService { PATIENT_PROGRESS_NOTE_URL, onSuccess: (dynamic response, int statusCode) { _patientProgressNoteList = []; - _patientProgressNoteList = response['List_GetPregressNoteForInPatient']; + // _patientProgressNoteList = + response['List_GetPregressNoteForInPatient'].forEach((v) { + _patientProgressNoteList.add(new NoteModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -323,6 +290,38 @@ class PatientService extends BaseService { ); } + Future updatePatientProgressNote(UpdateNoteReqModel req) async { + hasError = false; + + await baseAppClient.post( + UPDATE_PROGRESS_NOTE_FOR_INPATIENT, + onSuccess: (dynamic response, int statusCode) { + print("ok"); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: req.toJson(), + ); + } + + Future createPatientProgressNote(CreateNoteModel req) async { + hasError = false; + + await baseAppClient.post( + CREATE_PROGRESS_NOTE_FOR_INPATIENT, + onSuccess: (dynamic response, int statusCode) { + print("ok"); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: req.toJson(), + ); + } + Future getClinicsList() async { hasError = false; diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 67b3491c..dc74901e 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -3,17 +3,14 @@ import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; -import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.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/SOAP/master_key_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/util/date-utils.dart'; @@ -112,7 +109,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug}) async { + Future getMedicationList({String drug =''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/service/prescriptions_service.dart b/lib/core/service/prescriptions_service.dart index c720eec9..90d65de9 100644 --- a/lib/core/service/prescriptions_service.dart +++ b/lib/core/service/prescriptions_service.dart @@ -1,6 +1,8 @@ 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/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'; @@ -15,12 +17,37 @@ import 'base/base_service.dart'; class PrescriptionsService extends BaseService { List prescriptionsList = List(); List prescriptionsOrderList = List(); + List prescriptionInPatientList = List(); + + InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = + InPatientPrescriptionRequestModel(); + + 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, + await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((prescriptions) { @@ -37,7 +64,9 @@ class PrescriptionsService extends BaseService { appointmentNo: 0, isDentalAllowedBackend: false); List prescriptionReportList = List(); - Future getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + Future getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { hasError = false; _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; @@ -50,8 +79,7 @@ class PrescriptionsService extends BaseService { prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); if (prescriptions.isInOutPatient) { @@ -82,11 +110,11 @@ class PrescriptionsService extends BaseService { ); List pharmacyPrescriptionsList = List(); - Future getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async { + Future getListPharmacyForPrescriptions( + {int itemId, @required PatiantInformtion patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, - patient: patient, + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { @@ -107,7 +135,8 @@ class PrescriptionsService extends BaseService { List prescriptionReportEnhList = List(); Future getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { + {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) { @@ -141,8 +170,7 @@ class PrescriptionsService extends BaseService { await baseAppClient.postPatient( isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); if (isInPatient) { @@ -163,20 +191,21 @@ class PrescriptionsService extends BaseService { 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); + prescriptionsOrderList.clear(); + response['PatientER_GetPatientAllPresOrdersList'] + .forEach((prescriptionsOrder) { + prescriptionsOrderList + .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } } diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index f61166b9..b403edf0 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_request_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; @@ -10,8 +9,6 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_reque import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:flutter/foundation.dart'; - class ProcedureService extends BaseService { List _procedureList = List(); List get procedureList => _procedureList; @@ -79,12 +76,12 @@ class ProcedureService extends BaseService { Future getProcedureCategory({String categoryName, String categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( - search: [categoryName], + search: ["$categoryName"], patientMRN: 0, pageIndex: 0, clinicId: 0, pageSize: 0, - category: categoryID ?? "01", + category: categoryID ?? null, ); hasError = false; _categoriesList.clear(); diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart index c8c02fd0..42a79098 100644 --- a/lib/core/service/radiology_service.dart +++ b/lib/core/service/radiology_service.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/core/model/radiology/request_send_rad_report_email.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/cupertino.dart'; @@ -27,19 +26,31 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient) async { + Future getPatientRadOrders(PatiantInformtion patient , {isInPatient = false}) async { + String url = GET_PATIENT_ORDERS; + final Map body = new Map(); + if(isInPatient) { + url = GET_IN_PATIENT_ORDERS; + body['ProjectID'] = patient.projectId; + } + + hasError = false; - await baseAppClient.postPatient(GET_PATIENT_ORDERS, + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - finalRadiologyList.clear(); - response['ListRAD'].forEach((radiology) { + finalRadiologyList = []; + String label = "ListRAD"; + if(isInPatient) { + label ="List_GetRadOreders"; + } + response[label].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body:body); } diff --git a/lib/core/service/referral_patient_service.dart b/lib/core/service/referral_patient_service.dart index e3ca6fae..9fc163bd 100644 --- a/lib/core/service/referral_patient_service.dart +++ b/lib/core/service/referral_patient_service.dart @@ -3,7 +3,6 @@ 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/util/helpers.dart'; class ReferralPatientService extends BaseService { @@ -11,9 +10,6 @@ class ReferralPatientService extends BaseService { List get listMyReferralPatientModel => _listMyReferralPatientModel; - Helpers helpers = Helpers(); - - RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks(); diff --git a/lib/core/service/referred_patient_service.dart b/lib/core/service/referred_patient_service.dart index 20decbf1..0af9b077 100644 --- a/lib/core/service/referred_patient_service.dart +++ b/lib/core/service/referred_patient_service.dart @@ -3,7 +3,6 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/verify_referral_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; class ReferredPatientService extends BaseService { List _listMyReferredPatientModel = []; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 1ea8669a..1bfb8df8 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/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'; @@ -15,7 +17,8 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = []; + List _getAllsickLeave = List(); + List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -27,6 +30,13 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; + + + List getAllSickLeavePatient = List(); + + SickLeavePatientRequestModel _sickLeavePatientRequestModel = + SickLeavePatientRequestModel(); + Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( @@ -87,13 +97,14 @@ class SickLeaveService extends BaseService { Future getSickLeave(patientMRN) async { hasError = false; - await baseAppClient.post( + getAllSickLeavePatient = []; + await baseAppClient.postPatient( GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); - _getAllsickLeave.clear(); - response['SickLeavesList']['entityList'].forEach((v) { - _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); + // Future.value(response); + getAllSickLeavePatient=[]; + response['List_SickLeave'].forEach((v) { + getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -104,6 +115,29 @@ class SickLeaveService extends BaseService { ); } + Future getSickLeavePatient(patientMRN) async { + _sickLeavePatientRequestModel = SickLeavePatientRequestModel( + patientID: patientMRN, patientTypeID: 2, patientType: 1); + hasError = false; + getAllSickLeavePatient =[]; + getAllSickLeavePatient.clear(); + await baseAppClient.postPatient( + GET_SICK_LEAVE_PATIENT, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + getAllSickLeavePatient.clear(); + response['List_SickLeave'].forEach((v) { + getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _sickLeavePatientRequestModel.toJson(), + ); + } + Future getRescheduleLeave() async { hasError = false; await baseAppClient.post( diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart new file mode 100644 index 00000000..1c1ed4d1 --- /dev/null +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -0,0 +1,63 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class DischargedPatientViewModel extends BaseViewModel { + DischargedPatientService _dischargedPatientService = + locator(); + + List get myDischargedPatient => + _dischargedPatientService.myDischargedPatients; + + + List filterData = []; + + searchData(String str) { + var strExist = str.length > 0 ? true : false; + if (strExist) { + filterData = []; + for (var i = 0; i < myDischargedPatient.length; i++) { + String firstName = myDischargedPatient[i].firstName.toUpperCase(); + String lastName = myDischargedPatient[i].lastName.toUpperCase(); + String mobile = myDischargedPatient[i].mobileNumber.toUpperCase(); + String patientID = myDischargedPatient[i].patientId.toString(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData.add(myDischargedPatient[i]); + } + } + notifyListeners(); + } else { + filterData = myDischargedPatient; + notifyListeners(); + } + } + + + Future getDischargedPatient() async { + setState(ViewState.Busy); + await _dischargedPatientService.getDischargedPatient(); + if (_dischargedPatientService.hasError) { + error = _dischargedPatientService.error; + setState(ViewState.Error); + } else{ + filterData = myDischargedPatient; + setState(ViewState.Idle);} + } + + Future gtMyDischargeReferralPatient() async { + setState(ViewState.Busy); + await _dischargedPatientService.gtMyDischargeReferralPatient(); + if (_dischargedPatientService.hasError) { + error = _dischargedPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index 941abcfb..54e61635 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -1,31 +1,45 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; +import 'package:doctor_app_flutter/core/model/insurance_approval_in_patient_model.dart'; import 'package:doctor_app_flutter/core/service/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 '../../locator.dart'; -class InsuranceViewModel extends BaseViewModel{ - +class InsuranceViewModel extends BaseViewModel { InsuranceCardService _insuranceCardService = locator(); - List get insuranceApproval => _insuranceCardService.insuranceApproval; + List get insuranceApprovalInPatient => + _insuranceCardService.insuranceApprovalInPatient; - Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo, int projectId}) async { + Future getInsuranceApproval(PatiantInformtion patient, + {int appointmentNo, int projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) await _insuranceCardService.getInsuranceApproval(patient, - appointmentNo: appointmentNo,projectId: projectId); + appointmentNo: appointmentNo, projectId: projectId); else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { error = "No Insurance Approval Found"; - setState(ViewState.Error); + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getInsuranceInPatient({int mrn}) async { + //hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _insuranceCardService.getInsuranceApprovalInPatient(mrn: mrn); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } -} \ No newline at end of file +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart new file mode 100644 index 00000000..a714cef9 --- /dev/null +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -0,0 +1,195 @@ +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; + +import '../../locator.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patientInPatientService.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class PatientSearchViewModel extends BaseViewModel{ + OutPatientService _outPatientService = locator(); + + List get patientList => _outPatientService.patientList; + + List filterData = []; + + searchData(String str) { + var strExist = str.length > 0 ? true : false; + if (strExist) { + filterData = []; + for (var i = 0; i < _outPatientService.patientList.length; i++) { + String firstName = _outPatientService.patientList[i].firstName.toUpperCase(); + String lastName = _outPatientService.patientList[i].lastName.toUpperCase(); + String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase(); + String patientID = _outPatientService.patientList[i].patientId.toString(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData.add(_outPatientService.patientList[i]); + } + } + notifyListeners(); + } else { + filterData = _outPatientService.patientList; + notifyListeners(); + } + } + + getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { + if(isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + + await _outPatientService.getOutPatient( + patientSearchRequestModel); + if (_outPatientService.hasError) { + error = _outPatientService.error; + if(isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } + setState(ViewState.Error); + } else { + filterData = _outPatientService.patientList; + setState(ViewState.Idle); + } + } + + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + setState(ViewState.Busy); + await _outPatientService.getPatientFileInformation( + patientSearchRequestModel); + if (_outPatientService.hasError) { + error = _outPatientService.error; + setState(ViewState.Error); + } else { + filterData = _outPatientService.patientList; + setState(ViewState.Idle); + } + } + + + + getPatientBasedOnDate ( + {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, + bool isSearchWithKeyInfo })async { + String dateTo; + String dateFrom; + if (item == 'Tomorrow') { + dateTo = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + dateFrom = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else if (item == 'Next Week') { + + + dateTo = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); + + dateFrom = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else { + dateFrom = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + dateTo= DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + } + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.firstName = patientSearchRequestModel.firstName; + currentModel.lastName = patientSearchRequestModel.lastName; + currentModel.middleName = patientSearchRequestModel.middleName; + currentModel.doctorID = patientSearchRequestModel.doctorID; + currentModel.from = dateFrom; + currentModel.to = dateTo; + + + if(isSearchWithKeyInfo) { + await getPatientFileInformation(currentModel); + } else { + await getOutPatient(currentModel, isLocalBusy: true); + } + filterData = _outPatientService.patientList; + + } + + + + PatientInPatientService _inPatientService = + locator(); + + List get _inPatientList => _inPatientService.inPatientList; + List filteredInPatientItems = List(); + + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false, bool isFirstTime = true}) async { + await getDoctorProfile(); + if (isFirstTime) + setState(ViewState.Busy); + else + setState(ViewState.BusyLocal); + await _inPatientService.getInPatientList(requestModel, false); + if (_inPatientService.hasError) { + error = _inPatientService.error; + setState(ViewState.Error); + } else { + filteredInPatientItems.clear(); + if (_inPatientList.length > 0) + filteredInPatientItems.addAll(_inPatientList); + setState(ViewState.Idle); + } + } + + void filterSearchResults(String query) { + var strExist = query.length > 0 ? true : false; + if (strExist) { + filteredInPatientItems = []; + for (var i = 0; i < _inPatientList.length; i++) { + String firstName = _inPatientList[i].firstName.toUpperCase(); + String lastName = _inPatientList[i].lastName.toUpperCase(); + String mobile = _inPatientList[i].mobileNumber.toUpperCase(); + String patientID = _inPatientList[i].patientId.toString(); + + if (firstName.contains(query.toUpperCase()) || + lastName.contains(query.toUpperCase()) || + mobile.contains(query) || + patientID.contains(query)) { + filteredInPatientItems.add(_inPatientList[i]); + } + } + notifyListeners(); + } else { + if (_inPatientList.length > 0) + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(_inPatientList); + notifyListeners(); + } + } + + +} diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 87b89123..4e40fe31 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -1,22 +1,17 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/imei_details.dart'; import 'package:doctor_app_flutter/core/model/insert_imei_model.dart'; -import 'package:doctor_app_flutter/core/service/auth_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/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.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/util/dr_app_shared_pref.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:doctor_app_flutter/config/config.dart'; + import '../../models/doctor/user_model.dart'; -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } class AuthViewModel extends BaseViewModel { @@ -195,26 +190,19 @@ class AuthViewModel extends BaseViewModel { } } - /* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: docInfo - *@return:Future - *@desc: getDocProfiles - */ - Future getDocProfiles(docInfo, {bool allowChangeProfile = true}) async { + Future getDocProfiles(docInfo, + {bool allowChangeProfile = true}) async { try { dynamic localRes; await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { localRes = response; - if(allowChangeProfile) { + if (allowChangeProfile) { doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); selectedClinicName = - response['DoctorProfileList'][0]['ClinicDescription']; + response['DoctorProfileList'][0]['ClinicDescription']; } - }, onFailure: (String error, int statusCode) { throw error; }, body: docInfo); diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 9eb3c0fc..fede0793 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,6 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; -import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 09e0a622..6da7d904 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,7 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; -import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/core/viewModel/imei_view_model.dart b/lib/core/viewModel/imei_view_model.dart index 29253b1d..c2d16206 100644 --- a/lib/core/viewModel/imei_view_model.dart +++ b/lib/core/viewModel/imei_view_model.dart @@ -1,14 +1,15 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/imei_details.dart'; import 'package:doctor_app_flutter/core/service/auth_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/user_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; class IMEIViewModel extends BaseViewModel { AuthService _authService = locator(); List get imeiDetails => _authService.dashboardItemsList; - + get loginInfo => _authService.loginInfo; Future selectDeviceImei(imei) async { setState(ViewState.Busy); await _authService.selectDeviceImei(imei); @@ -18,4 +19,15 @@ class IMEIViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future login(UserModel userInfo) async { + setState(ViewState.Busy); + await _authService.login(userInfo); + if (_authService.hasError) { + error = _authService.error; + Helpers.showErrorToast(error); + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 43851649..020a6184 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -28,7 +28,7 @@ class LabsViewModel extends BaseViewModel { void getLabs(PatiantInformtion patient) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(patient); + await _labsService.getPatientLabOrdersList(patient, true); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -89,7 +89,6 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); List get labResultListsCoustom { - return labResultLists; } @@ -98,14 +97,16 @@ class LabsViewModel extends BaseViewModel { int clinicID, String invoiceNo, String orderNo, - PatiantInformtion patient}) async { + PatiantInformtion patient, + bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, - patient: patient); + patient: patient, + isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -114,9 +115,11 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { + getPatientLabResult( + {PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder,patient: patient); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -149,10 +152,14 @@ class LabsViewModel extends BaseViewModel { } getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, procedure: procedure,patient: patient); + patientLabOrder: patientLabOrder, + procedure: procedure, + patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index afebad74..194e8323 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -1,7 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; - import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 5a586ee0..c318d401 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,7 +1,6 @@ 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/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 0f0b9bf0..9d43ec48 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -1,11 +1,8 @@ -import 'package:doctor_app_flutter/config/shared_pref_kay.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/admissionRequest/admission-request.dart'; -import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import '../../locator.dart'; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 3c3a5b2f..aaa0d35e 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,10 +1,13 @@ -import 'package:doctor_app_flutter/config/shared_pref_kay.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/DischargeReferralPatient.dart'; +import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart'; +import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart'; +import 'package:doctor_app_flutter/core/service/MyReferralPatientService.dart'; +import 'package:doctor_app_flutter/core/service/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/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/PatientArrivalEntity.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'; @@ -18,13 +21,29 @@ class PatientReferralViewModel extends BaseViewModel { PatientReferralService _referralPatientService = locator(); + ReferralService _referralService = locator(); + + MyReferralInPatientService _myReferralService = + locator(); + + DischargedPatientService _dischargedPatientService = locator(); + List get myDischargeReferralPatient => + _dischargedPatientService.myDischargeReferralPatients; + List get branchesList => _referralPatientService.projectsList; List get clinicsList => _referralPatientService.clinicsList; + List get referralFrequencyList => + _referralPatientService.frequencyList; + List doctorsList = []; - List get clinicDoctorsList => _referralPatientService.doctorsList; + List get clinicDoctorsList => + _referralPatientService.doctorsList; + + List get myReferralPatients => + _myReferralService.myReferralPatients; List get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel; @@ -85,20 +104,20 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getClinicDoctors(PatiantInformtion patient ,int clinicId, int branchId) async { + Future getClinicDoctors( + PatiantInformtion patient, int clinicId, int branchId) async { setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(patient, clinicId, branchId); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.ErrorLocal); - } else{ + } else { doctorsList.clear(); clinicDoctorsList.forEach((element) { doctorsList.add(element.toJson()); }); setState(ViewState.Idle); } - } Future getDoctorBranch() async { @@ -137,6 +156,25 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getMyReferralPatientService() async { + setState(ViewState.Busy); + await _myReferralService.getMyReferralPatientService(); + if (_myReferralService.hasError) { + error = _myReferralService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async{ + setState(ViewState.Busy); + await _myReferralService.replay(referredDoctorRemarks,referral); + if (_myReferralService.hasError) { + error = _myReferralService.error; + setState(ViewState.ErrorLocal); + } else + getMyReferralPatientService(); + } + Future responseReferral( PendingReferral pendingReferral, bool isAccepted) async { setState(ViewState.Busy); @@ -161,13 +199,43 @@ class PatientReferralViewModel extends BaseViewModel { } } + Future makeInPatientReferral( + {PatiantInformtion patient, + int projectID, + int clinicID, + int doctorID, + int frequencyCode, + int priority, + String referralDate, + String remarks, + String ext}) async { + setState(ViewState.Busy); + await _referralService.referralPatient( + patientID: patient.patientId, + roomID: patient.roomId, + referralClinic: clinicID, + admissionNo: patient.appointmentNo, + referralDoctor: doctorID, + patientTypeID: patient.patientType, + referringDoctorRemarks: remarks, + priority: priority, + frequency: frequencyCode, + extension: ext, + ); + if (_referralService.hasError) { + error = _referralService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + Future getPatientDetails( String fromDate, String toDate, int patientMrn, int appointmentNo) async { setState(ViewState.Busy); await _referralPatientService.getPatientArrivalList(toDate, - fromDate: fromDate, - patientMrn: patientMrn); + fromDate: fromDate, patientMrn: patientMrn); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.Error); @@ -176,20 +244,131 @@ class PatientReferralViewModel extends BaseViewModel { } } + Future getReferralFrequencyList() async { + setState(ViewState.Busy); + await _referralPatientService.getReferralFrequencyList(); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future verifyReferralDoctorRemarks( + MyReferredPatientModel referredPatient) async { + setState(ViewState.Busy); + await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.ErrorLocal); + } else { + getMyReferredPatient(); + setState(ViewState.Idle); + } + } + + Future gtMyDischargeReferralPatient() async { + setState(ViewState.Busy); + await _dischargedPatientService.gtMyDischargeReferralPatient(); + if (_dischargedPatientService.hasError) { + error = _dischargedPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + String getReferralStatusNameByCode(int statusCode, BuildContext context) { switch (statusCode) { case 1: - return TranslationBase.of(context).pending/*referralStatusHold*/; + return TranslationBase.of(context).pending /*referralStatusHold*/; case 2: - return TranslationBase.of(context).accepted/*referralStatusActive*/; + return TranslationBase.of(context).accepted /*referralStatusActive*/; case 4: - return TranslationBase.of(context).rejected/*referralStatusCancelled*/; + return TranslationBase.of(context).rejected /*referralStatusCancelled*/; case 46: - return TranslationBase.of(context).accepted/*referralStatusCompleted*/; + return TranslationBase.of(context).accepted /*referralStatusCompleted*/; case 63: - return TranslationBase.of(context).rejected/*referralStatusNotSeen*/; + return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; default: return "-"; } } + + PatiantInformtion getPatientFromReferral( + MyReferredPatientModel referredPatient) { + PatiantInformtion patient = PatiantInformtion(); + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; + patient.patientId = referredPatient.patientID; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; + patient.nationalityFlagURL = referredPatient.nationalityFlagURL; + patient.age = referredPatient.age; + patient.clinicDescription = referredPatient.clinicDescription; + return patient; + } + + PatiantInformtion getPatientFromReferralO( + MyReferralPatientModel referredPatient) { + PatiantInformtion patient = PatiantInformtion(); + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; + patient.patientId = referredPatient.patientID; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; + patient.nationalityFlagURL = referredPatient.nationalityFlagURL; + patient.age = referredPatient.age; + patient.clinicDescription = referredPatient.clinicDescription; + return patient; + } + + PatiantInformtion getPatientFromDischargeReferralPatient( + DischargeReferralPatient referredPatient) { + PatiantInformtion patient = PatiantInformtion(); + patient.doctorId = referredPatient.doctorID; + patient.doctorName = referredPatient.doctorName; + patient.patientId = referredPatient.patientID; + patient.firstName = referredPatient.firstName; + patient.middleName = referredPatient.middleName; + patient.lastName = referredPatient.lastName; + patient.gender = referredPatient.gender; + patient.dateofBirth = referredPatient.dateofBirth; + patient.mobileNumber = referredPatient.mobileNumber; + patient.emailAddress = referredPatient.emailAddress; + patient.patientIdentificationNo = referredPatient.patientIdentificationNo; + patient.patientType = referredPatient.patientType; + patient.admissionNo = referredPatient.admissionNo; + patient.admissionDate = referredPatient.admissionDate; + patient.roomId = referredPatient.roomID; + patient.bedId = referredPatient.bedID; + patient.nationalityName = referredPatient.nationalityName; + patient.nationalityFlagURL = '';// TODO from backend referredPatient.nationalityFlagURL; + patient.age = referredPatient.age; + patient.clinicDescription = referredPatient.clinicDescription; + return patient; + } } diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index f48ef485..dc76884d 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -9,7 +9,8 @@ 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-data.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:flutter/material.dart'; import '../../locator.dart'; @@ -20,7 +21,8 @@ class UcafViewModel extends BaseViewModel { List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns; + List get patientVitalSignsHistory => + _ucafService.patientVitalSignsHistory; List get patientAssessmentList => _ucafService.patientAssessmentList; @@ -35,6 +37,13 @@ class UcafViewModel extends BaseViewModel { List get orderProcedures => _ucafService.orderProcedureList; String selectedLanguage; + String heightCm = "0"; + String weightKg = "0"; + String bodyMax = "0"; + String temperatureCelcius = "0"; + String hartRat = "0"; + String respirationBeatPerMinute = "0"; + String bloodPressure = "0 / 0"; resetDataInFirst(){ _ucafService.patientAssessmentList = []; @@ -48,13 +57,55 @@ class UcafViewModel extends BaseViewModel { Future getUCAFData(PatiantInformtion patient) async { setState(ViewState.Busy); - await _ucafService.getPatientVitalSign(patient); + + String from; + String to; + if (from == null || from == "0") { + from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + if (to == null || to == "0") { + to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + + // await _ucafService.getPatientVitalSignsHistory(patient, from, to); + await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { error = _ucafService.error; setState(ViewState.Error); } else { + patientVitalSignsHistory.forEach((element) { + if (heightCm == "0" || heightCm == null || heightCm == 'null') { + heightCm = element.heightCm.toString(); + } + if (weightKg == "0" || weightKg == null || weightKg == 'null') { + weightKg = element.weightKg.toString(); + } + if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { + bodyMax = element.bodyMassIndex.toString(); + } + if (temperatureCelcius == "0" || + temperatureCelcius == null || + temperatureCelcius == 'null') { + temperatureCelcius = element.temperatureCelcius.toString(); + } + if (hartRat == "0" || hartRat == null || hartRat == 'null') { + hartRat = element.pulseBeatPerMinute.toString(); + } + if (respirationBeatPerMinute == "0" || + respirationBeatPerMinute == null || + respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = + element.respirationBeatPerMinute.toString(); + } + if (bloodPressure == "0 / 0" || + bloodPressure == null || + bloodPressure == 'null') { + bloodPressure = element.bloodPressure.toString(); + } + }); + setState(ViewState.Idle); } } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 652bfed7..cd02f538 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -1,11 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.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/models/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; @@ -25,6 +23,13 @@ class VitalSignsViewModel extends BaseViewModel { String hartRat = "0"; String respirationBeatPerMinute = "0"; String bloodPressure = "0 / 0"; + String oxygenation = "0 - 0"; + String painScore = "-"; + String painLocation = "-"; + String painCharacter = "-"; + String painDuration = "-"; + String isPainDone = "-"; + String painFrequency = "-"; Future getPatientVitalSign(PatiantInformtion patient) async { setState(ViewState.Busy); @@ -37,8 +42,8 @@ class VitalSignsViewModel extends BaseViewModel { } } - Future getPatientVitalSignHistory( - PatiantInformtion patient, String from, String to) async { + Future getPatientVitalSignHistory(PatiantInformtion patient, String from, + String to, bool isInPatient) async { setState(ViewState.Busy); if (from == null || from == "0") { from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -47,7 +52,14 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + + if (isInPatient) { + await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + } else { + await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); + + } + if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); @@ -81,6 +93,32 @@ class VitalSignsViewModel extends BaseViewModel { bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } + if (oxygenation == "0 - 0" || + oxygenation == null || + oxygenation == 'null') { + oxygenation = + "${element.sAO2.toString()} - ${element.fIO2.toString()}"; + } + if (painScore == null || painScore == "-") { + painScore = element.painScore.toString() != 'null' + ? element.painScore.toString() + : "-"; + painLocation = element.painLocation.toString() != 'null' + ? element.painLocation.toString() + : "-"; + painCharacter = element.painCharacter.toString() != 'null' + ? element.painCharacter.toString() + : "-"; + painDuration = element.painDuration.toString() != 'null' + ? element.painDuration.toString() + : "-"; + isPainDone = element.isPainManagementDone.toString() != 'null' + ? element.isPainManagementDone.toString() + : "-"; + painFrequency = element.painFrequency.toString() != 'null' + ? element.painFrequency.toString() + : "-"; + } }); setState(ViewState.Idle); } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 9e938630..3a45036e 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -1,4 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.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/service/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'; @@ -39,7 +42,7 @@ class PatientViewModel extends BaseViewModel { get insuranceApporvalsList => _patientService.insuranceApporvalsList; - get patientProgressNoteList => _patientService.patientProgressNoteList; + List get patientProgressNoteList => _patientService.patientProgressNoteList; List get clinicsList => _patientService.clinicsList; @@ -62,20 +65,12 @@ class PatientViewModel extends BaseViewModel { if (_patientService.hasError) { error = _patientService.error; setState(ViewState.Error); + } else{ + setState(ViewState.Idle); } return localRes; } - Future getPatientVitalSign(patient) async { - setState(ViewState.Busy); - await _patientService.getPatientVitalSign(patient); - if (_patientService.hasError) { - error = _patientService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - Future getLabResultOrders(patient) async { setState(ViewState.Busy); await _patientService.getLabResultOrders(patient); @@ -146,12 +141,41 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientProgressNote(patient) async { - setState(ViewState.Busy); + Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async { + if(isLocalBusy) { + setState(ViewState.BusyLocal); + }else{ + setState(ViewState.Busy); + } + await _patientService.getPatientProgressNote(patient); if (_patientService.hasError) { error = _patientService.error; - setState(ViewState.Error); + if(isLocalBusy) { + setState(ViewState.ErrorLocal); + }else{ + setState(ViewState.Error); + } + } else + setState(ViewState.Idle); + } + + Future updatePatientProgressNote(UpdateNoteReqModel req) async { + setState(ViewState.BusyLocal); + await _patientService.updatePatientProgressNote(req); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future createPatientProgressNote(CreateNoteModel req) async { + setState(ViewState.BusyLocal); + await _patientService.createPatientProgressNote(req); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 5ced6617..c549b2b0 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -3,20 +3,18 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.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/get_medication_response_model.dart'; -import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/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/SOAP/master_key_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:flutter/cupertino.dart'; @@ -56,6 +54,25 @@ class PrescriptionViewModel extends BaseViewModel { ? _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(); + + setState(ViewState.Idle); + } + } + Future getItem({int itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); @@ -252,7 +269,7 @@ class PrescriptionViewModel extends BaseViewModel { if (patientType == "7") setState(ViewState.ErrorLocal); else - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _filterList(); await _getPrescriptionsOrders(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 0d0b41ef..8717c84b 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -6,7 +6,6 @@ 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/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/get_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_valadate_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; @@ -44,16 +43,15 @@ class ProcedureViewModel extends BaseViewModel { List get radiologyList => _radiologyService.finalRadiologyList; + List get patientLabOrdersList => _labsService.patientLabOrdersList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); - List get patientLabOrdersList => - filterType == FilterType.Clinic - ? _patientLabOrdersListClinic - : _patientLabOrdersListHospital; + Future getProcedure({int mrn,String patientType}) async { hasError = false; @@ -137,17 +135,18 @@ class ProcedureViewModel extends BaseViewModel { } else setState(ViewState.Idle); //await getProcedure(mrn: mrn); + } - void getPatientRadOrders(PatiantInformtion patient,{String patientType}) async { + void getPatientRadOrders(PatiantInformtion patient,{String patientType, bool isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient); + await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; if(patientType=="7") setState(ViewState.ErrorLocal); else - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _radiologyService.finalRadiologyList.forEach((element) { List finalRadiologyListClinic = @@ -222,59 +221,19 @@ class ProcedureViewModel extends BaseViewModel { List labResultLists = List(); + + List get labResultListsCoustom { return labResultLists; } - void getLabs(PatiantInformtion patient,{bool isArrived}) async { + void getLabs(PatiantInformtion patient, {bool isInpatient = false}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(patient); + await _labsService.getPatientLabOrdersList(patient, isInpatient); if (_labsService.hasError) { error = _labsService.error; - if(isArrived) - setState(ViewState.ErrorLocal); - else setState(ViewState.Error); } else { - _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); - - if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, - patientDoctorAppointment: element)); - } - - // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); - - if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, - patientDoctorAppointment: element)); - } - }); - setState(ViewState.Idle); } } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index e144042e..97974a04 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -4,10 +4,10 @@ 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/core/viewModel/auth_view_model.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/core/viewModel/auth_view_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 4370b47f..4e3768dc 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -20,9 +20,9 @@ class RadiologyViewModel extends BaseViewModel { ? _finalRadiologyListClinic : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient) async { + void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient); + await _radiologyService.getPatientRadOrders(patient, isInPatient:isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 2c2f1579..bc80744f 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,8 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; -import 'package:doctor_app_flutter/core/service/medicine_service.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 '../../locator.dart'; @@ -12,6 +10,7 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; + get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; List get allOffTime => _sickLeaveService.getOffTimeList; List get allReasons => _sickLeaveService.getReasons; List get coveringDoctors => _sickLeaveService.coveringDoctorsList; @@ -58,6 +57,16 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getSickLeavePatient(patientMRN) async { + setState(ViewState.Busy); + await _sickLeaveService.getSickLeavePatient(patientMRN); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future getRescheduleLeave() async { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index 3fb1c2fa..a5f1b893 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -2343,101 +2343,185 @@ ] }, { - "uid": "61995ecf98bfc143fef5299e57bcc37f", - "css": "powered-by-cs-1", - "code": 59510, + "uid": "bffd96d1421ef42e3a097855b3820d42", + "css": "obese-bmi-r-1", + "code": 59561, "src": "custom_icons", "selected": true, "svg": { - "path": "M5611.5 942.8L5603.8 947.4A13.5 13.5 0 0 0 5599.7 942.5 9.5 9.5 0 0 0 5594.5 941.2 9.7 9.7 0 0 0 5587.9 943.5 6.9 6.9 0 0 0 5585.4 949C5585.4 952 5587.6 954.5 5592.2 956.3L5598.4 958.7A26.4 26.4 0 0 1 5609.6 966.3 16.8 16.8 0 0 1 5613.1 977.1 19.1 19.1 0 0 1 5607.4 991.4 19.7 19.7 0 0 1 5593 997.1 19.2 19.2 0 0 1 5579.5 992.2 22.3 22.3 0 0 1 5572.9 978.6L5582.5 976.5A16.5 16.5 0 0 0 5584.8 984.2 10.8 10.8 0 0 0 5600.7 985.3 10.2 10.2 0 0 0 5603.6 977.7 11 11 0 0 0 5603.1 974.4 9 9 0 0 0 5601.5 971.6 12.9 12.9 0 0 0 5598.7 969.2 27.3 27.3 0 0 0 5594.7 967L5588.6 964.6A17.4 17.4 0 0 1 5575.7 948.9 15.1 15.1 0 0 1 5581.1 937.1 19.5 19.5 0 0 1 5594.6 932.3 18.8 18.8 0 0 1 5611.6 942.8M5623.8 964.5A30.6 30.6 0 0 1 5633.5 941.8 31.8 31.8 0 0 1 5656.8 932.3 32.7 32.7 0 0 1 5689.3 964.9 30.8 30.8 0 0 1 5679.6 987.9 33.1 33.1 0 0 1 5634.4 988.9 30.8 30.8 0 0 1 5623.8 964.6M5633.3 964.7A23.2 23.2 0 0 0 5673 981.7 24.3 24.3 0 0 0 5673 948.1 22.2 22.2 0 0 0 5656.5 941.3 22.4 22.4 0 0 0 5640 948.1 22.6 22.6 0 0 0 5633.2 964.8M5713.1 933.5V987.3H5731.5V996.2H5703.5V933.5ZM5750.4 933.5V971.3A20.8 20.8 0 0 0 5753.1 983.1 14.1 14.1 0 0 0 5775.3 983.1 20.5 20.5 0 0 0 5777.9 971.3V933.5H5787.4V973.8A22.6 22.6 0 0 1 5781.2 990.2 23.8 23.8 0 0 1 5747.1 990.2 22.6 22.6 0 0 1 5740.9 973.8V933.5ZM5822.1 942.4V996.2H5812.6V942.4H5798.2V933.5H5836.5V942.4ZM5871.1 964.5A30.6 30.6 0 0 1 5880.8 941.8 31.8 31.8 0 0 1 5904 932.3 32.7 32.7 0 0 1 5936.6 964.9 30.8 30.8 0 0 1 5926.9 987.9 33.1 33.1 0 0 1 5881.7 988.9 30.8 30.8 0 0 1 5871 964.6M5880.6 964.7A23.2 23.2 0 0 0 5920.2 981.7 24.3 24.3 0 0 0 5920.2 948.1 22.2 22.2 0 0 0 5903.8 941.3 22.4 22.4 0 0 0 5887.2 948.1 22.6 22.6 0 0 0 5880.5 964.8M5950.9 996.2V929.2L5996.6 977.1V933.5H6006.1V1000L5960.4 952.3V996.1ZM6058.9 942.8L6051.3 947.4A13.8 13.8 0 0 0 6047.2 942.5 9.5 9.5 0 0 0 6041.9 941.2 9.7 9.7 0 0 0 6035.4 943.5 6.9 6.9 0 0 0 6032.8 949C6032.8 952 6035.1 954.5 6039.6 956.3L6045.9 958.7A26.4 26.4 0 0 1 6057 966.3 16.8 16.8 0 0 1 6060.5 977.1 19.1 19.1 0 0 1 6054.8 991.4 19.8 19.8 0 0 1 6040.4 997.1 19.2 19.2 0 0 1 6026.9 992.2 22.2 22.2 0 0 1 6020.4 978.6L6030 976.5A16.5 16.5 0 0 0 6032.2 984.2 9.9 9.9 0 0 0 6040.7 988.2 9.7 9.7 0 0 0 6048 985.3 10.1 10.1 0 0 0 6051 977.7 11 11 0 0 0 6050.5 974.4 9 9 0 0 0 6048.9 971.6 12.9 12.9 0 0 0 6046.1 969.2 27.3 27.3 0 0 0 6042 967L6036 964.6A17.4 17.4 0 0 1 6023.2 948.9 15.1 15.1 0 0 1 6028.6 937.1 19.5 19.5 0 0 1 6042 932.3 18.8 18.8 0 0 1 6059 942.8M5307.1 772.3A43.1 43.1 0 0 0 5292 754.6 42 42 0 0 0 5267.6 747.8 55.5 55.5 0 0 0 5245.7 752.3 61 61 0 0 0 5227.1 764.7 68.4 68.4 0 0 0 5213.5 783.5 71.1 71.1 0 0 0 5206.5 807.5 65.9 65.9 0 0 0 5207.7 831.8 49 49 0 0 0 5216.9 850.5 43 43 0 0 0 5232.4 862.7 49.2 49.2 0 0 0 5253.5 867 49.2 49.2 0 0 0 5279 860.1 64.7 64.7 0 0 0 5298.9 841.7L5327.2 860.1A101.6 101.6 0 0 1 5295.8 887 89.4 89.4 0 0 1 5251.4 897.6 90 90 0 0 1 5215.8 890.7 78.4 78.4 0 0 1 5188.5 871.8 75.1 75.1 0 0 1 5172.1 843.2 85.8 85.8 0 0 1 5168.8 807.5 103.1 103.1 0 0 1 5179.8 771.3 99.5 99.5 0 0 1 5201.9 742.7 102.6 102.6 0 0 1 5270.1 717.2 77.9 77.9 0 0 1 5312.2 727.9 73.7 73.7 0 0 1 5338.2 754.7ZM5455.3 892.5H5346.6L5384.6 722.3H5422.1L5391 862.4H5462.2ZM5669.4 843.6A98.2 98.2 0 0 1 5647.5 872 99.3 99.3 0 0 1 5617.3 890.8 97.5 97.5 0 0 1 5580.9 897.6 85.2 85.2 0 0 1 5546 890.6 76.5 76.5 0 0 1 5519.2 871.3 77.4 77.4 0 0 1 5503.3 842.7 83 83 0 0 1 5500.5 807.5 105.7 105.7 0 0 1 5511.2 771.6 98.4 98.4 0 0 1 5563.1 724 97 97 0 0 1 5599.5 717.2 84.4 84.4 0 0 1 5634.4 724.3 76.4 76.4 0 0 1 5677 772.4 82.7 82.7 0 0 1 5679.8 807.5 105.8 105.8 0 0 1 5669.1 843.6M5641.6 784.3A50.6 50.6 0 0 0 5633.7 765.3 40.1 40.1 0 0 0 5618.9 752.5 46.2 46.2 0 0 0 5597.4 747.8 51.9 51.9 0 0 0 5575.2 752.5 59.4 59.4 0 0 0 5557.3 765.3 66.2 66.2 0 0 0 5544.5 784.3 80.3 80.3 0 0 0 5538 807.5 69.2 69.2 0 0 0 5538.7 830.6 50.7 50.7 0 0 0 5546.7 849.5 40.2 40.2 0 0 0 5561.5 862.2 46.2 46.2 0 0 0 5582.9 866.9 52.2 52.2 0 0 0 5605.1 862.2 60.8 60.8 0 0 0 5623.1 849.5 67.1 67.1 0 0 0 5635.8 830.6 78.5 78.5 0 0 0 5642.4 807.5 70.2 70.2 0 0 0 5641.6 784.3M5864.8 834.8A84.6 84.6 0 0 1 5854.8 859.3 76.6 76.6 0 0 1 5813.5 892.7 93.5 93.5 0 0 1 5782.5 897.6 76.3 76.3 0 0 1 5751.1 891.5 62.6 62.6 0 0 1 5728.4 874.9 58.7 58.7 0 0 1 5716 850.5 64.1 64.1 0 0 1 5715.9 821.3Q5722.3 792.1 5726.2 773.1C5728.8 760.5 5730.9 750.8 5732.3 743.9S5734.8 732 5735.4 728.8 5736.4 723.4 5736.5 722.4H5774.8L5752.6 825.4A39.5 39.5 0 0 0 5752.2 840 32.9 32.9 0 0 0 5757.3 853.4 30 30 0 0 0 5768.2 863.2 33.9 33.9 0 0 0 5785 867 41.7 41.7 0 0 0 5800.7 864.1 45.6 45.6 0 0 0 5813.6 856.3 48.7 48.7 0 0 0 5823.2 845.1 42.6 42.6 0 0 0 5828.6 831.5L5853.4 722.3H5891.7ZM6063.9 842.6A90.3 90.3 0 0 1 6042.6 869.4 93.8 93.8 0 0 1 6012.6 886.4 108.4 108.4 0 0 1 5976.1 892.4H5896.7L5934.5 722.2H5993A94.2 94.2 0 0 1 6028.4 728.6 74.2 74.2 0 0 1 6055.1 746.3 71.1 71.1 0 0 1 6071.2 773.2 78.9 78.9 0 0 1 6074.4 807.3 98.4 98.4 0 0 1 6063.8 842.4M6035.4 785.5A44.4 44.4 0 0 0 6027.3 768 39.2 39.2 0 0 0 6012.6 756.4 49.2 49.2 0 0 0 5991.5 752.2H5965.3L5940.8 862.1H5976.8A55 55 0 0 0 5998.4 857.8 63.4 63.4 0 0 0 6016.7 846.1 62.3 62.3 0 0 0 6030 828.6 59.9 59.9 0 0 0 6036.5 807.3 65.7 65.7 0 0 0 6035.5 785.4M5877.9 372.8S5868.5 321.5 5791.5 321.5A102.2 102.2 0 0 0 5714.5 228.1S5701.4 135.9 5642.7 114.9L5844.1 166.3S5881.4 166.3 5877.9 231.6ZM5591.9 98.6L5226.6 0.6S5174.1-7.6 5172.9 40.2 5172.9 312.1 5172.9 312.1 5224.3 228.1 5359.7 243.9C5359.7 243.9 5384.2 98.6 5521.9 165.1A82.7 82.7 0 0 1 5591.9 98.6M5591.3 395S5599.4 347.1 5636.8 360 5739.5 403.1 5739.5 403.1A54 54 0 0 1 5766.2 460.4L5759.6 516.3A27.3 27.3 0 0 1 5719.6 537.4L5600.5 487.1A35 35 0 0 1 5586.5 448.2ZM5441.9 434.5S5448.3 407.5 5469.2 416.2 5526.2 444.5 5526.2 444.5A30.8 30.8 0 0 1 5539.4 478.1L5533.6 509.7A15.6 15.6 0 0 1 5510 520.3L5443.9 487.3A20 20 0 0 1 5437.4 464.5ZM5832.1 408.8S5838.5 381.8 5859.3 390.4 5916.3 418.8 5916.3 418.8A30.9 30.9 0 0 1 5929.5 452.4L5923.7 484A15.6 15.6 0 0 1 5900.1 494.6L5834 461.6A20 20 0 0 1 5827.5 438.8ZM5520.3 255.2S5525.7 232.5 5543.2 239.8 5591.3 263.7 5591.3 263.7A26 26 0 0 1 5602.5 292L5597.6 318.7A13.2 13.2 0 0 1 5577.7 327.6L5522 299.9A16.9 16.9 0 0 1 5516.4 280.6ZM5687.2 300.9S5691.8 281.5 5706.7 287.7 5747.5 308 5747.5 308A22.1 22.1 0 0 1 5757 332.1L5752.8 354.8A11.2 11.2 0 0 1 5735.9 362.3L5688.6 338.7A14.3 14.3 0 0 1 5683.9 322.4ZM5600.9 555S5605.4 535.7 5620.3 541.9 5661.1 562.2 5661.1 562.2A22 22 0 0 1 5670.6 586.2L5666.4 608.9A11.1 11.1 0 0 1 5649.6 616.5L5602.3 592.9A14.3 14.3 0 0 1 5597.6 576.6ZM5403.2 300.9S5407.7 281.5 5422.6 287.7 5463.4 308 5463.4 308A22.1 22.1 0 0 1 5472.9 332.1L5468.7 354.8A11.2 11.2 0 0 1 5451.9 362.3L5404.6 338.7A14.3 14.3 0 0 1 5399.9 322.4ZM5943.5 607.8S5948.1 588.5 5963 594.7 6003.8 615 6003.8 615A22.1 22.1 0 0 1 6013.3 639L6009.1 661.7A11.1 11.1 0 0 1 5992.2 669.2L5944.9 645.7A14.4 14.4 0 0 1 5940.2 629.4ZM5785 603.8S5787.7 592.4 5796.5 596.1 5820.5 608.1 5820.5 608.1A13 13 0 0 1 5826.1 622.2L5823.7 635.6A6.6 6.6 0 0 1 5813.7 640L5785.9 626.1A8.5 8.5 0 0 1 5783.1 616.5ZM5332.2 445.1S5334.9 433.7 5343.7 437.4 5367.7 449.4 5367.7 449.4A13 13 0 0 1 5373.3 463.5L5370.8 476.9A6.6 6.6 0 0 1 5360.9 481.3L5333 467.4A8.4 8.4 0 0 1 5330.3 457.7ZM5261 326.8S5263.7 315.5 5272.5 319.1 5296.5 331.1 5296.5 331.1A13 13 0 0 1 5302.1 345.2L5299.6 358.6A6.6 6.6 0 0 1 5289.7 363L5261.8 349.1A8.4 8.4 0 0 1 5259.1 339.5ZM5218.3 680.7H5212.9C5206.5 680.7 5202.4 678.7 5200.8 674.5A11.8 11.8 0 0 1 5188.6 680.7C5178.1 680.7 5172.9 673.9 5172.9 660.3 5172.9 647 5178.1 640.4 5188.6 640.4H5205.3V664.3C5205.3 670.4 5208 673.4 5213.4 673.4H5218.2ZM5197.4 647.2H5189.1A7.1 7.1 0 0 0 5182.3 650.7 20.4 20.4 0 0 0 5180.7 660.2 21.1 21.1 0 0 0 5182.3 669.7 7 7 0 0 0 5189.1 673.3 6.9 6.9 0 0 0 5195.8 669.7 21 21 0 0 0 5197.5 660.2ZM5190.1 627.8A4.5 4.5 0 0 1 5185.7 632.4 4.5 4.5 0 0 1 5181.6 627.8 4.5 4.5 0 0 1 5185.9 623.2 4.5 4.5 0 0 1 5190.3 627.8M5201.3 627.8A4.6 4.6 0 0 1 5197 632.4 4.5 4.5 0 0 1 5192.8 627.8 4.4 4.4 0 0 1 5197 623.2 4.5 4.5 0 0 1 5201.3 627.8M5238.1 664.9A15.8 15.8 0 0 1 5233.9 676.3 14.8 14.8 0 0 1 5222.6 680.7H5216.3V673.4H5222.2Q5230.3 673.4 5230.3 664.3V643L5238.1 640.5ZM5233.2 693.3A4.3 4.3 0 1 1 5224.7 693.3 4.3 4.3 0 1 1 5233.2 693.3M5268.4 680.7H5259.7A10.4 10.4 0 0 1 5248.8 669.2V625.8L5256.6 623.1V668.9C5256.6 671.8 5257.9 673.2 5260.6 673.2H5268.4ZM5321.5 680.7H5266.3V673.4H5303.3V670.2A45.7 45.7 0 0 0 5301.6 655.5 10.6 10.6 0 0 0 5290.7 647.9 16.4 16.4 0 0 0 5278.2 654.9L5272.6 649.2A24.6 24.6 0 0 1 5290.7 640.5 17.5 17.5 0 0 1 5308 650.2 46.9 46.9 0 0 1 5311.3 670.1V673.1H5321.5ZM5394.5 680.7H5319.6V673.2H5329.4V650.6L5337.2 648.2V673.2H5353.5V646.9L5361.3 644.4V673.3H5377.8V642.9L5385.6 640.5V673.3H5394.5ZM5413.5 664.9A16.2 16.2 0 0 1 5409.3 676.3 14.9 14.9 0 0 1 5398 680.7H5392.7V673.2H5397.6C5402.9 673.2 5405.7 670.2 5405.7 664.1V625.8L5413.5 623.4ZM5432 680.7H5424.2V625.8L5432 623.1ZM5527.1 678.3C5527.1 691.4 5519.8 697.8 5505 697.8A20.9 20.9 0 0 1 5487.1 690.4 40.6 40.6 0 0 1 5481.3 670L5489.2 667.2A31.6 31.6 0 0 0 5492.7 684.8 14.4 14.4 0 0 0 5505.1 689.9 18.8 18.8 0 0 0 5515.3 687.7 10.7 10.7 0 0 0 5519.2 678.4V625.9L5527 623.3ZM5578.7 680.7H5568.9A21.9 21.9 0 0 1 5563.5 692.7 15.2 15.2 0 0 1 5551.6 697.9 17 17 0 0 1 5541.9 695.4L5538.4 687.2A27 27 0 0 0 5551.4 690.4 10.4 10.4 0 0 0 5561.1 680.6H5554.7A16.3 16.3 0 0 1 5541.9 675.3 18.9 18.9 0 0 1 5537.7 662.4 25.8 25.8 0 0 1 5541.3 648.1 14.3 14.3 0 0 1 5554.1 641.5C5564.5 641.5 5569.8 648.5 5569.8 662.4 5569.8 665.2 5569.8 668.8 5569.6 673.3H5578.6ZM5562 662.5A26.2 26.2 0 0 0 5560.9 653.5 6.7 6.7 0 0 0 5554.1 649C5548.4 649 5545.6 653.5 5545.6 662.5 5545.6 669.8 5548.6 673.4 5554.7 673.4H5562ZM5611.8 680.7H5606.4A14.6 14.6 0 0 1 5594.9 675.9 14.2 14.2 0 0 1 5583.3 680.7H5576.7V673.2H5582.8C5588.3 673.2 5591 670.2 5591 664.1V625.8L5598.8 623.1V664.5C5598.8 670.3 5601.5 673.1 5606.9 673.1H5611.7ZM5653.5 680.7H5609.7V673.4H5645.6V670.2A45.5 45.5 0 0 0 5643.8 655.5 10.6 10.6 0 0 0 5633.1 647.9 16.6 16.6 0 0 0 5620.5 654.9L5614.9 649.2A24.7 24.7 0 0 1 5633.1 640.5 17.6 17.6 0 0 1 5650.3 650.2 48.7 48.7 0 0 1 5653.5 670.1ZM6139 744.3A28.9 28.9 0 0 1 6130.3 765.5 29.7 29.7 0 0 1 6088.2 765.5 29 29 0 0 1 6079.5 744.3 27.8 27.8 0 0 1 6082.3 731.7 28.9 28.9 0 0 1 6090.3 721.5 28.5 28.5 0 0 1 6109 714.6 29.2 29.2 0 0 1 6121.4 717.2 28.6 28.6 0 0 1 6134.2 728.1 29.6 29.6 0 0 1 6139 744.4M6109.1 718.9A23.5 23.5 0 0 0 6091.6 726.4 25.8 25.8 0 0 0 6091.6 762.5 24.5 24.5 0 0 0 6126.9 762.5 25.1 25.1 0 0 0 6134.2 744.3 27.6 27.6 0 0 0 6131.4 732.6 24 24 0 0 0 6123.8 723.5 24.9 24.9 0 0 0 6109.1 718.8M6112.2 747.2L6123.4 761.6H6115.4L6105.1 748V761.6H6098.6V727.2H6105.5A17.3 17.3 0 0 1 6116 729.7 9.5 9.5 0 0 1 6119.6 737.4 10.2 10.2 0 0 1 6117.7 743.4 9.4 9.4 0 0 1 6112.7 747ZM6105.1 742.4H6106.2C6110.9 742.4 6113.3 740.7 6113.3 737.5S6111 732.9 6106.5 732.9H6105Z", - "width": 6139 + "path": "M307.3 571.7C305.2 589.1 322 680.9 330.6 716.9 334.8 734 346.1 761.8 342 776.5A153.3 153.3 0 0 0 337.7 839.2C339.7 848.6 346 892 337 907.9A369.5 369.5 0 0 0 323.5 958.9C300.8 999.1 313.6 997.1 313.6 997.1 320.6 1003.2 332.7 997.6 332.7 997.6A15.3 15.3 0 0 0 348.1 996.6 18.9 18.9 0 0 0 365.2 996.1 22.4 22.4 0 0 0 384.2 993C389.9 995 391.3 992.5 391.3 992.5 408.3 991.7 381.8 953.5 381.8 953.5A76.3 76.3 0 0 1 388.1 900C429.5 813.7 431.7 790.8 415.1 758.3 410.4 748.9 409.2 745.2 411.4 741.1 416.3 731.7 412.7 693.9 418.8 678.8 430.5 649.9 442 576.4 448 542.1 456.1 495.9 419.4 434 419.4 434 411.4 408.8 423.1 319 423.1 319 439.6 336.9 439 368.6 439 368.6 436.4 401.9 477.2 452.7 477.2 452.7A118.4 118.4 0 0 1 504.3 495.1C504.3 501.1 502.4 515.8 502.4 515.8L503.2 528.5A129.3 129.3 0 0 1 505.7 548.3C502.6 581.6 510.2 575.3 510.2 575.3 516.5 575.3 523.5 548.5 523.5 548.5 523.5 555.4 521.1 576.1 526.4 583.9 532.7 593.2 537.4 582.3 537.5 580.1 539.2 537.8 542.8 548.9 542.8 548.9 546.3 583.2 550.7 591 558.4 588.3 564.3 586.3 558.9 547.1 558.9 547.1 569 570.4 576.7 574.1 576.7 574.1 593.3 582.3 583 559.6 580.7 555.1A99.2 99.2 0 0 1 568 523C583.4 544.5 595 543.6 595 543.6 610 540.3 581.9 509.9 565.4 495.4A126 126 0 0 1 543 472.2 203.5 203.5 0 0 1 534 430.1C532.4 392.3 519.1 375.9 519.1 375.9 496.3 350.3 492 302.5 492 302.5L491 221.9C483 166.9 425.3 166.5 425.3 166.5 366.9 160.4 358.8 147.2 358.8 147.2 346.4 134.7 353.5 110.8 353.5 110.8A38.7 38.7 0 0 0 367.7 89.4C384.7 80.2 383.9 66.8 376 66.9 369.7 67 371.2 63.4 371.2 63.4 381.9 3.1 305.5 0 305.5 0H293.9S217.5 3.1 228.1 63.4C228.1 63.4 229.6 67.1 223.2 67 215.4 66.8 214.6 80.3 231.6 89.4A38.7 38.7 0 0 0 245.8 110.8S252.9 134.8 240.5 147.2C240.5 147.2 232.4 160.5 174 166.6 174 166.6 116.2 167 108.3 222L107.2 302.6S103 350.3 80.2 375.9C80.2 375.9 66.9 392.4 65.4 430.2A204.8 204.8 0 0 1 56.4 472.3 124.6 124.6 0 0 1 33.9 495.5C17.3 510-10.7 540.2 4.3 543.7 4.3 543.7 16 544.5 31.3 523.1A98.1 98.1 0 0 1 18.7 555.2C16.3 559.6 6 582.3 22.6 574.2 22.6 574.2 30.3 570.4 40.4 547.1 40.4 547.1 35 586.4 41 588.4 48.8 591 53.1 583.3 56.6 548.9 56.6 548.9 60.2 537.8 61.9 580.2 62 582.4 66.5 593.3 72.9 584 78.3 576.2 75.9 555.5 75.9 548.6 75.9 548.6 82.8 575.4 89.2 575.4 89.2 575.4 96.8 581.7 93.7 548.4A119.1 119.1 0 0 1 96.2 528.5L96.9 515.8S95 501.1 95 495.1A118.3 118.3 0 0 1 122.1 452.7S162.9 401.8 160.3 368.6C160.3 368.6 159.7 336.9 176.2 319 176.2 319 187.9 408.8 180 434 180 434 143.2 495.9 151.3 542.1 157.3 576.5 168.8 649.9 180.5 678.8 186.6 693.8 183 731.7 187.9 741.1 190.1 745.2 188.9 749 184.2 758.3 167.7 790.8 169.8 813.7 211.3 900A75.6 75.6 0 0 1 217.6 953.5S191.1 991.7 208.1 992.5C208.1 992.5 209.4 995 215.1 993A22.4 22.4 0 0 0 234.2 996.1 18.8 18.8 0 0 0 251.2 996.6 15.2 15.2 0 0 0 266.7 997.6S278.7 1003.3 285.8 997.1C285.8 997.1 298.5 999.1 275.9 958.9A367.7 367.7 0 0 0 262.5 907.9C253.4 892.1 259.9 848.6 261.8 839.2A155.9 155.9 0 0 0 257.5 776.5C253.3 761.8 264.7 734 268.9 716.9 277.5 680.9 294.3 589.1 292.2 571.7L299.2 573.4A18.3 18.3 0 0 0 307.3 571.7Z", + "width": 599 }, "search": [ - "powered-by-cs" + "obese-bmi-r" ] }, { - "uid": "bf17051ca639c4db6f66b531ae98b29e", - "css": "menu", - "code": 59565, + "uid": "e3578bfad1396ea9b38bd70c249fa1e5", + "css": "inpatient", + "code": 59737, "src": "custom_icons", "selected": true, "svg": { - "path": "", - "width": 3500 + "path": "M970.7 470.7A29.3 29.3 0 0 0 941.5 500V646.3H878A145.5 145.5 0 0 0 735.6 529.2H421.9V557.4L361.6 556.4A149.2 149.2 0 0 0 235.9 525.1 87.8 87.8 0 1 0 64.6 493.3L58.6 489.5V380.8A29.3 29.3 0 0 0 0 380.8V970.7A29.3 29.3 0 0 0 58.6 970.7V824.3H941.5V970.7A29.3 29.3 0 0 0 1000 970.7V500A29.3 29.3 0 0 0 970.7 470.7ZM58.5 646.3V558.5L197.7 646.3ZM294.9 89.9H353.4V148.4H324.1A29.3 29.3 0 0 0 294.9 177.7V236.2A87.8 87.8 0 0 0 470.5 236.2V177.7A29.3 29.3 0 0 0 441.2 148.4H412V89.9H529V470.7H587.6V29.3A29.3 29.3 0 1 0 529 31.2H294.9A29.3 29.3 0 0 0 294.9 89.8Z", + "width": 1000 }, "search": [ - "menu" + "inpatient" ] }, { - "uid": "fbbe1c278b442a4840b03064fe4a2ea4", - "css": "respiration-rate-1", - "code": 59499, + "uid": "1ca5ef3569be282fb05f15395a81d2a0", + "css": "discharge", + "code": 59738, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "M989.3 410.2C907.2 230.7 805.1 123.6 716.1 123.6A91.6 91.6 0 0 0 667.3 137C595.3 181.3 592 319.6 591.9 334.9 591.9 339.7 590.8 377.9 590 431.1L560.9 420.4V20.1A20.3 20.3 0 0 0 540.6-0.2H499.9A20.3 20.3 0 0 0 479.6 20.1V420.4L450.5 431.1C449.7 378 448.7 339.9 448.6 335.3 448.6 319.6 445.2 181.3 373.2 137A91.6 91.6 0 0 0 324.4 123.6C235.5 123.6 133.3 230.8 51.2 410.3-57.1 647.8 39 972 43.2 985.6A20.1 20.1 0 0 0 67.1 999.3 1776.9 1776.9 0 0 0 243.4 946.2C369.2 900.2 434.5 855.1 442.6 808.2A2836.5 2836.5 0 0 0 451.6 473.7L506.5 453.4H534.7L589.6 473.7A2835.8 2835.8 0 0 0 598.6 808.2C606.7 855.1 671.8 900.2 797.8 946.2A1778.4 1778.4 0 0 0 974.1 999.5 20.1 20.1 0 0 0 998 985.7C1001.8 972 1097.9 647.8 989.3 410.2ZM393.1 500.5L249.7 574.6V634.8L260.7 668.2 288.1 694.8A20.3 20.3 0 0 1 260.1 723.7L230.5 695.2 197 732.2A20.3 20.3 0 0 1 167.2 705.1L209.4 658.4V595.3L130.2 636.3A20.3 20.3 0 1 1 111.7 600.5L129.3 591.4 97.8 566.3A20.3 20.3 0 0 1 122.9 534.8L168.5 571.2 278.8 514.3 184.4 442.5A20.3 20.3 0 0 1 208.8 410.4L239.3 433.5 241.9 410.2A20.3 20.3 0 0 1 281.9 414.6L276.5 461.8 318.5 493.7 374.5 464.8A20.3 20.3 0 1 1 393 500.5ZM942.9 566.3L911.4 591.4 929 600.5A20.3 20.3 0 1 1 910.5 636.3L831.4 595.3V658.2L873.7 705A20.3 20.3 0 0 1 843.8 732.1L810.3 695.1 780.8 723.6A20.3 20.3 0 0 1 752.7 694.7L780.1 668.1 791.1 634.7V574.5L647.7 500.4A20.3 20.3 0 1 1 666.2 464.6L722.2 493.6 764.2 461.7 759 414.5A20.3 20.3 0 1 1 799 410L801.6 433.4 832.1 410.2A20.3 20.3 0 0 1 856.5 442.3L761.9 514 872.2 570.9 917.9 534.5A20.3 20.3 0 0 1 943 566Z", + "path": "M985.1 464.6H985.1L535.1 14.6A49.8 49.8 0 0 0 464.8 14.6L14.6 464.6A50.1 50.1 0 0 0 14.6 535.4L464.6 985.1V985.4A50.1 50.1 0 0 0 535.4 985.4L985.3 535.4A49.9 49.9 0 0 0 985.1 464.6ZM599.7 624.9V500H399.7V650H299.7V450A49.8 49.8 0 0 1 349.7 400H599.7V274.9L774.7 449.9Z", + "width": 1000 + }, + "search": [ + "discharge" + ] + }, + { + "uid": "1738fd6466298efa6012247ca0941077", + "css": "order-sheets", + "code": 59739, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M736 84.4A87.2 87.2 0 0 0 673.9 58.6H635V97.6A78.2 78.2 0 0 1 556.9 175.8H205.8A78.2 78.2 0 0 1 127.7 97.6V58.6H88.6A87.9 87.9 0 0 0 0.9 146.4L0 912A87.9 87.9 0 0 0 87.8 1000.1H673A87.9 87.9 0 0 0 760.7 912.3L761.6 146.7A87.4 87.4 0 0 0 736 84.4ZM390.7 351.6H598.7A29.3 29.3 0 0 1 598.7 410.1H390.8A29.3 29.3 0 0 1 390.8 351.6ZM390.7 546.9H598.7A29.3 29.3 0 0 1 598.7 605.5H390.8A29.3 29.3 0 0 1 390.8 546.9ZM390.7 742.2H599.6A29.3 29.3 0 0 1 599.6 800.8H390.7A29.3 29.3 0 0 1 390.7 742.2ZM141.5 352.7A29.2 29.2 0 0 1 182.8 352.7L198.7 368.6 266.2 301.1A29.3 29.3 0 1 1 307.6 342.5L219.4 430.8A29.2 29.2 0 0 1 178.1 430.8L141.6 394.2A29.3 29.3 0 0 1 141.5 352.7ZM141.5 562.9A29.2 29.2 0 0 1 182.8 562.9L198.7 578.8 266.2 511.3A29.3 29.3 0 0 1 307.6 552.7L219.4 641A29.2 29.2 0 0 1 178.1 641L141.6 604.4A29.3 29.3 0 0 1 141.5 562.9ZM141.5 758.2A29.2 29.2 0 0 1 182.8 758.2L198.7 774.2 266.2 706.6A29.3 29.3 0 0 1 307.6 748.1L219.5 836.3A29.2 29.2 0 0 1 178.1 836.3L141.6 799.7A29.3 29.3 0 0 1 141.5 758.2ZM186.2 97.7A19.5 19.5 0 0 0 205.8 117.2H556.9A19.5 19.5 0 0 0 576.4 97.7V19.5A19.5 19.5 0 0 0 556.9 0H205.7A19.5 19.5 0 0 0 186.2 19.5Z", + "width": 762 + }, + "search": [ + "order-sheets" + ] + }, + { + "uid": "37fe23c97ab802ea172b84fc8a0ee196", + "css": "call", + "code": 59740, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M763.9 671.3L986.8 745.6A19.2 19.2 0 0 1 1000 763.8V846.1A153.8 153.8 0 0 1 846.2 1000 846.1 846.1 0 0 1 0 153.6 153.6 153.6 0 0 1 153.6 0H236A19.2 19.2 0 0 1 254.2 13.2L328.7 236A19.2 19.2 0 0 1 321.1 258.1L221.2 324.5A19.7 19.7 0 0 0 213.7 347.6 800 800 0 0 0 652.2 786 19.7 19.7 0 0 0 675.3 778.5L741.8 678.6A19.2 19.2 0 0 1 763.9 671Z", + "width": 1000 + }, + "search": [ + "call" + ] + }, + { + "uid": "ebce1ce36215365ca8c3dd958beaac65", + "css": "medical-report", + "code": 59741, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M764.6 1000H58.8A58.9 58.9 0 0 1 0 941.1V59A58.9 58.9 0 0 1 58.8 0.1H764.6A58.9 58.9 0 0 1 823.5 59V941.3A58.9 58.9 0 0 1 764.6 1000ZM617.4 690.9A112.6 112.6 0 0 0 504.9 803.4 112.6 112.6 0 0 0 617.4 915.9 112.6 112.6 0 0 0 729.9 803.4V795.9H624.8V690.9ZM640.9 659.9V779.9H760.9V772.4A112.6 112.6 0 0 0 648.4 659.9ZM176.6 417.3A29.5 29.5 0 0 0 147.1 446.7 29.5 29.5 0 0 0 176.6 476.2H647.2A29.4 29.4 0 0 0 676.6 446.7 29.4 29.4 0 0 0 647.2 417.3ZM176.6 276.2A29.4 29.4 0 0 0 147.1 305.6 29.5 29.5 0 0 0 176.6 335.1H647.2A29.4 29.4 0 0 0 676.6 305.6 29.4 29.4 0 0 0 647.2 276.2ZM176.6 147.1A29.4 29.4 0 0 0 147.1 176.5 29.5 29.5 0 0 0 176.6 205.9H382.3A29.5 29.5 0 0 0 411.7 176.5 29.4 29.4 0 0 0 382.3 147.1Z", + "width": 823 + }, + "search": [ + "medical-report" + ] + }, + { + "uid": "c8478a11a2d4271b16c1e1f0464ea1ff", + "css": "painscale", + "code": 59742, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M77 120.3L120.2 77 271.7 228.5 228.4 271.8ZM243.6 24.1L299.8 0 364.8 151.4 308.5 175.6ZM0 299.9L24.1 243.6 175.6 308.6 151.4 364.8ZM726 769.4L769.3 726.2 920.7 877.6 877.4 920.9ZM633.1 846.2L689.3 822.1 754.2 973.6 698 997.7ZM822.2 689.5L846.4 633.3 997.8 698.2 973.7 754.5ZM242.5 415.6A122.4 122.4 0 0 1 415.6 588.7 122.4 122.4 0 1 1 415.6 761.8L177.4 1000 4.3 827.1 242.5 588.9A122.4 122.4 0 0 1 242.5 415.8ZM588.7 415.6A122.4 122.4 0 1 1 588.7 242.5L827 4.3 1000.1 177.4 761.7 415.6A122.4 122.4 0 1 1 588.6 415.6Z", + "width": 1000 + }, + "search": [ + "painscale" + ] + }, + { + "uid": "5a0bdc9deb49171daf7251717ac6d715", + "css": "oxygenation", + "code": 59743, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M498.2 186.2A406.9 406.9 0 1 0 905.1 593.1 407.3 407.3 0 0 0 498.2 186.2ZM498.2 926.9A333.9 333.9 0 1 1 832.1 593 334.3 334.3 0 0 1 498.2 927.1ZM380.8 421A161 161 0 0 0 261.9 463.9 161.5 161.5 0 0 0 219.1 583.5 177.3 177.3 0 0 0 240.7 675 131.7 131.7 0 0 0 297 728.4 201.4 201.4 0 0 0 384.8 745.2 176.5 176.5 0 0 0 472 725.7 133 133 0 0 0 525.5 671 193.7 193.7 0 0 0 544 580.8 158.4 158.4 0 0 0 501.6 463 164 164 0 0 0 380.8 421ZM429.8 652.4A59.8 59.8 0 0 1 381.5 672.7 59.6 59.6 0 0 1 333.5 652 105 105 0 0 1 315.8 583.7 105.3 105.3 0 0 1 333.8 514.9 58.9 58.9 0 0 1 380.8 494.1 61.3 61.3 0 0 1 429.3 514.6 97 97 0 0 1 447.2 579.3 116.6 116.6 0 0 1 430 652.4ZM650.7 682.9C654.7 679.8 662.4 672.9 674.1 664.7A154.2 154.2 0 0 0 714.3 626.2 67.5 67.5 0 0 0 725.3 589.8 57.1 57.1 0 0 0 689 536.1 128.1 128.1 0 0 0 641.6 529 115.3 115.3 0 0 0 595.9 536.3 56.8 56.8 0 0 0 570.4 557.2 91.8 91.8 0 0 0 558 595.2L615.8 600A42.6 42.6 0 0 1 625.2 575.4 26.8 26.8 0 0 1 660.9 575.2 21.6 21.6 0 0 1 667.9 591.4 32.1 32.1 0 0 1 660.8 609.9 169.6 169.6 0 0 1 628.3 638.5 247.6 247.6 0 0 0 571.8 689.1 384.4 384.4 0 0 0 553.6 734.7H711.6V698.3H637.1C642.2 698.3 646.8 686.1 650.7 682.9Z", "width": 1041 }, "search": [ - "respiration-rate" + "oxygenation" ] }, { - "uid": "bffd96d1421ef42e3a097855b3820d42", - "css": "obese-bmi-r", - "code": 59508, + "uid": "169c700bad100df58cf4c5f69c96a27e", + "css": "speechtotext", + "code": 59744, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "M307.3 571.7C305.2 589.1 322 680.9 330.6 716.9 334.8 734 346.1 761.8 342 776.5A153.3 153.3 0 0 0 337.7 839.2C339.7 848.6 346 892 337 907.9A369.5 369.5 0 0 0 323.5 958.9C300.8 999.1 313.6 997.1 313.6 997.1 320.6 1003.2 332.7 997.6 332.7 997.6A15.3 15.3 0 0 0 348.1 996.6 18.9 18.9 0 0 0 365.2 996.1 22.4 22.4 0 0 0 384.2 993C389.9 995 391.3 992.5 391.3 992.5 408.3 991.7 381.8 953.5 381.8 953.5A76.3 76.3 0 0 1 388.1 900C429.5 813.7 431.7 790.8 415.1 758.3 410.4 748.9 409.2 745.2 411.4 741.1 416.3 731.7 412.7 693.9 418.8 678.8 430.5 649.9 442 576.4 448 542.1 456.1 495.9 419.4 434 419.4 434 411.4 408.8 423.1 319 423.1 319 439.6 336.9 439 368.6 439 368.6 436.4 401.9 477.2 452.7 477.2 452.7A118.4 118.4 0 0 1 504.3 495.1C504.3 501.1 502.4 515.8 502.4 515.8L503.2 528.5A129.3 129.3 0 0 1 505.7 548.3C502.6 581.6 510.2 575.3 510.2 575.3 516.5 575.3 523.5 548.5 523.5 548.5 523.5 555.4 521.1 576.1 526.4 583.9 532.7 593.2 537.4 582.3 537.5 580.1 539.2 537.8 542.8 548.9 542.8 548.9 546.3 583.2 550.7 591 558.4 588.3 564.3 586.3 558.9 547.1 558.9 547.1 569 570.4 576.7 574.1 576.7 574.1 593.3 582.3 583 559.6 580.7 555.1A99.2 99.2 0 0 1 568 523C583.4 544.5 595 543.6 595 543.6 610 540.3 581.9 509.9 565.4 495.4A126 126 0 0 1 543 472.2 203.5 203.5 0 0 1 534 430.1C532.4 392.3 519.1 375.9 519.1 375.9 496.3 350.3 492 302.5 492 302.5L491 221.9C483 166.9 425.3 166.5 425.3 166.5 366.9 160.4 358.8 147.2 358.8 147.2 346.4 134.7 353.5 110.8 353.5 110.8A38.7 38.7 0 0 0 367.7 89.4C384.7 80.2 383.9 66.8 376 66.9 369.7 67 371.2 63.4 371.2 63.4 381.9 3.1 305.5 0 305.5 0H293.9S217.5 3.1 228.1 63.4C228.1 63.4 229.6 67.1 223.2 67 215.4 66.8 214.6 80.3 231.6 89.4A38.7 38.7 0 0 0 245.8 110.8S252.9 134.8 240.5 147.2C240.5 147.2 232.4 160.5 174 166.6 174 166.6 116.2 167 108.3 222L107.2 302.6S103 350.3 80.2 375.9C80.2 375.9 66.9 392.4 65.4 430.2A204.8 204.8 0 0 1 56.4 472.3 124.6 124.6 0 0 1 33.9 495.5C17.3 510-10.7 540.2 4.3 543.7 4.3 543.7 16 544.5 31.3 523.1A98.1 98.1 0 0 1 18.7 555.2C16.3 559.6 6 582.3 22.6 574.2 22.6 574.2 30.3 570.4 40.4 547.1 40.4 547.1 35 586.4 41 588.4 48.8 591 53.1 583.3 56.6 548.9 56.6 548.9 60.2 537.8 61.9 580.2 62 582.4 66.5 593.3 72.9 584 78.3 576.2 75.9 555.5 75.9 548.6 75.9 548.6 82.8 575.4 89.2 575.4 89.2 575.4 96.8 581.7 93.7 548.4A119.1 119.1 0 0 1 96.2 528.5L96.9 515.8S95 501.1 95 495.1A118.3 118.3 0 0 1 122.1 452.7S162.9 401.8 160.3 368.6C160.3 368.6 159.7 336.9 176.2 319 176.2 319 187.9 408.8 180 434 180 434 143.2 495.9 151.3 542.1 157.3 576.5 168.8 649.9 180.5 678.8 186.6 693.8 183 731.7 187.9 741.1 190.1 745.2 188.9 749 184.2 758.3 167.7 790.8 169.8 813.7 211.3 900A75.6 75.6 0 0 1 217.6 953.5S191.1 991.7 208.1 992.5C208.1 992.5 209.4 995 215.1 993A22.4 22.4 0 0 0 234.2 996.1 18.8 18.8 0 0 0 251.2 996.6 15.2 15.2 0 0 0 266.7 997.6S278.7 1003.3 285.8 997.1C285.8 997.1 298.5 999.1 275.9 958.9A367.7 367.7 0 0 0 262.5 907.9C253.4 892.1 259.9 848.6 261.8 839.2A155.9 155.9 0 0 0 257.5 776.5C253.3 761.8 264.7 734 268.9 716.9 277.5 680.9 294.3 589.1 292.2 571.7L299.2 573.4A18.3 18.3 0 0 0 307.3 571.7Z", - "width": 599 + "path": "M499.8 132A97.3 97.3 0 0 1 597 229.1V248.1A102.7 102.7 0 0 1 708.8 292.8 98.7 98.7 0 0 1 714 388.3L775.6 461.6A281 281 0 0 0 859.7 261.2V261.2A261 261 0 0 0 598.7 0H317.4V60.6A142.4 142.4 0 0 0 336.6 132ZM816.3 680.9L506.4 787.5 439 1000H1001.6A365.8 365.8 0 0 0 816.3 680.9ZM514.7 722.7L769.6 635 749 552.7A92.8 92.8 0 0 1 747.1 518.5L639.5 390.9 655.3 372A41.8 41.8 0 0 0 614 304.4L538.4 321.9V229.1A38.6 38.6 0 0 0 499.9 190.6H359.1V272.6L275.7 411.6 317.4 453.3V488.2L400.4 522.6 325.7 579.1 332 613.1A41.6 41.6 0 0 0 380 646.6L505.6 625ZM231.1 479.7A81.3 81.3 0 0 0 231.1 594.4L272.5 553A22.6 22.6 0 0 1 272.5 521.1ZM157.7 406.3A185 185 0 0 0 157.7 667.7L199.1 626.2A126.4 126.4 0 0 1 199.1 447.7ZM125.8 374.5L84.4 333.1A288.8 288.8 0 0 0 84.4 741.1L125.8 699.7A230.2 230.2 0 0 1 125.8 374.5Z", + "width": 1002 }, "search": [ - "obese-bmi-r" + "speechtotext" ] }, { - "uid": "328db07d0698d682a7598bc691b02556", - "css": "menu-2", - "code": 59566, + "uid": "4c794fd235deed1e405c7a0d77262155", + "css": "search-medicines", + "code": 59748, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "", - "width": 3500 + "path": "M299 341.8L384.4 427.2 341.6 470A60.5 60.5 0 1 1 256.1 384.6ZM384.6 256.1A60.5 60.5 0 1 1 470 341.6L427.3 384.7 341.8 299.2ZM363.2 0A362.9 362.9 0 0 1 640.3 597.5L747.7 704.9 704.9 747.7 597.5 640.3A363.1 363.1 0 1 1 363.2 0ZM213.3 512.9A121.2 121.2 0 0 0 384.6 512.9L513 384.5A121.1 121.1 0 1 0 341.8 213.3L213.4 341.9A121.2 121.2 0 0 0 213.4 513.1ZM998.2 914.4L811 727.3 725.4 812.9 912.6 1000Z", + "width": 998 }, "search": [ - "menu" + "search-medicines" ] }, { - "uid": "0cc603ffdc0374e97a75a762f3a21b10", - "css": "menu-1", - "code": 59567, + "uid": "deaae97b03da57c5c739ce04877b4d6e", + "css": "discharge-patients", + "code": 59749, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "", - "width": 3500 + "path": "M44.4 4.2A29.3 29.3 0 0 0 0 29.3V794.9A29.3 29.3 0 0 0 14.2 820.1L248.6 995.9A29.3 29.3 0 0 0 293 970.8V205.1A29.3 29.3 0 0 0 278.8 180ZM205 587.9A29.3 29.3 0 1 1 234.3 558.6 29.3 29.3 0 0 1 205 587.9ZM205 587.9M807.3 329.1A29.3 29.3 0 0 0 761.7 353.5V382.8H498A29.3 29.3 0 0 0 468.8 412.1V470.7A29.3 29.3 0 0 0 498 500H761.7V529.3A29.3 29.3 0 0 0 807.3 553.7L924.4 465.8A29.3 29.3 0 0 0 924.4 417.1ZM807.3 329.1M410.2 470.7V412.1A88 88 0 0 1 498 324.2H644.5V29.3A29.3 29.3 0 0 0 615.3 0H136.4L312.2 131.8A88.4 88.4 0 0 1 351.6 205.1V824.2H615.3A29.3 29.3 0 0 0 644.5 794.9V558.6H498A88 88 0 0 1 410.2 470.7ZM410.2 470.7", + "width": 938 }, "search": [ - "menu" + "discharge-patients" ] }, { - "uid": "8fcf1c5195ef14fb32d53dc5f583ef40", - "css": "menu-3", - "code": 59568, + "uid": "1c6f710dc04109a0329ee1f833784815", + "css": "referral-discharge", + "code": 59750, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M681.4 793.1L735.5 860.8 683 913.3 659.1 793.7C663.5 793.4 667.9 793.1 672.4 793.1ZM791.7 793.1L758.6 834.3 725.6 793.1ZM835.9 793.1H844.8C849.3 793.1 853.7 793.4 858.1 793.7L834.2 913.3 781.7 860.8ZM913.8 655.1H912.8A154.1 154.1 0 0 0 913.8 637.9V586.2A34.5 34.5 0 0 1 913.8 655.1ZM603.4 482.7A103.6 103.6 0 0 1 706.9 379.3H810.3A103.6 103.6 0 0 1 913.8 482.8V551.7H844.8A34.5 34.5 0 0 1 810.3 517.2V448.3H775.9V465.5A86.3 86.3 0 0 1 689.7 551.7H603.5ZM603.4 655.1A34.5 34.5 0 1 1 603.4 586.2V637.9A154.1 154.1 0 0 0 604.4 655.1ZM637.9 637.9V586.2H689.6A120.4 120.4 0 0 0 781.2 543.9 69 69 0 0 0 844.7 586.2H879.2V637.9A120.6 120.6 0 0 1 637.9 637.9ZM1000 1000H517.2V948.3A155.6 155.6 0 0 1 625.2 800.5L655.4 951.7A17.3 17.3 0 0 0 667.3 964.8 17.6 17.6 0 0 0 672.3 965.5 17.3 17.3 0 0 0 684.5 960.4L758.5 886.4 832.5 960.5A17.2 17.2 0 0 0 861.7 951.7L891.9 800.5A155.6 155.6 0 0 1 999.8 948.3ZM164.1 413.8L218.3 481.5 165.7 534 141.8 414.5C146.3 414.1 150.7 413.8 155.2 413.8ZM274.5 413.8L241.4 455 208.3 413.8ZM318.6 413.8H327.6C332.1 413.8 336.5 414.1 340.9 414.4L317 534 264.5 481.5ZM396.5 275.8H395.5A154 154 0 0 0 396.5 258.6V206.9A34.5 34.5 0 0 1 396.5 275.8ZM86.2 103.5A103.6 103.6 0 0 1 189.7 0H293.1A103.6 103.6 0 0 1 396.6 103.5V172.4H327.6A34.5 34.5 0 0 1 293.1 137.9V69H258.6V86.2A86.3 86.3 0 0 1 172.4 172.4H86.2ZM86.2 275.9A34.5 34.5 0 1 1 86.2 206.9V258.6A154 154 0 0 0 87.2 275.9ZM120.6 258.6V206.9H172.4A120.4 120.4 0 0 0 264 164.6 69 69 0 0 0 327.5 206.9H362V258.6A120.6 120.6 0 1 1 120.7 258.6ZM482.8 620.7H0V569A155.6 155.6 0 0 1 107.9 421.2L138.2 572.3A17.3 17.3 0 0 0 150.1 585.5 17.6 17.6 0 0 0 155.1 586.2 17.3 17.3 0 0 0 167.3 581.1L241.3 507.1 315.3 581.2A17.2 17.2 0 0 0 344.4 572.3L374.7 421.2A155.6 155.6 0 0 1 482.6 569ZM172.4 827.6A17.2 17.2 0 0 0 155.2 810.3H127.8L206.8 731.3 286.1 810.2H258.8A17.2 17.2 0 0 0 241.6 827.4 206.9 206.9 0 0 0 333.6 999.5 172.6 172.6 0 0 1 172.4 827.6ZM816 71.1A20.5 20.5 0 0 0 784.2 88.1V108.6H599.9A20.5 20.5 0 0 0 579.5 129.1V170A20.5 20.5 0 0 0 599.9 190.5H784.2V211A20.5 20.5 0 0 0 816 228L897.9 166.6A20.5 20.5 0 0 0 897.9 132.5ZM816 71.1", + "width": 1000 + }, + "search": [ + "referral-discharge" + ] + }, + { + "uid": "fbbe1c278b442a4840b03064fe4a2ea4", + "css": "respiration-rate-1", + "code": 59499, "src": "custom_icons", "selected": false, "svg": { - "path": "", - "width": 3500 + "path": "M989.3 410.2C907.2 230.7 805.1 123.6 716.1 123.6A91.6 91.6 0 0 0 667.3 137C595.3 181.3 592 319.6 591.9 334.9 591.9 339.7 590.8 377.9 590 431.1L560.9 420.4V20.1A20.3 20.3 0 0 0 540.6-0.2H499.9A20.3 20.3 0 0 0 479.6 20.1V420.4L450.5 431.1C449.7 378 448.7 339.9 448.6 335.3 448.6 319.6 445.2 181.3 373.2 137A91.6 91.6 0 0 0 324.4 123.6C235.5 123.6 133.3 230.8 51.2 410.3-57.1 647.8 39 972 43.2 985.6A20.1 20.1 0 0 0 67.1 999.3 1776.9 1776.9 0 0 0 243.4 946.2C369.2 900.2 434.5 855.1 442.6 808.2A2836.5 2836.5 0 0 0 451.6 473.7L506.5 453.4H534.7L589.6 473.7A2835.8 2835.8 0 0 0 598.6 808.2C606.7 855.1 671.8 900.2 797.8 946.2A1778.4 1778.4 0 0 0 974.1 999.5 20.1 20.1 0 0 0 998 985.7C1001.8 972 1097.9 647.8 989.3 410.2ZM393.1 500.5L249.7 574.6V634.8L260.7 668.2 288.1 694.8A20.3 20.3 0 0 1 260.1 723.7L230.5 695.2 197 732.2A20.3 20.3 0 0 1 167.2 705.1L209.4 658.4V595.3L130.2 636.3A20.3 20.3 0 1 1 111.7 600.5L129.3 591.4 97.8 566.3A20.3 20.3 0 0 1 122.9 534.8L168.5 571.2 278.8 514.3 184.4 442.5A20.3 20.3 0 0 1 208.8 410.4L239.3 433.5 241.9 410.2A20.3 20.3 0 0 1 281.9 414.6L276.5 461.8 318.5 493.7 374.5 464.8A20.3 20.3 0 1 1 393 500.5ZM942.9 566.3L911.4 591.4 929 600.5A20.3 20.3 0 1 1 910.5 636.3L831.4 595.3V658.2L873.7 705A20.3 20.3 0 0 1 843.8 732.1L810.3 695.1 780.8 723.6A20.3 20.3 0 0 1 752.7 694.7L780.1 668.1 791.1 634.7V574.5L647.7 500.4A20.3 20.3 0 1 1 666.2 464.6L722.2 493.6 764.2 461.7 759 414.5A20.3 20.3 0 1 1 799 410L801.6 433.4 832.1 410.2A20.3 20.3 0 0 1 856.5 442.3L761.9 514 872.2 570.9 917.9 534.5A20.3 20.3 0 0 1 943 566Z", + "width": 1041 }, "search": [ - "menu" + "respiration-rate" ] } ] diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 881b4b22..5e5ce23a 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -261,8 +261,6 @@ class DoctorApp { IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData ovrweight_bmi_1 = IconData(0xe875, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData powered_by_cs_1 = - IconData(0xe876, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData qr_code_3 = IconData(0xe877, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData reschedule__1 = @@ -359,8 +357,28 @@ class DoctorApp { IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); - // static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); - // static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu = - IconData(0xe8ad, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData obese_bmi_r_1 = + IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData inpatient = + IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge = + IconData(0xe95a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_sheets = + IconData(0xe95b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData call = + IconData(0xe95c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medical_report = + IconData(0xe95d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData painscale = + IconData(0xe95e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData oxygenation = + IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData speechtotext = + IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_medicines = + IconData(0xe964, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patients = + IconData(0xe965, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_discharge = + IconData(0xe966, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 15975f95..99e1694f 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,19 +1,13 @@ import 'package:doctor_app_flutter/screens/QR_reader_screen.dart'; -import 'package:doctor_app_flutter/screens/home/home_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; -import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; -import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; +import 'package:doctor_app_flutter/screens/home/home_screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; - -import 'icons_app/doctor_app_icons.dart'; class LandingPage extends StatefulWidget { @override @@ -51,7 +45,8 @@ class _LandingPageState extends State { leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Icon(DoctorApp.drawer_icon), + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), iconSize: 15, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), diff --git a/lib/locator.dart b/lib/locator.dart index 1e688d96..13b51d95 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; @@ -15,31 +14,38 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_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/DischargedPatientService.dart'; import 'core/service/InsuranceCardService.dart'; +import 'core/service/MyReferralPatientService.dart'; import 'core/service/PatientMuseService.dart'; +import 'core/service/ReferralService.dart'; import 'core/service/SOAP_service.dart'; -import 'core/service/labs_service.dart'; -import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; +import 'core/service/labs_service.dart'; import 'core/service/medicine_service.dart'; +import 'core/service/patient-admission-request-service.dart'; +import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; -import 'core/service/patient-doctor-referral-service.dart'; +import 'core/service/patient/out_patient_service.dart'; +import 'core/service/patientInPatientService.dart'; import 'core/service/prescriptions_service.dart'; import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; import 'core/service/referred_patient_service.dart'; import 'core/service/schedule_service.dart'; +import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; +import 'core/viewModel/PatientSearchViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/labs_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; 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/patient-referral-viewmodel.dart'; import 'core/viewModel/prescriptions_view_model.dart'; import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; @@ -73,6 +79,11 @@ void setupLocator() { locator.registerLazySingleton(() => InsuranceCardService()); locator.registerLazySingleton(() => RadiologyService()); locator.registerLazySingleton(() => PrescriptionsService()); + locator.registerLazySingleton(() => ReferralService()); + locator.registerLazySingleton(() => MyReferralInPatientService()); + locator.registerLazySingleton(() => DischargedPatientService()); + locator.registerLazySingleton(() => PatientInPatientService()); + locator.registerLazySingleton(() => OutPatientService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -97,4 +108,6 @@ void setupLocator() { locator.registerFactory(() => InsuranceViewModel()); locator.registerFactory(() => RadiologyViewModel()); locator.registerFactory(() => PrescriptionsViewModel()); + locator.registerFactory(() => DischargedPatientViewModel()); + locator.registerFactory(() => PatientSearchViewModel()); } diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 5418c357..d56e637c 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -36,5 +36,6 @@ enum vitalSignDetails { heart, PainScale, Weight, - Height + Height, + Oxygenation, } diff --git a/lib/main.dart b/lib/main.dart index b5e8414d..4e140920 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -8,10 +9,10 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import './config/size_config.dart'; -import 'core/viewModel/auth_view_model.dart'; -import 'core/viewModel/hospital_view_model.dart'; import './routes.dart'; import 'config/config.dart'; +import 'core/viewModel/auth_view_model.dart'; +import 'core/viewModel/hospital_view_model.dart'; import 'locator.dart'; void main() async { @@ -42,6 +43,10 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider( create: (context) => LiveCareViewModel(), ), + StreamProvider.value( + value: RobotProvider().intStream(), + initialData: RobotProvider().setValue({}), + ) ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index 32c3f04a..9b64e588 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; class ListDoctorWorkingHoursTable { DateTime date; @@ -15,7 +15,7 @@ class ListDoctorWorkingHoursTable { }); ListDoctorWorkingHoursTable.fromJson(Map json) { - date = Helpers.convertStringToDate(json['Date']); + date = DateUtils.convertStringToDate(json['Date']); dayName = json['DayName']; workingHours = json['WorkingHours']; projectName = json['ProjectName']; diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index b6c5cc2a..33a314e3 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -70,7 +70,7 @@ class ListGtMyPatientsQuestions { patientID = json['PatientID']; doctorID = json['DoctorID']; requestType = json['RequestType']; - requestDate = Helpers.convertStringToDate(json['RequestDate']) ; + requestDate = DateUtils.convertStringToDate(json['RequestDate']) ; requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; diff --git a/lib/models/doctor/request_schedule.dart b/lib/models/doctor/request_schedule.dart index 949f07eb..03bafeca 100644 --- a/lib/models/doctor/request_schedule.dart +++ b/lib/models/doctor/request_schedule.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/config/config.dart'; + class RequestSchedule { int projectID; diff --git a/lib/models/patient/lab_orders/lab_orders_res_model.dart b/lib/models/patient/lab_orders/lab_orders_res_model.dart index 48d3dc27..893b49ae 100644 --- a/lib/models/patient/lab_orders/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders/lab_orders_res_model.dart @@ -1,11 +1,6 @@ -/* - *@author: Elham Rababah - *@Date:6/5/2020 - *@param: - *@return:LabOrdersResModel - *@desc: LabOrdersResModel class - */ -import 'package:doctor_app_flutter/util/helpers.dart'; + + +import 'package:doctor_app_flutter/util/date-utils.dart'; class LabOrdersResModel { String setupID; @@ -67,7 +62,7 @@ class LabOrdersResModel { status = json['Status']; createdBy = json['CreatedBy']; createdByN = json['CreatedByN']; - createdOn = Helpers.convertStringToDate(json['CreatedOn']); + createdOn = DateUtils.convertStringToDate(json['CreatedOn']); editedBy = json['EditedBy']; editedByN = json['EditedByN']; editedOn = json['EditedOn']; diff --git a/lib/models/patient/my_referral/my_referral_patient_model.dart b/lib/models/patient/my_referral/my_referral_patient_model.dart index e18dd546..ab14a82f 100644 --- a/lib/models/patient/my_referral/my_referral_patient_model.dart +++ b/lib/models/patient/my_referral/my_referral_patient_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; class MyReferralPatientModel { int projectID; @@ -142,7 +142,7 @@ class MyReferralPatientModel { referralResponseOn = json['ReferralResponseOn']; priority = json['Priority']; frequency = json['Frequency']; - mAXResponseTime = Helpers.convertStringToDate(json['MAXResponseTime']); + mAXResponseTime = DateUtils.convertStringToDate(json['MAXResponseTime']); age = json['Age']; frequencyDescription = json['FrequencyDescription']; genderDescription = json['GenderDescription']; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index f7d48c60..44a427f7 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -1,6 +1,4 @@ -import 'dart:convert'; -import 'package:doctor_app_flutter/util/helpers.dart'; class MyReferredPatientModel { String rowID; @@ -62,8 +60,11 @@ class MyReferredPatientModel { String nursingStationName; String priorityDescription; String referringClinicDescription; + String referralDoctorName; + String referralClinicDescription; String referringDoctorName; bool isReferralDoctorSameBranch; + String referralStatusDesc; MyReferredPatientModel({ this.rowID, @@ -127,6 +128,8 @@ class MyReferredPatientModel { this.referringClinicDescription, this.referringDoctorName, this.isReferralDoctorSameBranch, + this.referralDoctorName, + this.referralClinicDescription,this.referralStatusDesc }); MyReferredPatientModel.fromJson(Map json) { @@ -190,6 +193,9 @@ class MyReferredPatientModel { priorityDescription = json['PriorityDescription']; referringClinicDescription = json['ReferringClinicDescription']; referringDoctorName = json['ReferringDoctorName']; + referralDoctorName = json['ReferralDoctorName']; + referralClinicDescription = json['ReferralClinicDescription']; + referralStatusDesc = json['ReferralStatusDesc']; } Map toJson() { @@ -254,6 +260,8 @@ class MyReferredPatientModel { data['PriorityDescription'] = this.priorityDescription; data['ReferringClinicDescription'] = this.referringClinicDescription; data['ReferringDoctorName'] = this.referringDoctorName; + data['ReferralDoctorName'] = this.referralDoctorName; + data['ReferralClinicDescription'] = this.referralClinicDescription; return data; } } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 8903791c..2dec82d1 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -11,8 +11,8 @@ class PatiantInformtion { String arrivedOn; int clinicGroupId; String companyName; - Null dischargeStatus; - Null doctorDetails; + dynamic dischargeStatus; + dynamic doctorDetails; int doctorId; String endTime; int episodeNo; @@ -60,6 +60,8 @@ class PatiantInformtion { int patientStatusType; int visitTypeId; String startTimes; + String dischargeDate; + int status; PatiantInformtion( {this.patientDetails, this.projectId, @@ -119,7 +121,7 @@ class PatiantInformtion { this.nationalityFlagURL, this.patientStatusType, this.visitTypeId, - this.startTimes}); + this.startTimes,this.dischargeDate,this.status}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -172,28 +174,30 @@ class PatiantInformtion { genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"], + startTime: json["startTime"]??json['StartTime'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], - appointmentTypeId: json['appointmentTypeId'], - arrivedOn: json['arrivedOn'], + appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], + arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], dischargeStatus: json['dischargeStatus'], doctorDetails: json['doctorDetails'], endTime: json['endTime'], - episodeNo: json['episodeNo'] ?? json['EpisodeID'], + episodeNo: json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'], fallRiskScore: json['fallRiskScore'], isSigned: json['isSigned'], medicationOrders: json['medicationOrders'], nationality: json['nationality'] ?? json['NationalityNameN'], patientMRN: json['patientMRN'] ?? json['PatientMRN'], - visitType: json['visitType'] ?? json['visitType'], + visitType: json['visitType'] ?? json['visitType']?? json['visitType'], nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], patientStatusType: - json['patientStatusType'] ?? json['patientStatusType'], - visitTypeId: json['visitTypeId'] ?? json['visitTypeId'], + json['patientStatusType'] ?? json['PatientStatusType'], + visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], + dischargeDate: json['DischargeDate'] , + status: json['Status'] , ); } diff --git a/lib/models/patient/prescription/prescription_report_for_in_patient.dart b/lib/models/patient/prescription/prescription_report_for_in_patient.dart index 9b88279e..8e643866 100644 --- a/lib/models/patient/prescription/prescription_report_for_in_patient.dart +++ b/lib/models/patient/prescription/prescription_report_for_in_patient.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionReportForInPatient { int admissionNo; @@ -125,7 +125,7 @@ class PrescriptionReportForInPatient { orderNo = json['OrderNo']; patientID = json['PatientID']; pharmacyRemarks = json['PharmacyRemarks']; - prescriptionDatetime = Helpers.convertStringToDate(json['PrescriptionDatetime']); + prescriptionDatetime = DateUtils.convertStringToDate(json['PrescriptionDatetime']); prescriptionNo = json['PrescriptionNo']; processedBy = json['ProcessedBy']; projectID = json['ProjectID']; @@ -138,11 +138,11 @@ class PrescriptionReportForInPatient { routeId = json['RouteId']; routeN = json['RouteN']; setupID = json['SetupID']; - startDatetime = Helpers.convertStringToDate(json['StartDatetime']) ; + startDatetime = DateUtils.convertStringToDate(json['StartDatetime']) ; status = json['Status']; statusDescription = json['StatusDescription']; statusDescriptionN = json['StatusDescriptionN']; - stopDatetime = Helpers.convertStringToDate(json['StopDatetime']); + stopDatetime = DateUtils.convertStringToDate(json['StopDatetime']); unitofMeasurement = json['UnitofMeasurement']; unitofMeasurementDescription = json['UnitofMeasurementDescription']; unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; diff --git a/lib/models/patient/request_my_referral_patient_model.dart b/lib/models/patient/request_my_referral_patient_model.dart index adaf9e5c..219b7b2a 100644 --- a/lib/models/patient/request_my_referral_patient_model.dart +++ b/lib/models/patient/request_my_referral_patient_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/config/config.dart'; + class RequestMyReferralPatientModel { int projectID; diff --git a/lib/models/patient/vital_sign/patient-vital-sign-history.dart b/lib/models/patient/vital_sign/patient-vital-sign-history.dart index 40ff5d00..e5f5abd0 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-history.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-history.dart @@ -35,7 +35,7 @@ class VitalSignHistory { var triageCategory; var gCScore; var lineItemNo; - DateTime vitalSignDate; + var vitalSignDate; var actualTimeTaken; var sugarLevel; var fBS; diff --git a/lib/models/patient/vital_sign/vital_sign_res_model.dart b/lib/models/patient/vital_sign/vital_sign_res_model.dart index de96bb45..09bb1797 100644 --- a/lib/models/patient/vital_sign/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign/vital_sign_res_model.dart @@ -5,7 +5,7 @@ *@return:VitalSignResModel *@desc: VitalSignResModel class */ -import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; class VitalSignResModel { var transNo; @@ -170,7 +170,7 @@ class VitalSignResModel { triageCategory = json['TriageCategory']; gCScore = json['GCScore']; lineItemNo = json['LineItemNo']; - vitalSignDate = json['VitalSignDate'] !=null? Helpers.convertStringToDate(json['VitalSignDate']): new DateTime.now(); + vitalSignDate = json['VitalSignDate'] !=null? DateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now(); actualTimeTaken = json['ActualTimeTaken']; sugarLevel = json['SugarLevel']; fBS = json['FBS']; diff --git a/lib/root_page.dart b/lib/root_page.dart index fe35a246..3bd24a81 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -5,7 +5,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'config/config.dart'; import 'landing_page.dart'; class RootPage extends StatelessWidget { diff --git a/lib/routes.dart b/lib/routes.dart index 502b3be6..91c3eaed 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -4,94 +4,49 @@ import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen.dart'; - +import 'package:doctor_app_flutter/screens/patients/profile/note/progress_note_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/prescription_screen_history.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; -import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; -import './screens/QR_reader_screen.dart'; -import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; import './screens/auth/verification_methods_screen.dart'; -import './screens/auth/verify_account_screen.dart'; -import './screens/blood_bank_screen.dart'; -import './screens/doctor/message_screen.dart'; -import './screens/doctor/my_schedule_screen.dart'; -import './screens/doctor/services_screen.dart'; -import './screens/medicine/medicine_search_screen.dart'; -import './screens/medicine/pharmacies_list_screen.dart'; -import './screens/patients/patient_search_screen.dart'; -import './screens/patients/patients_referred_screen.dart'; import './screens/patients/patients_screen.dart'; -import './screens/patients/profile/insurance_approvals_screen.dart'; -import './screens/patients/profile/lab_result/lab_orders_screen.dart'; -import './screens/patients/profile/patient_orders_screen.dart'; import './screens/patients/profile/patient_profile_screen.dart'; -import './screens/patients/profile/prescriptions/prescriptions_screen.dart'; -import './screens/patients/profile/progress_note_screen.dart'; -import './screens/patients/profile/radiology/radiology_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; -import './screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; -import './screens/profile_screen.dart'; -import './screens/settings/settings_screen.dart'; import 'landing_page.dart'; -import 'screens/doctor/doctor_reply_screen.dart'; -import 'screens/live_care/panding_list.dart'; -import 'screens/patients/profile/admission-request/admission-request-detail-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; +import 'screens/patients/profile/note/progress_note_screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; -import 'screens/prescription/prescription_screen.dart'; -import 'screens/patients/profile/vital_sign/vital-signs-screen.dart'; const String INIT_ROUTE = ROOT; const String ROOT = 'root'; const String HOME = '/'; const String LOGIN = 'login'; -const String PROFILE = 'profile'; -const String CHANGE_PASSWORD = 'change-password'; -const String VERIFY_ACCOUNT = 'verify-account'; const String VERIFICATION_METHODS = 'verification-methods'; -const String MY_SCHEDULE = 'my-schedule'; -const String QR_READER = 'qr-reader'; -const String PATIENT_SEARCH = 'patients/patient-search'; const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; -const String PATIENTS_REFERRED = 'patients/patients-referred'; -const String BLOOD_BANK = 'blood-bank'; -const String DOCTOR_REPLY = 'doctor-reply'; -const String MEDICINE_SEARCH = 'medicine/medicine-search'; -const String PHARMACIES_LIST = 'medicine/pharmacies-list'; -const String MESSAGES = 'messages'; -const String SERVICES = 'services'; -const String SETTINGS = 'settings'; -const String VITAL_SIGN = 'patients/vital-sign'; -const String LAB_ORDERS = 'patients/lab_orders'; +const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; -const String PRESCRIPTIONS = 'patients/prescription'; const String MEDICAL_FILE = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; -const String REFER_PATIENT = 'patients/refer-patient'; +const String ORDER_NOTE = 'patients/order-note'; + const String MY_REFERRAL_DETAIL = 'my_referral_detail'; const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor'; -const String PATIENT_ORDERS = 'patients/patient_orders'; -const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; -const String PATIENT_INSURANCE_APPROVALS_NEW = 'patients/patient_insurance_approvals_new'; +const String REFER_IN_PATIENT_TO_DOCTOR = 'patients/refer-in-patient-to-doctor'; +const String PATIENT_INSURANCE_APPROVALS_NEW = + 'patients/patient_insurance_approvals_new'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; -const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; const String CREATE_EPISODE = 'patients/create-episode'; const String UPDATE_EPISODE = 'patients/update-episode'; const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; @@ -100,83 +55,43 @@ const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail'; const String PATIENT_ECG = 'patients/ecg'; - -const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; -// const String VIDEO_CALL = 'video-call'; -const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; -const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss'; const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; -const String ORDER_PRESCRIPTION_HISTORY = 'prescription/prescriptionsssH'; const String ORDER_PROCEDURE = 'procedure/procedure'; -// const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; -const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; const String ADD_SICKLEAVE = 'add-sickleave'; const String SHOW_SICKLEAVE = 'show-sickleave'; -const String RADIOLOGY = 'radiology'; const String RADIOLOGY_PATIENT = 'radiology-patient'; //todo: change the routing way. var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), LOGIN: (_) => Loginsreen(), - PROFILE: (_) => ProfileScreen(), - MY_SCHEDULE: (_) => MyScheduleScreen(), - PATIENT_SEARCH: (_) => PatientSearchScreen(), - PATIENTS_REFERRED: (_) => PatientReferredScreen(), PATIENTS: (_) => PatientsScreen(), - QR_READER: (_) => QrReaderScreen(), - BLOOD_BANK: (_) => BloodBankScreen(), - DOCTOR_REPLY: (_) => DoctorReplyScreen(), - MEDICINE_SEARCH: (_) => MedicineSearchScreen(), - SETTINGS: (_) => SettingsScreen(), - CHANGE_PASSWORD: (_) => ChangePasswordScreen(), - VERIFY_ACCOUNT: (_) => VerifyAccountScreen(), VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(), - PHARMACIES_LIST: (_) => PharmaciesListScreen( - itemID: null, - ), - MESSAGES: (_) => MessagesScreen(), - SERVICES: (_) => ServicesScreen(), - LAB_ORDERS: (_) => LabOrdersScreen(), LAB_RESULT: (_) => LabsHomePage(), - PRESCRIPTIONS: (_) => PrescriptionScreen(), MEDICAL_FILE: (_) => MedicalFilePage(), - PROGRESS_NOTE: (_) => ProgressNoteScreen(), - REFER_PATIENT: (_) => ReferPatientScreen(), + PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,), + ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), - PATIENT_ORDERS: (_) => PatientsOrdersScreen(), - PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), + REFER_IN_PATIENT_TO_DOCTOR: (_) => PatientMakeInPatientReferralScreen(), PATIENT_INSURANCE_APPROVALS_NEW: (_) => InsuranceApprovalScreenNew(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), - PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), - RADIOLOGY: (_) => RadiologyScreen(), RADIOLOGY_PATIENT: (_) => RadiologyHomePage(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), - // PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), CREATE_EPISODE: (_) => UpdateSoapIndex( isUpdate: true, ), UPDATE_EPISODE: (_) => UpdateSoapIndex( isUpdate: true, ), - BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), - // VIDEO_CALL: (_) => VideoCallPage(patientData: null), - LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), - // LIVECARE_END_DIALOG: (_) => EndCallDialogBox(), - PATIENT_SICKLEAVE: (_) => SickLeaveScreen(), ADD_SICKLEAVE: (_) => AddSickLeavScreen(), SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), - ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), - ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), - - // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 2645f7a4..6b37efbe 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -9,9 +9,9 @@ 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/shared/app_button.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -93,11 +93,11 @@ class _QrReaderScreenState extends State { SizedBox( height: 35, ), - Button( - onTap: () { + AppButton( + title : TranslationBase.of(context).scanQr, + onPressed: () { _scanQrAndGetPatient(context, model); }, - title: TranslationBase.of(context).scanQr, loading: isLoading, icon: Image.asset('assets/images/qr_code_white.png'), ), @@ -210,7 +210,7 @@ class _QrReaderScreenState extends State { setState(() { isLoading = false; }); - helpers.showErrorToast(error.message); + Helpers.showErrorToast(error.message); //DrAppToastMsg.showErrorToast(error); }); } diff --git a/lib/screens/auth/change_password_screen.dart b/lib/screens/auth/change_password_screen.dart index d6451049..1a502b68 100644 --- a/lib/screens/auth/change_password_screen.dart +++ b/lib/screens/auth/change_password_screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/lookups/auth_lookup.dart'; import 'package:doctor_app_flutter/widgets/auth/auth_header.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; + import '../../widgets/auth/change_password.dart'; class ChangePasswordScreen extends StatelessWidget { diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 465ef71e..fbba6360 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -4,7 +4,6 @@ import 'dart:io'; 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/auth_service.dart'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; @@ -19,10 +18,8 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../../lookups/auth_lookup.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../widgets/auth/auth_header.dart'; -import '../../widgets/auth/known_user_login.dart'; import '../../widgets/auth/login_form.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; -import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -122,7 +119,7 @@ class _LoginsreenState extends State { height: 40, ), LoginForm( - changeLoadingStata: changeLoadingStata, + model: model, ), ], ) diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 40fe4bd6..0ad71b76 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -2,8 +2,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import '../../lookups/auth_lookup.dart'; -import '../../widgets/auth/auth_header.dart'; import '../../widgets/auth/verification_methods.dart'; /* diff --git a/lib/screens/auth/verify_account_screen.dart b/lib/screens/auth/verify_account_screen.dart deleted file mode 100644 index e69d973e..00000000 --- a/lib/screens/auth/verify_account_screen.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:flutter/material.dart'; - -import '../../lookups/auth_lookup.dart'; -import '../../widgets/auth/auth_header.dart'; -import '../../widgets/auth/verfiy_account.dart'; -import '../../widgets/shared/app_scaffold_widget.dart'; - -class VerifyAccountScreen extends StatefulWidget { - @override - _VerifyAccountScreenState createState() => _VerifyAccountScreenState(); -} - -class _VerifyAccountScreenState extends State { - bool _isLoading = false; - - /* - *@author: Elham Rababah - *@Date:19/4/2020 - *@param: isLoading - *@return: - *@desc: Change Isloading attribute in order to show or hide loader - */ - void changeLoadingStata(isLoading) { - setState(() { - _isLoading = isLoading; - }); - } - - @override - Widget build(BuildContext context) { - return AppScaffold( - isLoading: _isLoading, - isShowAppBar: false, - body: SafeArea( - child: ListView(children: [ - Container( - margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.verifyPassword), - VerifyAccount(changeLoadingStata: changeLoadingStata), - ], - ), - ), - ]), - )); - } -} diff --git a/lib/screens/blood_bank_screen.dart b/lib/screens/blood_bank_screen.dart deleted file mode 100644 index 767be58f..00000000 --- a/lib/screens/blood_bank_screen.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:flutter/material.dart'; -class BloodBankScreen - - extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text("Blood Bank"),), - ); - } -} \ No newline at end of file diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 17cbd586..1c019ca6 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -1,24 +1,15 @@ -import 'package:doctor_app_flutter/client/base_app_client.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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.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/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.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/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatelessWidget { @@ -62,22 +53,24 @@ class DoctorReplayChat extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: reply.patientName - .toString(), - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 20)), - ], + Expanded( + child: RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: reply.patientName + .toString(), + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), ), ), InkWell( @@ -89,34 +82,6 @@ class DoctorReplayChat extends StatelessWidget { color: Color(0xFF2B353E))) ], ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // InkWell( - // onTap: () { - // // TODO: move to doctor profile - // }, - // child: RichText( - // text: TextSpan( - // style: TextStyle( - // fontSize: 1.6 * - // SizeConfig.textMultiplier, - // color: Colors.black), - // children: [ - // new TextSpan( - // text: - // 'Tap here to view patient profile' - // .toString(), - // style: TextStyle( - // fontFamily: 'Poppins', - // fontSize: 12)), - // ], - // ), - // ), - // ), - // ], - // ), ], ), ), @@ -132,7 +97,7 @@ class DoctorReplayChat extends StatelessWidget { SizedBox(height: 30,), Container( // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.9, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color(0xFF2B353E), @@ -160,7 +125,7 @@ class DoctorReplayChat extends StatelessWidget { width: 60, height: 60, child: Image.asset( - 1 == 1 + reply.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -169,7 +134,7 @@ class DoctorReplayChat extends StatelessWidget { Divider(), SizedBox(width: 10,), Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.35, child: AppText( reply.patientName .toString(), @@ -179,7 +144,19 @@ class DoctorReplayChat extends StatelessWidget { fontWeight: FontWeight.bold, // fontSize: 18 ), - ) + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" +reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.white, + ), + ), + ), ], ), Column( @@ -234,91 +211,6 @@ class DoctorReplayChat extends StatelessWidget { ), ), SizedBox(height: 30,), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Container( - // // color: Color(0xFF2B353E), - // width: MediaQuery.of(context).size.width * 0.8, - // padding: EdgeInsets.all(5), - // decoration: BoxDecoration( - // color: Colors.white,// Color(0xFF2B353E), - // borderRadius: BorderRadius.all( - // Radius.circular(10.0), - // ), - // border: Border.all( - // color: HexColor('#707070') , - // width: 0.30), - // ), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Container( - // margin: EdgeInsets.only(top: 5), - // width: 60, - // height: 60, - // child: Image.asset( - // 1 == 1 - // ? 'assets/images/male_avatar.png' - // : 'assets/images/female_avatar.png', - // fit: BoxFit.cover, - // ), - // ), - // Column( - // children: [ - // AppText( - // "07 Jan 2021", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // fontFamily: 'Poppins', - // color: Color(0xFF2B353E), - // // fontSize: 18 - // ), - // AppText( - // "07:00 PM", - // fontSize: 2.5 * SizeConfig.textMultiplier, - // fontFamily: 'Poppins', - // color: Color(0xFF2B353E), - // // fontSize: 18 - // ), - // ], - // ), - // ], - // ), - // SizedBox( - // height: 10, - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Column( - // children: [ - // Padding( - // padding: const EdgeInsets.all(8.0), - // child: Container( - // width: MediaQuery.of(context).size.width * 0.7, - // child: AppText( - // "This procedure should be taken only when the patient is below 99o", - // fontSize: 15, - // fontFamily: 'Poppins', - // color: Color(0xFF2B353E), - // // fontSize: 18 - // ), - // ), - // ), - // ], - // ), - // ], - // ), - // ], - // ), - // ), - // ], - // ), ], ), ), @@ -328,66 +220,61 @@ class DoctorReplayChat extends StatelessWidget { ), ), - Positioned( - bottom: 0, - child: Container( - width:MediaQuery.of(context).size.width * 1, - // height: MediaQuery.of(context).size.height * 0.12, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - FractionallySizedBox( - child: Container( - - child: TextFields( - borderRadius: 0, - // hasLabelText: msgController.text != '' - // ? true - // : false, - // showLabelText: false, - // padding: EdgeInsets.all(0.3), - hintText: TranslationBase - .of(context) - .typeHereToReply, - fontSize: 13.5, - - suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: Colors.green, - onSuffixTap: ()async { - GifLoaderDialogUtils.showMyDialog(context); - await model.replay(msgController.text, reply); - if(model.state == ViewState.ErrorLocal) { - helpers.showErrorToast("An error happened while you are replaying"); - } else { - DrAppToastMsg.showSuccesToast("Thank you for your replay "); - await previousModel.getDoctorReply(); - Navigator.pop(context); - } - GifLoaderDialogUtils.hideDialog(context); - - - - - }, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 50, - minLines: 3, - controller: msgController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - - ), - ), - ], - ), - ), - ) + // Positioned( + // bottom: 0, + // child: Container( + // width:MediaQuery.of(context).size.width * 1, + // // height: MediaQuery.of(context).size.height * 0.12, + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // FractionallySizedBox( + // child: Container( + // + // child: TextFields( + // borderRadius: 0, + // hintText: TranslationBase + // .of(context) + // .typeHereToReply, + // fontSize: 13.5, + // + // suffixIcon: FontAwesomeIcons.arrowRight, + // suffixIconColor: Colors.green, + // onSuffixTap: ()async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.replay(msgController.text, reply); + // if(model.state == ViewState.ErrorLocal) { + // Helpers.showErrorToast("An error happened while you are replaying"); + // } else { + // DrAppToastMsg.showSuccesToast("Thank you for your replay "); + // await previousModel.getDoctorReply(); + // Navigator.pop(context); + // } + // GifLoaderDialogUtils.hideDialog(context); + // + // + // + // + // }, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 50, + // minLines: 3, + // controller: msgController, + // validator: (value) { + // if (value == null || value == "") + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }), + // + // ), + // ), + // ], + // ), + // ), + // ) ], diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 283ce7cd..f522561f 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -48,9 +48,7 @@ class DoctorReplyScreen extends StatelessWidget { children: model.listDoctorWorkingHoursTable.map((reply) { return InkWell( - onTap: reply.status != 2 - ? null - : () { + onTap: () { Navigator.push( context, MaterialPageRoute( diff --git a/lib/screens/doctor/message_screen.dart b/lib/screens/doctor/message_screen.dart deleted file mode 100644 index 17d57c47..00000000 --- a/lib/screens/doctor/message_screen.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class MessagesScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: false, - body: Center( - child: Text('Messages heeer'), - ), - ); - } -} diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 3dc63a7b..4580e5c8 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -1,4 +1,5 @@ import 'dart:ui'; + import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; diff --git a/lib/screens/doctor/services_screen.dart b/lib/screens/doctor/services_screen.dart deleted file mode 100644 index d470cc87..00000000 --- a/lib/screens/doctor/services_screen.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class ServicesScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: false, - body: Center( - child: Text('Services heeer'), - ), - ); - } -} \ No newline at end of file diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index bdf52129..216a8c3f 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -2,15 +2,17 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class HomePageCard extends StatelessWidget { - const HomePageCard({this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4}) + const HomePageCard( + {this.hasBorder = false, + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4, + this.margin}) : super(key: key); final bool hasBorder; final String imageName; @@ -20,7 +22,7 @@ class HomePageCard extends StatelessWidget { final double height; final Color color; final double opacity; - + final EdgeInsets margin; @override Widget build(BuildContext context) { return InkWell( @@ -30,13 +32,14 @@ class HomePageCard extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, + ? MediaQuery.of(context).size.height * 0.18 + : MediaQuery.of(context).size.height * 0.36, + margin: this.margin, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(15.0), border: hasBorder @@ -44,11 +47,11 @@ class HomePageCard extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/${imageName}'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), - ) + image: AssetImage('assets/images/dashboard/${imageName}'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) : null, ), child: Center( @@ -57,6 +60,4 @@ class HomePageCard extends StatelessWidget { ), ); } - - getDashboardWidget() {} -} \ No newline at end of file +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index b7c24ffa..307b635c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -2,6 +2,8 @@ import 'package:charts_flutter/flutter.dart' as charts; 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/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; @@ -12,24 +14,34 @@ 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/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; +import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/out_patient_stack.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/row_count.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'package:sticky_headers/sticky_headers/widget.dart'; -import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'home_page_card.dart'; @@ -56,30 +68,11 @@ class _HomeScreenState extends State { var _isInit = true; DoctorProfileModel profile; bool isExpanded = false; - String isInpatient = ""; + bool isInpatient = false; var clinicName = []; int sliderActiveIndex = 0; var clinicId; - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 5.5, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); + var _patientSearchFormValues; void didChangeDependencies() async { super.didChangeDependencies(); @@ -130,122 +123,125 @@ class _HomeScreenState extends State { baseViewModel: model, isShowAppBar: false, body: ListView(children: [ - Column( - children: [ - SizedBox(height: 20), - Stack(children: [ - IconButton( - icon: Image.asset('assets/images/menu.png', - height: 50, width: 50), - iconSize: 18, - color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), - ), - Column( - children: [ - ProfileWelcomeWidget( - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * .6, - // // height: 100, - child: projectsProvider.doctorClinicsList.length > 0 - ? Stack( - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.all(2), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: - BorderRadius.circular( - 20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - projectsProvider - .doctorClinicsList - .length - .toString(), - style: new TextStyle( - color: Colors.white, - fontSize: projectsProvider - .isArabic - ? 10 - : 11, + Column(children: [ + StickyHeader( + header: Container( + color: Colors.grey[100], + padding: EdgeInsets.only(top: 10), + child: Stack(children: [ + IconButton( + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), + iconSize: 18, + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), + Column(children: [ + ProfileWelcomeWidget( + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * .6, + // // height: 100, + child: projectsProvider.doctorClinicsList.length > + 0 + ? Stack( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: + new BoxDecoration( + color: Colors.red[800], + borderRadius: + BorderRadius.circular( + 20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + projectsProvider + .doctorClinicsList + .length + .toString(), + style: new TextStyle( + color: Colors.white, + fontSize: + projectsProvider + .isArabic + ? 10 + : 11, + ), + textAlign: + TextAlign.center, ), - textAlign: TextAlign.center, ), - ), - AppText(item.clinicName, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), - ], + AppText(item.clinicName, + fontSize: 12, + color: Colors.black, + fontWeight: + FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic( + newValue, context, model); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: AppText( + item.clinicName, + textAlign: TextAlign.right, + ), + value: item.clinicID, ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic( - newValue, context, model); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: AppText( - item.clinicName, - textAlign: TextAlign.right, - ), - value: item.clinicID, - ); - }).toList(), - )), - ], - ) - : AppText(TranslationBase.of(context).noClinic), - ), - ], + }).toList(), + )), + ], + ) + : AppText( + TranslationBase.of(context).noClinic), + ), + ], + ), + isClilic: true, + height: 50, ), - isClilic: true, - ), - Container( - height: MediaQuery.of(context).size.height * 0.24, - ), - ], - ), - Positioned( - right: 9.0, - left: 9, - top: MediaQuery.of(context).size.height * .08, - child: Container( + ]) + ])), + content: Column( + children: [ + Container( height: MediaQuery.of(context).size.height * 0.35, child: model.dashboardItemsList.length > 0 ? new Swiper( @@ -279,19 +275,19 @@ class _HomeScreenState extends State { .spaceBetween, children: [ config.activeIndex == 0 - ? getSwiperPagiantion( + ? SwiperRoundedPagination( true) - : getSwiperPagiantion( + : SwiperRoundedPagination( false), config.activeIndex == 1 - ? getSwiperPagiantion( + ? SwiperRoundedPagination( true) - : getSwiperPagiantion( + : SwiperRoundedPagination( false), config.activeIndex == 2 - ? getSwiperPagiantion( + ? SwiperRoundedPagination( true) - : getSwiperPagiantion( + : SwiperRoundedPagination( false), ], ))))) @@ -302,59 +298,17 @@ class _HomeScreenState extends State { // control: new SwiperControl(), ) : SizedBox()), - ) - ]), - model.dashboardItemsList.length > 0 - ? FractionallySizedBox( - widthFactor: 0.90, - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - sliderActiveIndex == 1 - ? Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[3].kPIName, - fontSize: - SizeConfig.textMultiplier * 2.2, - fontWeight: FontWeight.bold, - ), - ], - ), - new Container( - height: MediaQuery.of(context) - .orientation == - Orientation.portrait - ? MediaQuery.of(context) - .size - .height * - 0.15 - : MediaQuery.of(context) - .size - .height * - 0.20, - child: new ListView( - scrollDirection: Axis.horizontal, - children: new List.generate( - model - .dashboardItemsList[3] - .summaryoptions - .length, (int index) { - return getActivityButton(model - .dashboardItemsList[3] - .summaryoptions[index]); - }))) - ], - ) - : sliderActiveIndex == 0 + model.dashboardItemsList.length > 0 + ? FractionallySizedBox( + widthFactor: 0.90, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + sliderActiveIndex == 1 ? Column( children: [ Row( @@ -362,7 +316,7 @@ class _HomeScreenState extends State { MainAxisAlignment.start, children: [ AppText( - model.dashboardItemsList[6] + model.dashboardItemsList[3] .kPIName, fontSize: SizeConfig.textMultiplier * @@ -372,257 +326,462 @@ class _HomeScreenState extends State { ], ), new Container( - height: MediaQuery.of(context) - .orientation == - Orientation.portrait - ? MediaQuery.of(context) - .size - .height * - 0.15 - : MediaQuery.of(context) - .size - .height * - 0.20, + height: 130, child: new ListView( scrollDirection: Axis.horizontal, children: new List.generate( model - .dashboardItemsList[6] + .dashboardItemsList[3] .summaryoptions .length, (int index) { - return getActivityButton(model - .dashboardItemsList[6] + return GetActivityButton(model + .dashboardItemsList[3] .summaryoptions[index]); }))) ], ) - : Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList[4] - .kPIName, - fontSize: - SizeConfig.textMultiplier * + : sliderActiveIndex == 0 + ? Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[6] + .kPIName, + fontSize: SizeConfig + .textMultiplier * 2.2, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: 130, + child: new ListView( + scrollDirection: Axis + .horizontal, + children: new List + .generate( + model + .dashboardItemsList[ + 6] + .summaryoptions + .length, + (int index) { + return GetActivityButton(model + .dashboardItemsList[ + 6] + .summaryoptions[index]); + }))) + ], + ) + : Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[4] + .kPIName, + fontSize: SizeConfig + .textMultiplier * + 2.2, + fontWeight: FontWeight.bold, + ), + ], ), + new Container( + height: 130, + child: new ListView( + scrollDirection: Axis + .horizontal, + children: new List + .generate( + model + .dashboardItemsList[ + 4] + .summaryoptions + .length, + (int index) { + return GetActivityButton(model + .dashboardItemsList[ + 4] + .summaryoptions[index]); + }))) ], ), - new Container( - height: MediaQuery.of(context) - .orientation == - Orientation.portrait - ? MediaQuery.of(context) - .size - .height * - 0.15 - : MediaQuery.of(context) - .size - .height * - 0.20, - child: new ListView( - scrollDirection: - Axis.horizontal, - children: new List.generate( - model - .dashboardItemsList[4] - .summaryoptions - .length, (int index) { - return getActivityButton(model - .dashboardItemsList[4] - .summaryoptions[index]); - }))) - ], - ), - ]))) - : SizedBox(), - FractionallySizedBox( - // widthFactor: 0.90, - child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topRight: Radius.circular(50), - )), - padding: EdgeInsets.only(left: 20, top: 10, right: 20), - margin: EdgeInsets.only(top: 10), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Row( - children: [ - Container( - width: 150, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).patients, - style: TextStyle( - fontSize: 12, - height: .5, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context).services, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins'), - ), - ], - )), - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + ]))) + : SizedBox(), + FractionallySizedBox( + // widthFactor: 0.90, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + )), + padding: EdgeInsets.only(left: 20, top: 10, right: 20), + margin: EdgeInsets.only(top: 10), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - HomePageCard( - color: Colors.red[800], - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.referral_1, - size: 35, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .patientsreferral, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PatientReferralScreen(), - // MyReferredPatient(), - ), - ); - }, + SizedBox( + height: 10, ), - HomePageCard( - color: Colors.grey[300], - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.arrival_patients, - size: 35, + Row( + children: [ + Container( + width: 150, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).patients, + style: TextStyle( + fontSize: 12, + height: .5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins'), + ), + Text( + TranslationBase.of(context).services, + style: TextStyle( + fontSize: 22, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins'), + ), + ], + )), + ], + ), + SizedBox( + height: 10, + ), + new Container( + height: 130, + child: new ListView( + scrollDirection: Axis.horizontal, + children: [ + HomePageCard( + color: Colors.red[800], + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.inpatient, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .inPatient, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + FadePage( + page: PatientInPatientScreen(), + ), + ); + // getRequestHeader(true); + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": + // _patientSearchFormValues, + // "selectedType": "1", + // "arrivalType": "1", + // "isInpatient": true + // }); + }, + ), + HomePageCard( + color: Colors.grey[300], + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.arrival_patients, + size: 35, + color: Colors.black, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .myOutPatient, + color: Colors.black, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + + String date = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day ), + 'yyyy-MM-dd'); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientsScreenNew( + isSearch: false, + isInpatient: false, + patientSearchRequestModel: + PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID), + selectedPatientType: + PatientType.OutPatient, + isSearchWithKeyInfo: false, + ), + )); + }, + ), + HomePageCard( color: Colors.black, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .arrivalpatient, + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.referral_1, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .patientsreferral, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientReferralScreen(), + // MyReferredPatient(), + ), + ); + }, + ), + HomePageCard( + color: Colors.red[800], + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.discharge_patients, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + 'Discharged Patients', + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + DischargedPatient(), + // MyReferredPatient(), + ), + ); + }, + ), + HomePageCard( + color: Colors.grey[300], + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.referral_discharge, + size: 35, + color: Colors.black, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + 'Referral Discharged', + color: Colors.black, + textAlign: TextAlign.start, + fontSize: 15, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + ReferralDischargedPatientPage(), + // MyReferredPatient(), + ), + ); + }, + ), + HomePageCard( color: Colors.black, - textAlign: TextAlign.start, - fontSize: 15, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": "7", - "arrivalType": "1" - }); - }, + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchPatient, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientSearchScreenNew(), + )); + }, + ), + HomePageCard( + color: Colors.red[800], + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search_medicines, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchMedicine, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MedicineSearchScreen(), + )); + }, + ) + ])), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: 8, + ), + ], ), - HomePageCard( - color: Colors.black, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.search, - size: 32, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - TranslationBase.of(context) - .searchmedicinepatient, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 13, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SearchMedicinePatientScreen(), - )); - }, - ) - ], - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 20, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ SizedBox( - width: 8, + height: 20, ), ], ), - SizedBox( - height: 20, - ), - ], + ), ), - ), + ], ), - ], - ), + ) + ]), ]), ), ); @@ -671,15 +830,12 @@ class _HomeScreenState extends State { projectID: doctorProfile.projectID, tokenID: '', languageID: 2); - - // authProvider.getDocProfiles(docInfo) authProvider.getDocProfiles(docInfo.toJson()).then((res) async { changeIsLoading(false); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - // model.getDashboard(); }).catchError((err) { changeIsLoading(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } @@ -696,135 +852,6 @@ class _HomeScreenState extends State { return value.toString(); } - Widget getActivityButton(value) { - return Container( - width: MediaQuery.of(context).size.width * 0.24, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), - height: MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.15 - : MediaQuery.of(context).size.height * 0.20, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(10), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: AppText(value.value.toString(), - fontSize: 28, fontWeight: FontWeight.bold)), - Expanded( - child: AppText( - value.kPIParameter, - textOverflow: TextOverflow.clip, - fontSize: 12, - textAlign: TextAlign.center, - ), - ), - ], - ), - ); - } - - Widget dot(Color c) { - return Container( - padding: EdgeInsets.all(5.0), - margin: EdgeInsets.all(5.0), - decoration: BoxDecoration(color: c, shape: BoxShape.circle)); - } - - Widget rowCount(name, int count, Color c) { - return Row( - children: [ - dot(c), - Padding( - padding: EdgeInsets.only(top: 5, bottom: 5), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - name, - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 12, - textOverflow: TextOverflow.ellipsis, - ), - AppText( - ' (' + count.toString() + ')', - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 14, - fontWeight: FontWeight.bold, - ) - ], - )), - ], - ); - } - - Widget getOutPatientStack(value) { - value.summaryoptions - .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); - - var list = new List(); - value.summaryoptions.forEach((result) => - {list.add(getStack(result, value.summaryoptions.first.value))}); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Texts( - value.kPIName, - medium: true, - ), - Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) - ], - ); - } - - getStack(Summaryoptions value, max) { - return Stack(children: [ - Container( - height: 150, - margin: EdgeInsets.all(5), - width: 40, - child: SizedBox(), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.red[50]), - ), - Positioned( - bottom: 0, - child: Container( - child: SizedBox(), - margin: EdgeInsets.all(5), - padding: EdgeInsets.all(10), - height: max != 0 ? (150 * value.value) / max : 0, - width: 40, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.red[300]))), - Container( - height: 150, - margin: EdgeInsets.only(left: 5, top: 5), - padding: EdgeInsets.all(10), - child: RotatedBox( - quarterTurns: 1, - child: Center( - child: Align( - child: AppText( - value.kPIParameter + ' (' + value.value.toString() + ') ', - fontSize: 10, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - )), - ), - )) - ]); - } - List getSwipeWidget(model) { return [ RoundedContainer( @@ -832,13 +859,13 @@ class _HomeScreenState extends State { margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), - child: getOutPatientStack(model.dashboardItemsList[1]))), + child: GetOutPatientStack(model.dashboardItemsList[1]))), RoundedContainer( height: MediaQuery.of(context).size.height * 0.35, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), child: Padding( padding: const EdgeInsets.all(5.0), - child: getOutPatientStack(model.dashboardItemsList[0]))), + child: GetOutPatientStack(model.dashboardItemsList[0]))), RoundedContainer( height: MediaQuery.of(context).size.height * 0.35, margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10), @@ -892,19 +919,19 @@ class _HomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - rowCount( + RowCounts( model.dashboardItemsList[2] .summaryoptions[0].kPIParameter, model.dashboardItemsList[2] .summaryoptions[0].value, Colors.black), - rowCount( + RowCounts( model.dashboardItemsList[2] .summaryoptions[1].kPIParameter, model.dashboardItemsList[2] .summaryoptions[1].value, Colors.grey), - rowCount( + RowCounts( model.dashboardItemsList[2] .summaryoptions[2].kPIParameter, model.dashboardItemsList[2] @@ -943,20 +970,30 @@ class _HomeScreenState extends State { ]; } - getSwiperPagiantion(active) { - return active == true - ? Container( - height: 5, - width: 30, - // margin: EdgeInsets.only(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), color: Colors.black), - ) - : Container( - height: 5, - width: 8, - margin: EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: Colors.grey)); + getRequestHeader(isInpatient) { + _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: isInpatient == true + ? '0' + : DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: isInpatient == true + ? '0' + : DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); } } diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index 251f9594..8c9851db 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -1,23 +1,21 @@ 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/screens/live_care/video_call.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/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_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; -import '../../config/size_config.dart'; + import '../../config/size_config.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import '../../routes.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); @@ -149,8 +147,6 @@ class _LiveCarePandingListState extends State { fontWeight: FontWeight .bold, - backGroundcolor: - Colors.white, ), SizedBox( height: 8, @@ -167,8 +163,6 @@ class _LiveCarePandingListState extends State { fontWeight: FontWeight .bold, - backGroundcolor: - Colors.white, ), AppText( TranslationBase.of( @@ -183,8 +177,6 @@ class _LiveCarePandingListState extends State { fontWeight: FontWeight .bold, - backGroundcolor: - Colors.white, ), SizedBox( height: 8, diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index f6d011a7..961654cc 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -1,19 +1,16 @@ import 'dart:async'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.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/core/viewModel/livecare_view_model.dart'; -import 'package:doctor_app_flutter/screens/live_care/panding_list.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'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import '../../routes.dart'; class VideoCallPage extends StatefulWidget { final LiveCarePendingListResponse patientData; @@ -96,7 +93,7 @@ class _VideoCallPageState extends State { connectOpenTok(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } @override @@ -307,7 +304,7 @@ class _VideoCallPageState extends State { .then((result) { connectOpenTok(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCall() { @@ -317,7 +314,7 @@ class _VideoCallPageState extends State { .then((result) { print(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } endCallWithCharge() { @@ -328,7 +325,7 @@ class _VideoCallPageState extends State { print('end callwith charge'); print(result); }).catchError((error) => - {helpers.showErrorToast(error), Navigator.of(context).pop()}); + {Helpers.showErrorToast(error), Navigator.of(context).pop()}); } closeRoute() { diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 9f12e8b7..828210e0 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,16 +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/icons_app/doctor_app_icons.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/patients/profile/patient_profile_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/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; @@ -100,7 +94,11 @@ class _MedicalFileDetailsState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getMedicalFile(mrn: pp), + onModelReady: (model) async { + if (model.medicalFileList.length == 0) { + model.getMedicalFile(mrn: pp); + } + }, builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( @@ -128,8 +126,6 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - // PatientProfileHeaderNewDesign(patient, - // patient.patientType.toString(), patient.arrivedOn), model.medicalFileList.length != 0 && model .medicalFileList[0] @@ -144,161 +140,6 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( 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: Column( - // children: [ - // Row( - // children: [ - // if (model.medicalFileList.length != - // 0 && - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .timeLineEvents[0] - // .consulations - // .length != - // 0) - // Expanded( - // child: AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .timeLineEvents[0] - // .consulations[0] - // .doctorName - // .toUpperCase(), - // fontWeight: FontWeight.w700, - // ), - // ), - // ], - // ), - // if (model.medicalFileList.length != 0) - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .clinic + - // ": ", - // ), - // if (model.medicalFileList - // .length != - // 0 && - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .timeLineEvents[0] - // .consulations - // .length != - // 0) - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .timeLineEvents[0] - // .consulations[0] - // .clinicName, - // fontWeight: FontWeight.w700, - // ), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .episode + - // ": ", - // //fontWeight: FontWeight.w700, - // ), - // if (model.medicalFileList.length != - // 0 && - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .timeLineEvents[0] - // .consulations - // .length != - // 0) - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[encounterNumber] - // .timeLineEvents[0] - // .consulations[0] - // .episodeID - // .toString(), - // fontWeight: FontWeight.w700, - // ), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .visitDate + - // ": ", - // //fontWeight: FontWeight.w700, - // ), - // if (model.medicalFileList.length != - // 0 && - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .timeLineEvents[0] - // .consulations - // .length != - // 0) - // AppText( - // '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[ - // encounterNumber] - // .date, - // ), isArabic: projectViewModel.isArabic)}', - // color: Colors.black, - // fontWeight: FontWeight.w700, - // fontSize: 14, - // ), - // SizedBox(width: 35.0), - // // AppText( - // // 'Appt Date : ', - // // fontWeight: FontWeight.w700, - // // ), - // // AppText( - // // '23/12/2020', - // // ), - // ], - // ), - // ], - // ), - // ), - SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && model @@ -332,7 +173,7 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts( + AppText( TranslationBase.of( context) .historyOfPresentIllness @@ -454,7 +295,7 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts( + AppText( TranslationBase.of( context) .assessment @@ -655,14 +496,7 @@ class _MedicalFileDetailsState extends State { ), ), ), - // SizedBox( - // height: 30, - // ), - // Container( - // width: double.infinity, - // height: 1, - // color: Color(0xffCCCCCC), - // ), + SizedBox( height: 30, ), @@ -698,7 +532,7 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts( + AppText( TranslationBase.of( context) .test @@ -786,7 +620,7 @@ class _MedicalFileDetailsState extends State { 'Order Date: ', ), AppText( - Helpers.getDateFormatted( + DateUtils.getDateFormatted( DateTime .parse( model @@ -889,14 +723,7 @@ class _MedicalFileDetailsState extends State { ), ), ), - // SizedBox( - // height: 30, - // ), - // Container( - // width: double.infinity, - // height: 1, - // color: Color(0xffCCCCCC), - // ), + SizedBox( height: 30, ), @@ -932,7 +759,7 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts( + AppText( TranslationBase.of( context) .physicalSystemExamination @@ -1086,11 +913,6 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - // Container( - // width: double.infinity, - // height: 1, - // color: Color(0xffCCCCCC), - // ), ], ), ), @@ -1105,7 +927,7 @@ class _MedicalFileDetailsState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('No Data For This Visit '), + child: AppText('No Data For This Visit '), ), SizedBox( height: 100, diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 25b76fed..b7587efb 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -1,25 +1,15 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_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/patient-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class MedicalFilePage extends StatefulWidget { @override @@ -34,14 +24,14 @@ class _MedicalFilePageState extends State { patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType), + patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( @@ -49,13 +39,7 @@ class _MedicalFilePageState extends State { child: SingleChildScrollView( child: Container( child: Column( - // mainAxisAlignment: model.medicalFileList.length != 0 && - // model.medicalFileList != null - // ? MainAxisAlignment.start - // : MainAxisAlignment.center, children: [ - // PatientProfileHeaderNewDesign( - // patient, patient.patientType.toString(), arrivalType), Padding( padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), @@ -67,7 +51,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Medical', + 'Health', fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +61,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Report', + 'Summary', fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -100,80 +84,103 @@ class _MedicalFilePageState extends State { itemBuilder: (BuildContext ctxt, int index) { return InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age is String - ? patient.age ?? "" - : "${patient.age}", - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - encounterNumber: index, - pp: patient.patientId, - patient: patient, - doctorName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName - : "", - clinicName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName - : "", - doctorImage: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorImage - : "", - episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() - : "", - vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), - ); + if (model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .length != + 0) + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MedicalFileDetails( + age: patient.age is String + ? patient.age ?? "" + : "${patient.age}", + firstName: patient.firstName, + lastName: patient.lastName, + gender: patient.genderDescription, + encounterNumber: index, + pp: patient.patientId, + patient: patient, + doctorName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName + : "", + clinicName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName + : "", + doctorImage: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorImage + : "", + episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty + ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() + : "", + vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), + ); }, child: DoctorCard( - doctorName: model.medicalFileList[0] - .entityList[0].timelines[index].doctorName, - clinic: model.medicalFileList[0].entityList[0] - .timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0] - .timelines[index].projectName, - profileUrl: model.medicalFileList[0] - .entityList[0].timelines[index].doctorImage, - appointmentDate: - DateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0] - .timelines[index].date, - ), - isPrescriptions: true, - ), + doctorName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + clinic: model.medicalFileList[0].entityList[0] + .timelines[index].clinicName, + branch: model.medicalFileList[0].entityList[0] + .timelines[index].projectName, + profileUrl: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorImage, + appointmentDate: + DateUtils.getDateTimeFromServerFormat( + model.medicalFileList[0].entityList[0] + .timelines[index].date, + ), + isPrescriptions: true, + isShowEye: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .length != + 0 + ? true + : false), ); }) : Center( @@ -186,7 +193,7 @@ class _MedicalFilePageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('No Medical File Found'), + child: AppText('No Medical File Found'), ) ], ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 9dea3448..3ce5c1be 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -12,11 +12,11 @@ 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/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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/loader/gif_loader_dialog_utils.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'; import 'package:permission_handler/permission_handler.dart'; @@ -122,7 +122,7 @@ class _MedicineSearchState extends State { myController.text = model.searchText; return AppScaffold( // baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, appBarTitle: TranslationBase.of(context).searchMedicine, body: SingleChildScrollView( child: FractionallySizedBox( @@ -134,7 +134,7 @@ class _MedicineSearchState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.screenHeight * .16, + height: 20, ), FractionallySizedBox( widthFactor: 0.9, @@ -157,6 +157,9 @@ class _MedicineSearchState extends State { ), ), ), + SizedBox( + height: 20, + ), FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -197,7 +200,7 @@ class _MedicineSearchState extends State { ), if (myController.text != '') Container( - height: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context).size.height * 0.6, child: ListView.builder( padding: const EdgeInsets.only(top: 20), @@ -242,12 +245,12 @@ class _MedicineSearchState extends State { searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { - helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); //"Type Medicine Name") return; } if (myController.text.length < 3) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); return; } diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 6af1d5b7..49c39c53 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,7 +23,6 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - // In the constructor, require a item id. PharmaciesListScreen({Key key, @required this.itemID, this.url}) : super(key: key); @@ -32,18 +31,9 @@ class PharmaciesListScreen extends StatefulWidget { } class _PharmaciesListState extends State { - var _data; Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - bool _isInit = true; - //bool _isOutOfStuck = false; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - _isInit = false; - } @override Widget build(BuildContext context) { @@ -145,90 +135,90 @@ class _PharmaciesListState extends State { ? Alignment.topRight : Alignment.topLeft, ), - Expanded( - child: Container( - width: SizeConfig.screenWidth * 0.99, - child: ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model - .pharmaciesList.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - 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( + 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]["LocationDescription"], - margin: 10, + .pharmaciesList[index]["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), ), - 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"]), + ), + 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"]), ), - 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"]); - }, + ), + 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/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart index 5e691e09..d80c065b 100644 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -1,4 +1,5 @@ import 'dart:ui'; + import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart new file mode 100644 index 00000000..28f7b834 --- /dev/null +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -0,0 +1,337 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/DischargedPatientViewModel.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/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/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class DischargedPatient extends StatefulWidget { + @override + _DischargedPatientState createState() => _DischargedPatientState(); +} + +class _DischargedPatientState extends State { + final _controller = TextEditingController(); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getDischargedPatient(), + builder: (_, model, w) => AppScaffold( + appBarTitle: 'Discharged Patient', + subtitle: "Last Three Months", + backgroundColor: Colors.grey[200], + isShowAppBar: true, + baseViewModel: model, + body: model.myDischargedPatient.isEmpty?Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + 'No Discharged Patient', + color: Theme.of(context).errorColor, + ), + ) + ], + ), + ):Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 12,), + Container( + width: double.maxFinite, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: Color(0xffCCCCCC), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox(height: 5,), + Expanded( + child: ListView.builder( + itemCount: model.filterData.length, + itemBuilder: (context,index)=>InkWell( + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "isSearch": false, + "isInpatient":true, + "isDischargedPatient":true + }); + + }, + child: Container( + width: double.maxFinite, + margin: EdgeInsets.all(8), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row(children: [ + Container( + width: 170, + child: AppText( + (Helpers.capitalize(model + .filterData[index] + .firstName) + + " " + + Helpers.capitalize(model + .filterData[index] + .lastName)), + fontSize: 16, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + model.filterData[index].gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + Row( + children: [ + AppText( + model.filterData[index].nationalityName != null + ? model.filterData[index].nationalityName.trim() + : model.filterData[index].nationality != null + ? model.filterData[index].nationality.trim() + : model.filterData[index].nationalityId != null + ? model.filterData[index].nationalityId + : "", + fontWeight: FontWeight.bold, + fontSize: 14, + textOverflow: TextOverflow.ellipsis, + ), + model.filterData[index] + .nationality != + null || + model.filterData[index] + .nationalityId != + null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + model.filterData[index].nationalityFlagURL != null ? + model.filterData[index].nationalityFlagURL + : '', + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace stackTrace) { + return AppText( + '', + fontSize: 10, + ); + }, + )) + : SizedBox() + ], + ) + ], + )), + Row( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + model.filterData[index].gender == + 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + ], + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context) + .fileNumber, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: model + .filterData[index] + .patientId + .toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].admissionDate == null ? "" : + TranslationBase.of(context).admissionDate + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].admissionDate == null ? "" + : "${DateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: model.filterData[index].dischargeDate == null ? "" + : "Discharge Date : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: model.filterData[index].dischargeDate == null ? "" + : "${DateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), + ), + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 14,fontWeight: FontWeight.w300, + ), + AppText( + "${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ), + ) + ], + ) + ], + ), + ), + )), + ), + + ], + ), + ), + ), + ); + } + + +} diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index d881feaa..6d1b5370 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -7,9 +7,8 @@ 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-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; @@ -41,8 +40,8 @@ class ECGPage extends StatelessWidget { children: [ // PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), SizedBox(height: 12,), - Texts('Service',style: "caption2",color: Colors.black,), - Texts('ECG',bold: true,fontSize: 22,), + AppText('Service',style: "caption2",color: Colors.black,), + AppText('ECG',bold: true,fontSize: 22,), SizedBox(height: 12,), ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { @@ -68,7 +67,7 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + AppText('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), SizedBox(height:3), RichText( text: TextSpan( @@ -101,8 +100,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Texts('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), - Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), + AppText('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + AppText('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart new file mode 100644 index 00000000..7d41b3cb --- /dev/null +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -0,0 +1,239 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.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'; +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:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class PatientInPatientScreen extends StatefulWidget { + @override + _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); +} + +class _PatientInPatientScreenState extends State { + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + int _activeTab = 0; + + TextEditingController _searchController = TextEditingController(); + + @override + void dispose() { + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + onModelReady: (model) => model.getInPatientList(requestModel), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + TranslationBase.of(context).inPatient, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + fontFamily: 'Poppins', + ), + ), + ]), + ), + ), + tabsBar(context, screenSize, model), + Container( + margin: EdgeInsets.all(16.0), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + ), + model.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // const SizedBox( + // height: 16, + // ), + ...List.generate(model.filteredInPatientItems.length, (index) { + if(_activeTab == 0) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else return SizedBox(); + }), + SizedBox(height: 15,) + ], + ), + ), + ), + ) + : Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable)), + ), + ), + ], + ), + ), + ); + } + + Widget tabsBar( + BuildContext context, Size screenSize, PatientSearchViewModel model) { + List _tabs = [ + TranslationBase.of(context).inPatientAll.toUpperCase(), + TranslationBase.of(context).inPatient.toUpperCase(), + ]; + + return Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + if (_activeTab==0) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getInPatientList(requestModel, + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog( + context); + } + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } +} diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart new file mode 100644 index 00000000..0b664d4b --- /dev/null +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -0,0 +1,591 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/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/screens/base/base_view.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/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + + + +class ReferralDischargedPatientDetails extends StatelessWidget { + final DischargeReferralPatient referredPatient; + + ReferralDischargedPatientDetails(this.referredPatient,); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + referredPatient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromDischargeReferralPatient(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "isDischargedPatient":true, + "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Icon( + Icons.account_circle, + size: 25, + ), + ) + ]), + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //TODO from backend + // Padding( + // padding: EdgeInsets.only(left: 12.0), + // child: Container( + // width: 60, + // height: 60, + // child: Image.network( + // referredPatient.doctorImageURL + // ), + // ), + // ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + fontFamily: 'Poppins', + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: referredPatient.referralStatus == 1 + ? Color(0xffc4aa54) + : referredPatient.referralStatus == 46 + ? Colors.green[700] + : Colors.red[700], + ), + AppText( + DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Color(0XFF28353E), + ) + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Admission Date: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.admissionDate, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Discharge Date: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.dischargeDate, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Number of Days: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Referring Doctor ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.referringDoctorName, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .fileNumber, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + "${referredPatient.patientID}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).refClinic}: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient + .referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + ], + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.priorityDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Referring Clinic ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Frequency ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.frequency.toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Priority ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.frequency.toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + + + + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_left.png', + height: 50, + width: 30, + ), + ), + //TODO from backend + // Container( + // margin: EdgeInsets.only( + // left: 0, + // top: 25, + // right: 0, + // bottom: 0), + // padding: EdgeInsets.only( + // left: 4.0, right: 4.0), + // child: referredPatient.doctorImageURL != + // null + // ? ClipRRect( + // borderRadius: + // BorderRadius.circular(20.0), + // child: Image.network( + // referredPatient.doctorImageURL, + // height: 25, + // width: 30, + // errorBuilder: + // (BuildContext context, + // Object exception, + // StackTrace stackTrace) { + // return Text('No Image'); + // }, + // )) + // : Container( + // child: Image.asset( + // referredPatient.gender == 1 + // ? 'assets/images/male_avatar.png' + // : 'assets/images/female_avatar.png', + // fit: BoxFit.cover, + // ), + // ), + // ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 10, + top: 30, + right: 10, + bottom: 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "Dr ${referredPatient.referringDoctorName}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w800, + fontSize: 1.5 * + SizeConfig.textMultiplier, + color: Colors.black, + ), + AppText( + referredPatient + .referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.3 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + Expanded( + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient.referringDoctorRemarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + + ], + ), + ), + ), + ), + + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart new file mode 100644 index 00000000..6da969d1 --- /dev/null +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -0,0 +1,97 @@ +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/util/date-utils.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient-referral-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/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +import 'ReferralDischargedPatientDetails.dart'; + +class ReferralDischargedPatientPage extends StatefulWidget { + @override + _ReferralDischargedPatientPageState createState() => _ReferralDischargedPatientPageState(); +} + +class _ReferralDischargedPatientPageState extends State { + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.gtMyDischargeReferralPatient(), + builder: (_, model, w) => AppScaffold( + appBarTitle: 'Referral Discharged ', + backgroundColor: Colors.grey[200], + isShowAppBar: true, + baseViewModel: model, + body: model.myDischargeReferralPatient.isEmpty?Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + 'No Discharged Patient', + color: Theme.of(context).errorColor, + ), + ) + ], + ), + ):Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 5,), + Expanded( + child: ListView.builder( + itemCount: model.myDischargeReferralPatient.length, + itemBuilder: (context,index)=>InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context), + referralStatusCode: model.myDischargeReferralPatient[index].referralStatus, + patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName, + patientGender: model.myDischargeReferralPatient[index].gender, + referredDate: DateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate), + referredTime: DateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate), + patientID: "${model.myDischargeReferralPatient[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}", + remark: model.myDischargeReferralPatient[index].referringDoctorRemarks, + nationality: model.myDischargeReferralPatient[index].nationalityName, + nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend + doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend + referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName, + clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + )), + ), + + ], + ), + ), + ), + ); + } + + +} diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index f6a7dbee..ab3abbe9 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -3,16 +3,11 @@ 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/screens/patients/insurance_approvals_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/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; import 'package:doctor_app_flutter/widgets/shared/doctor_card_insurance.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -38,111 +33,217 @@ class _InsuranceApprovalScreenNewState PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: patient.appointmentNo != null - ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, - projectId: patient.projectId) - : (model) => model.getInsuranceApproval(patient), + onModelReady: patient.admissionNo != null + ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) + : patient.appointmentNo != null + ? (model) => model.getInsuranceApproval(patient, + appointmentNo: patient.appointmentNo, + projectId: patient.projectId) + : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType), + patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: model.insuranceApproval.length != 0 - ? Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: model.insuranceApprovalInPatient.length != 0 + ? Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - AppText( - 'Insurance', - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], ), ], ), - Row( - children: [ - AppText( - 'Approvals', - fontSize: 30.0, - fontWeight: FontWeight.w700, + ), + ...List.generate( + model.insuranceApprovalInPatient.length, + (index) => Container( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InsuranceApprovalsDetails( + patient: patient, + indexInsurance: index, + patientType: patientType, + )), + ); + }, + child: DoctorCardInsurance( + patientOut: "In Patient", + profileUrl: model + .insuranceApprovalInPatient[index] + .doctorImage, + clinic: model + .insuranceApprovalInPatient[index] + .clinicName, + doctorName: model + .insuranceApprovalInPatient[index] + .doctorName, + branch: model + .insuranceApprovalInPatient[index] + .approvalNo + .toString(), + isPrescriptions: true, + approvalStatus: model + .insuranceApprovalInPatient[index] + .approvalStatusDescption ?? + '', + branch2: model + .insuranceApprovalInPatient[index] + .projectName, ), - ], + ), + ), + ), + ], + ) + : Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Insurance Approval Found'), ), + SizedBox( + height: 150.0, + ) ], ), ), - ...List.generate( - model.insuranceApproval.length, - (index) => Container( - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - InsuranceApprovalsDetails( - patient: patient, - indexInsurance: index, - )), - ); - }, - child: DoctorCardInsurance( - patientOut: model.insuranceApproval[index] - .patientDescription, - profileUrl: - model.insuranceApproval[index].doctorImage, - clinic: - model.insuranceApproval[index].clinicName, - doctorName: - model.insuranceApproval[index].doctorName, - branch: model - .insuranceApproval[index].approvalNo - .toString(), - isPrescriptions: true, - approvalStatus: model.insuranceApproval[index] - .approvalStatusDescption ?? - '', - branch2: - model.insuranceApproval[index].projectName, + ), + ) + : SingleChildScrollView( + child: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: model.insuranceApproval.length != 0 + ? Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), ), - ), - ), - ), - ], - ) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts('No Insurance Approval Found'), + ...List.generate( + model.insuranceApproval.length, + (index) => Container( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InsuranceApprovalsDetails( + patient: patient, + indexInsurance: index, + patientType: patientType, + )), + ); + }, + child: DoctorCardInsurance( + patientOut: model.insuranceApproval[index] + .patientDescription, + profileUrl: model + .insuranceApproval[index].doctorImage, + clinic: model + .insuranceApproval[index].clinicName, + doctorName: model + .insuranceApproval[index].doctorName, + branch: model + .insuranceApproval[index].approvalNo + .toString(), + isPrescriptions: true, + approvalStatus: model + .insuranceApproval[index] + .approvalStatusDescption ?? + '', + branch2: model + .insuranceApproval[index].projectName, + ), + ), + ), + ), + ], ) - ], - ), - )), - ), + : Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Insurance Approval Found'), + ) + ], + ), + )), + ), ), ); } diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index c5331910..931f4051 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -4,9 +4,7 @@ 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-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; @@ -16,18 +14,25 @@ import 'package:provider/provider.dart'; class InsuranceApprovalsDetails extends StatefulWidget { PatiantInformtion patient; int indexInsurance; - InsuranceApprovalsDetails({this.patient, this.indexInsurance}); + String patientType; + + InsuranceApprovalsDetails( + {this.patient, this.indexInsurance, this.patientType}); @override _InsuranceApprovalsDetailsState createState() => _InsuranceApprovalsDetailsState( - patient: patient, indexInsurance: indexInsurance); + patient: patient, + indexInsurance: indexInsurance, + patientType: patientType); } class _InsuranceApprovalsDetailsState extends State { PatiantInformtion patient; int indexInsurance; + String patientType; - _InsuranceApprovalsDetailsState({this.patient, this.indexInsurance}); + _InsuranceApprovalsDetailsState( + {this.patient, this.indexInsurance, this.patientType}); @override Widget build(BuildContext context) { @@ -35,350 +40,736 @@ class _InsuranceApprovalsDetailsState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; return BaseView( - onModelReady: patient.appointmentNo != null - ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, - projectId: patient.projectId) - : (model) => model.getInsuranceApproval(patient), + onModelReady: (model) => model.insuranceApprovalInPatient.length == 0 + ? patient.admissionNo != null + ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) + : patient.appointmentNo != null + ? (model) => model.getInsuranceApproval(patient, + appointmentNo: patient.appointmentNo, + projectId: patient.projectId) + : (model) => model.getInsuranceApproval(patient) + : null, builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( isShowAppBar: true, baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( patient, patient.patientType.toString(), patient.arrivedOn), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), + body: patient.admissionNo != null + ? SingleChildScrollView( + child: Container( child: Column( children: [ - Row( - children: [ - AppText( - 'Insurance', - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - 'Approvals', - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(15.0), - ), - color: Colors.white), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - Texts( - model.insuranceApproval[indexInsurance] - .approvalStatusDescption != - null - ? model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption ?? - "" - : "", - color: model - .insuranceApproval[ - indexInsurance] - .approvalStatusDescption != - null - ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127) - : Color(0xffD02127), + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], ), ], ), - Row( - children: [ - Texts( - model.insuranceApproval[indexInsurance] - .doctorName - .toUpperCase(), - color: Colors.black, - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - ), - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 8.0), - child: Row( + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( children: [ - Column( + Row( children: [ - Container( - height: 85.0, - width: 85.0, - child: CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * - 12, - // radius: (52) - child: ClipRRect( - borderRadius: - BorderRadius.circular(50), - child: Image.network( - model - .insuranceApproval[ - indexInsurance] - .doctorImage, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: Colors.transparent, - ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalStatusDescption != + null + ? model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalStatusDescption ?? + "" + : "", + color: model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalStatusDescption != + null + ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), ), ], ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 25.0, - ), - Row( - children: [ - Texts( - 'Clinic: ', - color: Colors.grey[500], - fontSize: 14, - ), - Expanded( - child: Texts( - model - .insuranceApproval[ - indexInsurance] - .clinicName, - fontSize: 14, + Row( + children: [ + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .doctorName + .toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( + children: [ + Column( + children: [ + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig + .imageSizeMultiplier * + 12, + // radius: (52) + child: ClipRRect( + borderRadius: + BorderRadius.circular( + 50), + child: Image.network( + model + .insuranceApprovalInPatient[ + indexInsurance] + .doctorImage, + fit: BoxFit.fill, + width: 700, + ), ), - ) - ], - ), - Row( - children: [ - Texts( - 'Approval No: ', - color: Colors.grey[500], - fontSize: 14, + backgroundColor: + Colors.transparent, ), - Texts( - model - .insuranceApproval[ - indexInsurance] - .approvalNo - .toString(), - fontSize: 14, - ) - ], - ), - Row( - children: [ - Texts( - 'Unused Count:', - color: Colors.grey[500], - fontSize: 14, - ), - Texts(model - .insuranceApproval[ - indexInsurance] - .unUsedCount - .toString(), - fontSize: 14, - ) - - ], - ), - Row( - children: [ - Texts( - 'Company Name :', - color: Colors.grey[500], - ), - Texts('Sample') - ], + ), + ], + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( + children: [ + AppText( + 'Clinic: ', + color: Colors.grey[500], + fontSize: 14, + ), + Expanded( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .clinicName, + fontSize: 14, + ), + ) + ], + ), + Row( + children: [ + AppText( + 'Approval No: ', + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + .unUsedCount + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Company Name :', + color: Colors.grey[500], + ), + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + 'Receipt on: ', + color: Colors.grey[500], + ), + Expanded( + child: AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ), + ], + ), + Row( + children: [ + AppText( + 'Exp on: ', + color: Colors.grey[500], + ), + AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ], + ), + ], + ), ), - Row( + ), + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( children: [ - Texts( - 'Receipt on: ', - color: Colors.grey[500], - ), Expanded( - child: Texts( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, + child: AppText( + 'Procedure', + fontWeight: FontWeight.w700, ), ), - ], - ), - Row( - children: [ - Texts( - 'Exp on: ', - color: Colors.grey[500], - ), - Texts( - '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', - color: Colors.black, - fontWeight: FontWeight.w600, + Expanded( + child: AppText( + 'Status', + fontWeight: FontWeight.w700, + ), ), + Expanded( + child: AppText( + 'Usage Status', + fontWeight: FontWeight.w700, + ), + ) ], ), - ], - ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApprovalInPatient[ + indexInsurance] + .apporvalDetails + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "", + textAlign: + TextAlign + .start, + ), + ), + ), + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "", + textAlign: + TextAlign + .center, + ), + ), + ), + Expanded( + child: Container( + child: AppText( + model + .insuranceApprovalInPatient[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "", + textAlign: + TextAlign + .center, + ), + ), + ), + ], + ), + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), + ), + ], ), ), ], ), ), - SizedBox( - height: 20.0, + ), + ], + ), + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], ), - Container( + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), child: Column( children: [ + Row( + children: [ + AppText( + model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption != + null + ? model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption ?? + "" + : "", + color: model + .insuranceApproval[ + indexInsurance] + .approvalStatusDescption != + null + ? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127) + : Color(0xffD02127), + ), + ], + ), + Row( + children: [ + AppText( + model + .insuranceApproval[indexInsurance] + .doctorName + .toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0), child: Row( children: [ - Expanded( - child: Texts( - 'Procedure', - fontWeight: FontWeight.w700, - ), - ), - Expanded( - child: Texts( - 'Status', - fontWeight: FontWeight.w700, - ), + Column( + children: [ + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: SizeConfig + .imageSizeMultiplier * + 12, + // radius: (52) + child: ClipRRect( + borderRadius: + BorderRadius.circular( + 50), + child: Image.network( + model + .insuranceApproval[ + indexInsurance] + .doctorImage, + fit: BoxFit.fill, + width: 700, + ), + ), + backgroundColor: + Colors.transparent, + ), + ), + ], ), Expanded( - child: Texts( - 'Usage Status', - fontWeight: FontWeight.w700, - ), - ) - ], - ), - ), - Divider( - color: Colors.black, - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model - .insuranceApproval[indexInsurance] - .apporvalDetails - .length, - itemBuilder: (BuildContext context, - int index) { - return Container( + child: Padding( + padding: + const EdgeInsets.symmetric( + horizontal: 8.0), child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, children: [ + SizedBox( + height: 25.0, + ), Row( - children: [ - Expanded( - child: Container( - - child: Texts(model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.procedureName ?? - "",textAlign: TextAlign.start,), - ), + AppText( + 'Clinic: ', + color: Colors.grey[500], + fontSize: 14, ), Expanded( - child: Container( - - child: Texts(model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.status ?? - "",textAlign: TextAlign.center,), + child: AppText( + model + .insuranceApproval[ + indexInsurance] + .clinicName, + fontSize: 14, ), + ) + ], + ), + Row( + children: [ + AppText( + 'Approval No: ', + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApproval[ + indexInsurance] + .approvalNo + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Unused Count:', + color: Colors.grey[500], + fontSize: 14, + ), + AppText( + model + .insuranceApproval[ + indexInsurance] + .unUsedCount + .toString(), + fontSize: 14, + ) + ], + ), + Row( + children: [ + AppText( + 'Company Name :', + color: Colors.grey[500], + ), + AppText('Sample') + ], + ), + Row( + children: [ + AppText( + 'Receipt on: ', + color: Colors.grey[500], ), Expanded( - child: Container( - child: Texts(model - .insuranceApproval[ - indexInsurance] - ?.apporvalDetails[ - index] - ?.isInvoicedDesc ?? - "",textAlign: TextAlign.center,), + child: AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, ), ), ], ), - SizedBox(width: 5,), - Divider( - color: Colors.black38, + Row( + children: [ + AppText( + 'Exp on: ', + color: Colors.grey[500], + ), + if(model.insuranceApproval[indexInsurance].expiryDate!=null) + AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), + ], ), ], ), - ); - }), + ), + ), + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Row( + children: [ + Expanded( + child: AppText( + 'Procedure', + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + 'Status', + fontWeight: FontWeight.w700, + ), + ), + Expanded( + child: AppText( + 'Usage Status', + fontWeight: FontWeight.w700, + ), + ) + ], + ), + ), + Divider( + color: Colors.black, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: ListView.builder( + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: model + .insuranceApproval[ + indexInsurance] + .apporvalDetails + .length, + itemBuilder: + (BuildContext context, + int index) { + return Container( + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.procedureName ?? + "", + textAlign: + TextAlign + .start, + ), + ), + ), + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.status ?? + "", + textAlign: + TextAlign + .center, + ), + ), + ), + Expanded( + child: Container( + child: AppText( + model + .insuranceApproval[ + indexInsurance] + ?.apporvalDetails[ + index] + ?.isInvoicedDesc ?? + "", + textAlign: + TextAlign + .center, + ), + ), + ), + ], + ), + SizedBox( + width: 5, + ), + Divider( + color: Colors.black38, + ), + ], + ), + ); + }), + ), + ], + ), ), - ], ), ), - ], - ), + ), + ], ), ), - ], - ), - ), - )), + )), ); } } diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/header.dart new file mode 100644 index 00000000..0fbcdf1a --- /dev/null +++ b/lib/screens/patients/patient_search/header.dart @@ -0,0 +1,43 @@ +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 HeaderInSearch extends StatelessWidget with PreferredSizeWidget { + final String title; + + const HeaderInSearch({Key key, this.title}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 35), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + fontFamily: 'Poppins', + ), + ), + ]), + ), + ); + } + + @override + + Size get preferredSize => Size(double.maxFinite,65); +} diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart new file mode 100644 index 00000000..c17c173a --- /dev/null +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -0,0 +1,310 @@ +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/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:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class PatientSearchScreenNew extends StatefulWidget { + @override + _PatientSearchScreenNewState createState() => _PatientSearchScreenNewState(); +} + +class _PatientSearchScreenNewState extends State { + bool showOther = false; + bool isFormSubmitted = false; + TextEditingController patientFileInfoController = TextEditingController(); + TextEditingController firstNameInfoController = TextEditingController(); + TextEditingController middleNameInfoController = TextEditingController(); + TextEditingController lastNameFileInfoController = TextEditingController(); + PatientType selectedPatientType = PatientType.inPatient; + AuthViewModel authProvider; + + @override + Widget build(BuildContext context) { + authProvider =Provider.of(context); + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: Column( + children: [ + BottomSheetTitle( + title: TranslationBase.of(context).searchPatient), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + // AppText( + // 'Patient Type', + // fontWeight: FontWeight.w600, + // ), + // Row( + // children: [ + // Row( + // children: [ + // Radio( + // activeColor: Color(0xFFB9382C), + // value: PatientType.inPatient, + // groupValue: selectedPatientType, + // onChanged: (value) { + // setState(() { + // selectedPatientType = + // PatientType.inPatient; + // }); + // }, + // ), + // Text('InPatient'), + // ], + // ), + // Row( + // children: [ + // Radio( + // activeColor: Color(0xFFB9382C), + // value: PatientType.OutPatient, + // groupValue: selectedPatientType, + // onChanged: (value) { + // setState(() { + // selectedPatientType = + // PatientType.OutPatient; + // }); + // }, + // ), + // Text('OutPatient'), + // ], + // ), + // ], + // ), + SizedBox( + height: 10, + ), + Container( + margin: + EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .patpatientIDMobilenationalientID, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: patientFileInfoController, + validationError: (isFormSubmitted && ( + patientFileInfoController + .text.isEmpty && + firstNameInfoController + .text.isEmpty && + middleNameInfoController + .text.isEmpty && + lastNameFileInfoController + .text.isEmpty)) + ? TranslationBase.of(context).emptyMessage + : null, + ), + ), + SizedBox( + height: 5, + ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // InkWell( + // child: this.showOther == false + // ? AppText( + // TranslationBase.of(context) + // .searchWithOther, + // color: Colors.red, + // fontWeight: FontWeight.bold, + // ) + // : AppText( + // TranslationBase.of(context) + // .hideOtherCriteria, + // color: Colors.red, + // fontWeight: FontWeight.bold), + // onTap: () { + // setState(() { + // this.showOther = !this.showOther; + // }); + // }, + // ) + // ], + // ), + // SizedBox( + // height: 30, + // ), + // if (showOther) + // Column( + // children: [ + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).firstName, + // controller: firstNameInfoController, + // maxLines: 1, + // minLines: 1, + // hasBorder: true, + // onChanged: (_) {}, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).middleName, + // controller: middleNameInfoController, + // maxLines: 1, + // minLines: 1, + // onChanged: (_) {}, + // hasBorder: true, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).lastName, + // controller: lastNameFileInfoController, + // maxLines: 1, + // minLines: 1, + // onChanged: (_) {}, + // hasBorder: true, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // ], + // ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + ])), + ), + ], + ), + ), + ), + 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: () { + onSubmitSearch(); + }, + color: Colors.red[800], + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), + ); + } + + onSubmitSearch() { + GifLoaderDialogUtils.showMyDialog(context); + setState(() { + isFormSubmitted = true; + }); + PatientSearchRequestModel patientSearchRequestModel = + PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID); + if (showOther) { + patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); + patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); + patientSearchRequestModel.lastName = lastNameFileInfoController.text.isEmpty?"0":lastNameFileInfoController.text.trim(); + } + + if (patientFileInfoController.text.isNotEmpty) { + if (patientFileInfoController.text.length == 10 && + (patientFileInfoController.text[0] == '2' || + patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = + patientFileInfoController.text; + patientSearchRequestModel.searchType = 2; + patientSearchRequestModel.patientID = 0; + } else if ((patientFileInfoController.text.length == 10 || + patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && + patientFileInfoController.text[1] == '5') || + patientFileInfoController.text[0] == '5')) { + patientSearchRequestModel.mobileNo = patientFileInfoController.text; + patientSearchRequestModel.searchType = 0; + } else { + patientSearchRequestModel.patientID = + int.parse(patientFileInfoController.text); + patientSearchRequestModel.searchType = 1; + } + } + + GifLoaderDialogUtils.hideDialog(context); + + if (patientFileInfoController.text.isNotEmpty || + firstNameInfoController.text.isNotEmpty || + middleNameInfoController.text.isNotEmpty || + lastNameFileInfoController.text.isNotEmpty) { + setState(() { + isFormSubmitted = false; + }); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => PatientsScreenNew( + selectedPatientType: selectedPatientType, + patientSearchRequestModel: patientSearchRequestModel, + isSearchWithKeyInfo: + patientFileInfoController.text.isNotEmpty ? true : false, + isSearch: true, + isSearchAndOut:true, + searchKey: patientFileInfoController.text, + isInpatient: false, + ), + ), + ); + } + } +} diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart new file mode 100644 index 00000000..7074bda9 --- /dev/null +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -0,0 +1,259 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_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/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.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'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class PatientsScreenNew extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + final arrivalType; + final isView; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + final bool isSearch; + final bool isInpatient; + final bool isSearchAndOut; + final String searchKey; + + + PatientsScreenNew( + {this.patientSearchForm, + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + + @override + _PatientsScreenNewState createState() => _PatientsScreenNewState(); +} + +class _PatientsScreenNewState extends State { + int clinicId; + AuthViewModel authProvider; + + List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + + int _activeLocation = 0; + String patientType; + String patientTypeTitle; + var selectedFilter = 1; + String arrivalType; + ProjectViewModel projectsProvider; + var isView; + final _controller = TextEditingController(); + + PatientModel patient; + + + @override + Widget build(BuildContext context) { + authProvider = Provider.of(context); + _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + final screenSize = MediaQuery.of(context).size; + + + return BaseView( + onModelReady: (model) async { + if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + await model.getOutPatient(widget.patientSearchRequestModel); + + } else { + await model.getPatientFileInformation(widget.patientSearchRequestModel); + + } + }, + builder: (_, model, w) => AppScaffold( + appBarTitle: "Search Patient", + isShowAppBar: true, + appBar: !widget.isSearch && !widget.isInpatient?HeaderInSearch( + title: "My Out patient", + ):HeaderInSearch( + title: "Search for ${widget.searchKey}", + ), + baseViewModel: model, + body: Column( + children: [ + if(!widget.isInpatient && !widget.isSearch) + Container( + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils + .containerBorderDecoration( + Color(0Xffffffff), + Color(0xFFCCCCCC), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item + ? true + : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ), + + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isFromSearch:widget.isSearchAndOut, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + "isSearchAndOut": widget.isSearchAndOut, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + })), + ), + ], + ) + ), + ); + } +} diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart new file mode 100644 index 00000000..0d376b02 --- /dev/null +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -0,0 +1,102 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class TimeBar extends StatefulWidget { + final PatientSearchViewModel model; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + + + const TimeBar({Key key, this.model, this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo}) : super(key: key); + @override + _TimeBarState createState() => _TimeBarState(); +} + +class _TimeBarState extends State { + + + @override + Widget build(BuildContext context) { + List _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + int _activeLocation = 0; + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + // border: Border.all( + // width: 0.5, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + onTap: () async{ + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.getPatientBasedOnDate(item:item,selectedPatientType:widget.selectedPatientType, patientSearchRequestModel:widget.patientSearchRequestModel, isSearchWithKeyInfo:widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10), + topRight: Radius.circular(10)), + color: Colors.white), + alignment: Alignment.center, + height: 1, + width: SizeConfig.screenWidth * 0.23, + ) + : Container() + ]); + }).toList(), + ), + ); + } +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index ecb27d3c..db7a2e21 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,5 +1,4 @@ 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/routes.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -15,11 +14,11 @@ import '../../config/config.dart'; import '../../config/size_config.dart'; import '../../lookups/patient_lookup.dart'; import '../../widgets/patients/dynamic_elements.dart'; -import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; -import '../../widgets/shared/app_text_form_field.dart'; import '../../widgets/shared/app_texts_widget.dart'; +import '../../widgets/shared/buttons/app_buttons_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; +import '../../widgets/shared/text_fields/app_text_form_field.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -86,7 +85,7 @@ class _PatientSearchScreenState extends State { ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && _selectedType == "6")) { - // helpers.showErrorToast("Please Choose The Dates"); + // Helpers.showErrorToast("Please Choose The Dates"); } else { setState(() { isFormSubmitted = false; @@ -111,7 +110,7 @@ class _PatientSearchScreenState extends State { handelCatchErrorCase(err) { //isLoading = false; //isError = true; - error = helpers.generateContactAdminMsg(err); + error = Helpers.generateContactAdminMsg(err); //notifyListeners(); throw err; } @@ -125,260 +124,240 @@ class _PatientSearchScreenState extends State { }, child: AppScaffold( appBarTitle: TranslationBase.of(context).searchPatient, - isShowAppBar: false, - body: ListView( - children: [ - RoundedContainer( - child: Column( - children: [ - Column( - children: [ - // Container( - // child: Icon( - // DoctorApp.search_patient_1, - // size: 100, - // color: Colors.black, - // ), - // margin: EdgeInsets.only(top: 10), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 12.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionTitle - // .toUpperCase(), - // fontWeight: FontWeight.bold, - // fontSize: SizeConfig.heightMultiplier * 2.5, - // ), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 5.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionBody, - // fontSize: SizeConfig.heightMultiplier * 2, - // ), - // ) - ], - ), - Container( - padding: EdgeInsets.all(15), - width: SizeConfig.screenWidth * 1, - child: Form( - key: _formKey, - autovalidate: _autoValidate, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 15, - ), - if (_selectedType != '7') - 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( - labelText: TranslationBase.of(context) - .patpatientIDMobilenationalientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - if (value != null && value != '') { - if (value.length == 10 && - (value[0] == '2' || value[0] == '1')) { - _patientSearchFormValues - .IdentificationNo = value; - _patientSearchFormValues.Searchtype = 2; - _patientSearchFormValues.setPatientID = 0; - } else if ((value.length == 10 || - value.length == 9) && - ((value[0] == '0' && value[1] == '5') || - value[0] == '5')) { - _patientSearchFormValues.MobileNo = value; - _patientSearchFormValues.Searchtype = 0; - } else { - _patientSearchFormValues.setPatientID = - int.parse(value); - _patientSearchFormValues.Searchtype = 1; + isShowAppBar: true, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RoundedContainer( + showBorder: false, + child: Column( + children: [ + Column( + children: [ + // Container( + // child: Icon( + // DoctorApp.search_patient_1, + // size: 100, + // color: Colors.black, + // ), + // margin: EdgeInsets.only(top: 10), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 12.0), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientImageCaptionTitle + // .toUpperCase(), + // fontWeight: FontWeight.bold, + // fontSize: SizeConfig.heightMultiplier * 2.5, + // ), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 5.0), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientImageCaptionBody, + // fontSize: SizeConfig.heightMultiplier * 2, + // ), + // ) + ], + ), + Container( + padding: EdgeInsets.all(15), + width: SizeConfig.screenWidth * 1, + child: Form( + key: _formKey, + autovalidate: _autoValidate, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 15, + ), + if (_selectedType != '7') + 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( + labelText: TranslationBase.of(context) + .patpatientIDMobilenationalientID, + borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, + onSaved: (value) { + if (value != null && value != '') { + if (value.length == 10 && + (value[0] == '2' || + value[0] == '1')) { + _patientSearchFormValues + .IdentificationNo = value; + _patientSearchFormValues.Searchtype = 2; + _patientSearchFormValues.setPatientID = + 0; + } else if ((value.length == 10 || + value.length == 9) && + ((value[0] == '0' && + value[1] == '5') || + value[0] == '5')) { + _patientSearchFormValues.MobileNo = + value; + _patientSearchFormValues.Searchtype = 0; + } else { + _patientSearchFormValues.setPatientID = + int.parse(value); + _patientSearchFormValues.Searchtype = 1; + } } - } - // else{ + // else{ - // } + // } - // value == null || value == '' - // ? _patientSearchFormValues.setPatientID = - // 0 - // : _patientSearchFormValues.setPatientID = - // int.parse(value); + // value == null || value == '' + // ? _patientSearchFormValues.setPatientID = + // 0 + // : _patientSearchFormValues.setPatientID = + // int.parse(value); - // if (value != null && - // value.toString().trim().isEmpty) { - // _patientSearchFormValues.setPatientID = 0; - // } - }, + // if (value != null && + // value.toString().trim().isEmpty) { + // _patientSearchFormValues.setPatientID = 0; + // } + }, + ), ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // InkWell( - // child: this.isView == false - // ? AppText( - // TranslationBase.of(context) - // .searchWithOther, - // color: Colors.red, - // fontWeight: FontWeight.bold, - // ) - // : AppText( - // TranslationBase.of(context) - // .hideOtherCriteria, - // color: Colors.red, - // fontWeight: FontWeight.bold), - // onTap: () { - // setState(() { - // this.isView = !this.isView; - // }); - // }, - // ) - // ], - // ), - isView == true - ? Column(children: [ - SizedBox( - height: 10, - ), - Container( - height: 65.0, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.0, - style: BorderStyle.solid, - color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // InkWell( + // child: this.isView == false + // ? AppText( + // TranslationBase.of(context) + // .searchWithOther, + // color: Colors.red, + // fontWeight: FontWeight.bold, + // ) + // : AppText( + // TranslationBase.of(context) + // .hideOtherCriteria, + // color: Colors.red, + // fontWeight: FontWeight.bold), + // onTap: () { + // setState(() { + // this.isView = !this.isView; + // }); + // }, + // ) + // ], + // ), + isView == true + ? Column(children: [ + SizedBox( + height: 10, ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return PATIENT_TYPE_Des.map( + Container( + height: 65.0, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1.0, + style: BorderStyle.solid, + color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + ), + ), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * + 0.9, + bottom: SizeConfig.widthMultiplier * + 0.9, + right: + SizeConfig.widthMultiplier * 3, + left: + SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return PATIENT_TYPE_Des.map( + (item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + !projectsProvider + .isArabic + ? AppText( + item['text'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ) + : AppText( + item['text_ar'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (String newValue) => + { + setState(() { + _selectedType = newValue; + selectedPatientType = + int.parse( + _selectedType); + }) + }, + items: PATIENT_TYPE_Des.map( (item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - !projectsProvider.isArabic - ? AppText( - item['text'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ) - : AppText( - item['text_ar'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], + !projectsProvider.isArabic + ? itemText = item['text'] + : itemText = + item['text_ar']; + return DropdownMenuItem( + child: Text( + itemText, + textAlign: TextAlign.end, + ), + value: item['val'], ); - }).toList(); - }, - onChanged: (String newValue) => { - setState(() { - _selectedType = newValue; - selectedPatientType = - int.parse(_selectedType); - }) - }, - items: - PATIENT_TYPE_Des.map((item) { - !projectsProvider.isArabic - ? itemText = item['text'] - : itemText = - item['text_ar']; - return DropdownMenuItem( - child: Text( - itemText, - textAlign: TextAlign.end, - ), - value: item['val'], - ); - }).toList(), - )), - ), - ], + }).toList(), + )), + ), + ], + ), ), ), - ), - 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( - labelText: TranslationBase.of(context) - .firstName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setFirstName = "0" - : _patientSearchFormValues - .setFirstName = value; - - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setFirstName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - if (_selectedType != '7') + SizedBox( + height: 10, + ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -388,222 +367,274 @@ class _PatientSearchScreenState extends State { color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( - labelText: TranslationBase.of(context) - .phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = "0" - : _patientSearchFormValues - .setPatientMobileNumber = - value; + labelText: TranslationBase.of(context) + .firstName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setFirstName = "0" + : _patientSearchFormValues + .setFirstName = value; + + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setFirstName = "0"; + } + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, + ), + if (_selectedType != '7') + 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( + labelText: TranslationBase.of(context) + .phoneNumber, + borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientMobileNumber = + "0" + : _patientSearchFormValues + .setPatientMobileNumber = + value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; - } - }, + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setPatientMobileNumber = "0"; + } + }, + ), ), + 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( - labelText: TranslationBase.of(context) - .middleName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setMiddleName = "0" - : _patientSearchFormValues - .setMiddleName = value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setMiddleName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - 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( - labelText: TranslationBase.of(context) - .lastName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setLastName = "0" - : _patientSearchFormValues - .setLastName = value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setLastName = "0"; - } - }, - inputFormatter: ONLY_LETTERS), - ), - 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( + 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( + labelText: TranslationBase.of(context) + .middleName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setMiddleName = "0" + : _patientSearchFormValues + .setMiddleName = value; + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setMiddleName = "0"; + } + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), + ), + 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( + labelText: TranslationBase.of(context) + .lastName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setLastName = "0" + : _patientSearchFormValues + .setLastName = value; + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setLastName = "0"; + } + }, + inputFormatter: ONLY_LETTERS), + ), + 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( + labelText: TranslationBase.of(context) + .patientID, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText2, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientID = 0 + : _patientSearchFormValues + .setPatientID = + int.parse(value); + if (value != null && + value + .trim() + .toString() + .isEmpty) { + _patientSearchFormValues + .setPatientID = 0; + } + }), + ), + 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( labelText: TranslationBase.of(context) - .patientID, + .patientFile, borderColor: Colors.white, textInputType: TextInputType.number, + focusNode: _nodeText3, inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText2, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientID = 0 - : _patientSearchFormValues - .setPatientID = - int.parse(value); - if (value != null && - value.trim().toString().isEmpty) { - _patientSearchFormValues - .setPatientID = 0; - } - }), - ), - 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( - labelText: TranslationBase.of(context) - .patientFile, - borderColor: Colors.white, - textInputType: TextInputType.number, - focusNode: _nodeText3, - inputFormatter: ONLY_NUMBERS, - onSaved: (value) {}, + onSaved: (value) {}, + ), ), + (!(_selectedType == '2' || + _selectedType == '4')) + ? DynamicElements( + _patientSearchFormValues, + isFormSubmitted) + : SizedBox( + height: 0, + ), + SizedBox( + height: 10, + ), + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), + height: 25, + width: 25, + child: Checkbox( + value: onlyArrived, + checkColor: HexColor("#2A930A"), + activeColor: Colors.white, + onChanged: (bool newValue) { + setState(() { + onlyArrived = newValue; + }); + }), + ), + SizedBox( + width: 12, + ), + AppText( + TranslationBase.of(context) + .onlyArrivedPatient, + fontSize: + SizeConfig.textMultiplier * + 2), + ])), + SizedBox( + height: 10, + ), + ]) + : SizedBox( + height: 0, ), - (!(_selectedType == '2' || - _selectedType == '4')) - ? DynamicElements( - _patientSearchFormValues, - isFormSubmitted) - : SizedBox( - height: 0, - ), - SizedBox( - height: 10, - ), - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - height: 25, - width: 25, - child: Checkbox( - value: onlyArrived, - checkColor: HexColor("#2A930A"), - activeColor: Colors.white, - onChanged: (bool newValue) { - setState(() { - onlyArrived = newValue; - }); - }), - ), - SizedBox( - width: 12, - ), - AppText( - TranslationBase.of(context) - .onlyArrivedPatient, - fontSize: - SizeConfig.textMultiplier * 2), - ])), - SizedBox( - height: 10, - ), - ]) - : SizedBox( - height: SizeConfig.screenHeight * .45, - ), - ], + ], + ), ), ), + ], + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).search, + color: Colors.red[800], + onPressed: () { + _validateInputs(); + }, + ), + ], + ), ), ], ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).search, - onPressed: () { - _validateInputs(); - }, - ), - ], - ), - ), - ], - ), - ], - ), + ]), ), ); } diff --git a/lib/screens/patients/patients_referred_screen.dart b/lib/screens/patients/patients_referred_screen.dart deleted file mode 100644 index df1427c2..00000000 --- a/lib/screens/patients/patients_referred_screen.dart +++ /dev/null @@ -1,103 +0,0 @@ -/* - *@author: Amjad Amireh Modified Referred Patients - *@Date:27/5/2020 - - - *@desc: - */ - -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable_item_widget.dart'; -import 'package:flutter/material.dart'; - -class PatientReferredScreen extends StatefulWidget { - PatientReferredScreen({Key key}) : super(key: key); - - @override - _PatientReferredScreenState createState() => _PatientReferredScreenState(); -} - -class _PatientReferredScreenState extends State { - - String patientType; - String patientTypetitle; - - List>list_product; - @override - void initState() { - super.initState(); - list_product=new List(); - for(var k=1;k<=5;k++) - { - Map map=Map(); - map.putIfAbsent(getName(k), ()=>getContent()); - list_product.add(map); - - } - list_product.map((s){ - - }).map((list)=>list).toList();} - - - - @override - Widget build(BuildContext context) { - - Listlist=List(); - - return AppScaffold( - //TODO : add Translation - appBarTitle: "My Referred Patients",//patientTypetitle, - body: Center( - - child: ListView( - children: [ - for(final map in list_product) - for(final keys in map.keys) - ExpandableItem(keys,map[keys].toList()) - , - ], - ) - ), - - ); - } - - - String getName(int month) - { - switch(month) - { - case 1: - return "Mahmoud Shrouf"; - case 2: - return "Mahmoud Shrouf"; - case 3: - return "Mahmoud Shrouf"; - case 4: - return "Mahmoud Shrouf"; - case 5: - return "Mahmoud Shrouf"; - case 6: - return "Mahmoud Shrouf"; - case 7: - return "Mahmoud Shrouf"; - case 8: - return "Mahmoud Shrouf"; - case 9: - return "Mahmoud Shrouf"; - case 10: - return "Mahmoud Shrouf"; - case 11: - return "Mahmoud Shrouf"; - case 12: - return "Mahmoud Shrouf"; - } - } - - List getContent() - { - - return ["1","2","3","4","5","6"].toList(); - } -} \ No newline at end of file diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5cc7a06a..586d0238 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -13,16 +13,15 @@ import 'package:doctor_app_flutter/models/patient/topten_users_res_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/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/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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'; import 'package:intl/intl.dart'; @@ -69,7 +68,7 @@ class _PatientsScreenState extends State { List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; - + bool isInpatient = false; bool _isInit = true; String patientType; bool isSearch = false; @@ -275,6 +274,9 @@ class _PatientsScreenState extends State { if (routeArgs != null && routeArgs.containsKey('activeFilter')) { _activeLocation = routeArgs['activeFilter']; } + if (routeArgs != null && routeArgs.containsKey('isInpatient')) { + isInpatient = routeArgs['isInpatient']; + } if (!projectsProvider.isArabic) patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; @@ -384,7 +386,7 @@ class _PatientsScreenState extends State { }); }, builder: (_, model, w) => AppScaffold( - appBarTitle: patientTypeTitle, + appBarTitle: isSearch? "Search Patient": patientTypeTitle, isShowAppBar: widget.isAppbar, isLoading: _isLoading, body: _isLoading @@ -395,21 +397,61 @@ class _PatientsScreenState extends State { ? Column( children: [ Column(children: [ - SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: SizeConfig.screenHeight * 0.08, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, - TranslationBase.of(context) - .searchPatientName), - ), - ), + // Container( + // width: SizeConfig.screenWidth * 0.9, + // height: 75, + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"), + // ), + // color: Colors.white), + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.only( + // left: 10, top: 10), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientName, + // fontSize: 13, + // )), + // AppTextFormField( + // // focusNode: focusProject, + // controller: _controller, + // borderColor: Colors.white, + // prefix: IconButton( + // icon: Icon( + // DoctorApp.filter_1, + // color: Colors.black, + // ), + // iconSize: 20, + // padding: + // EdgeInsets.only(bottom: 30), + // ), + // onChanged: (String str) { + // this.searchData(str); + // }), + // ])), + + // Container( + // width: SizeConfig.screenWidth * 0.9, + // height: SizeConfig.screenHeight * 0.08, + // child: TextField( + // controller: _controller, + // onChanged: (String str) { + // this.searchData(str); + // }, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context) + // .searchPatientName), + // ), + // ), SizedBox( height: 10.0, ), @@ -434,7 +476,7 @@ class _PatientsScreenState extends State { // child: _locationBar(context) child: SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + "List_MyOutPatient" ? _locationBar(context, model) : Container(), ) @@ -452,7 +494,7 @@ class _PatientsScreenState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context) + child: AppText(TranslationBase.of(context) .youDontHaveAnyPatient), ) ], @@ -486,42 +528,84 @@ class _PatientsScreenState extends State { : Column( children: [ SizedBox(height: 18.5), + Container( - width: SizeConfig.screenWidth * 0.9, - height: - SizeConfig.screenHeight * 0.08, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, - TranslationBase.of(context) - .searchPatientName), - ), - ), + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + this.searchData(str); + }), + ])), + // Container( + // width: SizeConfig.screenWidth * 0.9, + // height: + // SizeConfig.screenHeight * 0.08, + // child: TextField( + // controller: _controller, + // onChanged: (String str) { + // this.searchData(str); + // }, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context) + // .searchPatientName), + // ), + // ), SizedBox( height: 10.0, ), - if (int.parse(patientType) == 7) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular( - 10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic( - newValue, context, model); - }, - )), + // if (int.parse(patientType) == 7) + // Container( + // padding: EdgeInsets.all(5), + // decoration: BoxDecoration( + // color: Colors.white, + // border: Border.all( + // color: Colors.grey), + // borderRadius: + // BorderRadius.circular(10)), + // child: ClinicList( + // clinicId: clinicId, + // onClinicChange: (newValue) { + // clinicId = newValue; + // changeClinic( + // newValue, context, model); + // }, + // )), Padding( padding: EdgeInsets.only( top: MediaQuery.of(context) @@ -531,7 +615,7 @@ class _PatientsScreenState extends State { // child: _locationBar(context) child: SERVICES_PATIANT2[ int.parse(patientType)] == - "patientArrivalList" + "List_MyOutPatient" ? _locationBar(context, model) : Container(), ), @@ -552,6 +636,8 @@ class _PatientsScreenState extends State { patientType, arrivalType: arrivalType, + isInpatient: + isInpatient, onTap: () { Navigator.of(context) .pushNamed( @@ -566,8 +652,12 @@ class _PatientsScreenState extends State { .getTo, "isSearch": isSearch, + "isInpatient": + isInpatient, "arrivalType": arrivalType, + "isInpatient": + isInpatient }); }, ); @@ -588,7 +678,7 @@ class _PatientsScreenState extends State { padding: const EdgeInsets .all(8.0), - child: Texts( + child: AppText( TranslationBase.of( context) .youDontHaveAnyPatient), @@ -689,37 +779,15 @@ class _PatientsScreenState extends State { }); GifLoaderDialogUtils.hideDialog(context); }).catchError((error) { - helpers.showErrorToast(error.toString()); + Helpers.showErrorToast(error.toString()); GifLoaderDialogUtils.hideDialog(context); }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } - InputDecoration buildInputDecoration(BuildContext context, hint) { - return InputDecoration( - suffixIcon: IconButton( - icon: Icon(DoctorApp.search_patient), - color: Colors.grey, - onPressed: () {}, - iconSize: 30, - ), - filled: true, - fillColor: Colors.white, - hintText: hint, - hintStyle: TextStyle(fontSize: 1.66 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey), //), - )); - } - Widget _locationBar(BuildContext _context, model) { return Container( height: MediaQuery.of(context).size.height * 0.0619, @@ -835,13 +903,17 @@ class _PatientsScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); int val2 = int.parse(patientType); GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 7) { - getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: _patientSearchFormValues.From, - to: _patientSearchFormValues.To, - pageIndex: 0, - pageSize: 0, - patientMRN: patient.getPatientID); + if (val2 == 0) { + patient = PatientModel( + From: _patientSearchFormValues.From, + To: _patientSearchFormValues.To, + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + ); } model diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index ec7a7355..16486b49 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -12,11 +12,10 @@ import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-wi 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/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/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/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -47,9 +46,9 @@ class _UcafDetailScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, body: Column( children: [ @@ -114,18 +113,19 @@ class _UcafDetailScreenState extends State { children: [ Expanded( child: Container( - child: BorderedButton( - TranslationBase.of(context).cancel, + child: AppButton( + title: TranslationBase.of(context).cancel, hasBorder: true, vPadding: 8, hPadding: 8, borderColor: Colors.white, - backgroundColor: Colors.white, - textColor: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.2, - handler: () { + color: Colors.white, + fontColor: HexColor("#B8382B"), + fontSize: 2.2, + onPressed: () { Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; + return route.settings.name == + PATIENTS_PROFILE; }); }, ), @@ -136,22 +136,24 @@ class _UcafDetailScreenState extends State { ), Expanded( child: Container( - child: BorderedButton( - TranslationBase.of(context).save, + child: AppButton( + title: TranslationBase.of(context).save, hasBorder: true, vPadding: 8, hPadding: 8, borderColor: HexColor("#B8382B"), - backgroundColor: HexColor("#B8382B"), - textColor: Colors.white, - fontSize: SizeConfig.textMultiplier * 2.0, - handler: () async { + color: HexColor("#B8382B"), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { await model.postUCAF(patient); if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).postUcafSuccessMsg); + TranslationBase.of(context) + .postUcafSuccessMsg); Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; + return route.settings.name == + PATIENTS_PROFILE; }); } else { DrAppToastMsg.showErrorToast(model.error); @@ -163,7 +165,6 @@ class _UcafDetailScreenState extends State { ], ), ), - ], ), )); diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index fa94d3fa..137b4ed5 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -7,18 +7,16 @@ 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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.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 '../../../../routes.dart'; -import '../../../QR_reader_screen.dart'; class UCAFInputScreen extends StatefulWidget { @override @@ -70,7 +68,7 @@ class _UCAFInputScreenState extends State { appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, - body: model.patientVitalSigns != null && + body: model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0 ? Column( @@ -186,7 +184,7 @@ class _UCAFInputScreenState extends State { width: 8, ), AppText( - "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}", + "${model.bloodPressure}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, @@ -212,7 +210,7 @@ class _UCAFInputScreenState extends State { ), Expanded( child: AppText( - "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", + "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, @@ -244,7 +242,7 @@ class _UCAFInputScreenState extends State { width: 4, ), AppText( - "${model.patientVitalSigns.pulseBeatPerMinute}", + "${model.hartRat}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, @@ -282,7 +280,7 @@ class _UCAFInputScreenState extends State { AppTextFieldCustom( hintText: TranslationBase.of(context).instruction, - dropDownText: helpers.parseHtmlString(model + dropDownText: Helpers.parseHtmlString(model .patientChiefComplaintList[0] .chiefComplaint), controller: _additionalComplaintsController, @@ -430,7 +428,7 @@ class _UCAFInputScreenState extends State { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - model.patientVitalSigns == null + model.patientVitalSignsHistory.length > 0 ? TranslationBase.of(context).vitalSignEmptyMsg : TranslationBase.of(context).chiefComplaintEmptyMsg, fontWeight: FontWeight.normal, diff --git a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart index fa3d5daa..da0381ed 100644 --- a/lib/screens/patients/profile/UCAF/page-stepper-widget.dart +++ b/lib/screens/patients/profile/UCAF/page-stepper-widget.dart @@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/config/size_config.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'; -import 'package:hexcolor/hexcolor.dart'; /// * /// By Mousa Zaid Mousa Abuzaid diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 23e33db3..20a93ff6 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -7,9 +7,9 @@ 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-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.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 876066ce..dd93be70 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 @@ -6,17 +6,14 @@ 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/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/patient-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/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'; @@ -122,7 +119,7 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).clinic, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: clinicError, dropDownText: _selectedClinic != null ? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] @@ -172,7 +169,7 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, - isDropDown: true, + isTextFieldHasSuffix: true, dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, @@ -280,7 +277,7 @@ class _AdmissionRequestThirdScreenState AppTextFieldCustom( height: screenSize.height * 0.075, hintText: TranslationBase.of(context).dietType, - isDropDown: true, + isTextFieldHasSuffix: true, dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, 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 bf896145..71a29a1e 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 @@ -1,4 +1,3 @@ -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'; @@ -8,19 +7,15 @@ 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/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/patient-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/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'; import 'package:provider/provider.dart'; @@ -115,7 +110,7 @@ class _AdmissionRequestThirdScreenState ? _selectedDiagnosis['nameEn'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: diagnosisError, onClick: model.diagnosisTypesList != null && model.diagnosisTypesList.length > 0 @@ -161,7 +156,7 @@ class _AdmissionRequestThirdScreenState ? _selectedIcd['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: icdError, onClick: model.icdCodes != null && model.icdCodes.length > 0 @@ -209,7 +204,7 @@ class _AdmissionRequestThirdScreenState ? _selectedDiagnosisType['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: diagnosisTypeError, onClick: model.listOfDiagnosisSelectionTypes != null && 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 a4aebc9f..05a43460 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 @@ -9,17 +9,14 @@ 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/patients/profile/patient-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/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'; @@ -203,12 +200,13 @@ class _AdmissionRequestSecondScreenState ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: expectedDatesError, - suffixIcon: Icon( + suffixIcon: IconButton( + icon: Icon( Icons.calendar_today, color: Colors.black, - ), + )), onClick: () { if (_expectedAdmissionDate == null) { _expectedAdmissionDate = DateTime.now(); @@ -231,7 +229,7 @@ class _AdmissionRequestSecondScreenState ? _selectedFloor['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: floorError, onClick: model.floorList != null && model.floorList.length > 0 @@ -281,7 +279,7 @@ class _AdmissionRequestSecondScreenState ? _selectedWard['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, onClick: model.wardList != null && model.wardList.length > 0 ? () { @@ -331,7 +329,7 @@ class _AdmissionRequestSecondScreenState ? _selectedRoomCategory['description'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: roomError, onClick: model.roomCategoryList != null && model.roomCategoryList.length > 0 @@ -423,7 +421,7 @@ class _AdmissionRequestSecondScreenState ? _selectedAdmissionType['nameEn'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: admissionTypeError, onClick: model.admissionTypeList != null && model.admissionTypeList.length > 0 @@ -559,72 +557,85 @@ class _AdmissionRequestSecondScreenState setState(() { if (_estimatedCostController.text == "") { - costError = TranslationBase.of(context).fieldRequired; + costError = + TranslationBase.of(context).fieldRequired; } else { costError = null; } - if (_postPlansEstimatedCostController.text == "") { - plansError = TranslationBase.of(context).fieldRequired; + if (_postPlansEstimatedCostController.text == + "") { + plansError = + TranslationBase.of(context).fieldRequired; } else { plansError = null; } if (_expectedDaysController.text == "") { - expectedDaysError = TranslationBase.of(context).fieldRequired; + expectedDaysError = + TranslationBase.of(context).fieldRequired; } else { expectedDaysError = null; } if (_expectedAdmissionDate == null) { - expectedDatesError = TranslationBase.of(context).fieldRequired; + expectedDatesError = + TranslationBase.of(context).fieldRequired; } else { expectedDatesError = null; } - if (_otherDepartmentsInterventionsController.text == "") { - otherInterventionsError = TranslationBase.of(context).fieldRequired; + if (_otherDepartmentsInterventionsController + .text == + "") { + otherInterventionsError = + TranslationBase.of(context).fieldRequired; } else { otherInterventionsError = null; } if (_selectedFloor == null) { - floorError = TranslationBase.of(context).fieldRequired; + floorError = + TranslationBase.of(context).fieldRequired; } else { floorError = null; } if (_selectedRoomCategory == null) { - roomError = TranslationBase.of(context).fieldRequired; + roomError = + TranslationBase.of(context).fieldRequired; } else { roomError = null; } if (_treatmentLineController.text == "") { - treatmentsError = TranslationBase.of(context).fieldRequired; + treatmentsError = + TranslationBase.of(context).fieldRequired; } else { treatmentsError = null; } if (_complicationsController.text == "") { - complicationsError = TranslationBase.of(context).fieldRequired; + complicationsError = + TranslationBase.of(context).fieldRequired; } else { complicationsError = null; } if (_otherProceduresController.text == "") { - proceduresError = TranslationBase.of(context).fieldRequired; + proceduresError = + TranslationBase.of(context).fieldRequired; } else { proceduresError = null; } if (_selectedAdmissionType == null) { - admissionTypeError = TranslationBase.of(context).fieldRequired; + admissionTypeError = + TranslationBase.of(context).fieldRequired; } else { admissionTypeError = null; } }); - } }, ), diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart new file mode 100644 index 00000000..bce4c725 --- /dev/null +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -0,0 +1,227 @@ +import 'package:doctor_app_flutter/core/viewModel/patient_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.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/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import '../../../routes.dart'; + + +class InPatientProfileScreen extends StatefulWidget { + @override + _InPatientProfileScreenState createState() => _InPatientProfileScreenState(); +} + +class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + String patientType; + String arrivalType; + String from; + String to; + + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + } + + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + ), + ), + )); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart deleted file mode 100644 index 9105338b..00000000 --- a/lib/screens/patients/profile/insurance_approvals_screen.dart +++ /dev/null @@ -1,493 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.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/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/shared_pref_kay.dart'; -import '../../../config/size_config.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'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: ibrahim albitar - *@Date:21/5/2020 - *@param: - *@return: - *@desc: - */ - -class InsuranceApprovalsScreen extends StatefulWidget { - @override - _InsuranceApprovalsState createState() => _InsuranceApprovalsState(); -} - -class _InsuranceApprovalsState extends State { - var approvalsList; - var filteredApprovalsList; - final _controller = TextEditingController(); - - /* - *@author: ibrahim al bitar - *@Date:21/5/2020 - *@param: - *@return: - *@desc: - */ - getInsuranceApprovalsList( - BuildContext context, PatientViewModel model) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - - print(type); - InsuranceAprovalsRequest insuranceApprovalsRequest = - InsuranceAprovalsRequest( - patientID: patient.patientId, - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2); - model - .getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){ - approvalsList = model.insuranceApporvalsList; - }); - } - - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => getInsuranceApprovalsList(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .insuranceApprovals, - body: model.insuranceApporvalsList == null || - model.insuranceApporvalsList.length == 0 - ? DrAppEmbeddedError( - error: - TranslationBase - .of(context) - .errorNoInsuranceApprovals) - : Column( - children: [ - Container( - margin: EdgeInsets.all(10), - width: SizeConfig.screenWidth * 0.80, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str, model); - }, - textInputAction: TextInputAction.done, - decoration: buildInputDecoration( - context, - TranslationBase - .of(context) - .searchInsuranceApprovals), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: ListView.builder( - itemCount: approvalsList.length, - itemBuilder: (BuildContext ctxt, int index) { - return RoundedContainer( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Row( - children: [ - Column( - children: [ - Icon( - approvalsList[index][ - "ApprovalStatusDescption"] - .toString() - .contains("Approved") - ? DoctorApp.approved_icon - : approvalsList[index][ - "ApprovalStatusDescption"] - .toString() - .contains( - "Cancelled") - ? DoctorApp - .reject_icon - : DoctorApp - .pending_icon, - color: approvalsList[index][ - "ApprovalStatusDescption"] - .toString() - .contains("Approved") - ? Colors.green - : approvalsList[index][ - "ApprovalStatusDescption"] - .toString() - .contains( - "Cancelled") - ? Colors.red - : Colors.yellow, - ), - AppText( - approvalsList[index][ - "ApprovalStatusDescption"], - fontSize: SizeConfig - .textMultiplier * - 1.5, - color: approvalsList[index][ - "ApprovalStatusDescption"] - .toString() - .contains("Approved") - ? Colors.green - : approvalsList[index][ - "ApprovalStatusDescption"] - .toString() - .contains( - "Cancelled") - ? Colors.red - : Colors.yellow, - ) - ], - ), - Expanded( - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - approvalsList[index] - ["ClinicName"], - marginTop: 10, - marginLeft: 10, - marginBottom: 5, - fontWeight: FontWeight.bold, - ), - AppText( - approvalsList[index] - ["DoctorName"], - marginLeft: 10, - marginTop: 1, - ), - AppText( - convertDateFormat( - approvalsList[index] - ["ApprovalDate"]), - marginLeft: 10, - marginBottom: 5, - color: Colors.grey[600], - ), - ], - ), - ) - ], - ), - children: [ - Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - RoundedContainer( - backgroundColor: - Color(PRIMARY_COLOR), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - approvalsList[index] - ["ApprovalNo"] - .toString(), - color: Colors.white, - fontSize: 19, - fontWeight: FontWeight.bold, - marginTop: 10, - marginLeft: 10, - marginRight: 10, - marginBottom: 2, - ), - AppText( - TranslationBase.of(context) - .approvalNo, - color: Colors.white, - fontSize: 16, - marginTop: 2, - marginLeft: 10, - marginBottom: 15, - marginRight: 10, - ), - Row( - children: [ - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .producerName, - fontSize: 10, - color: - Colors.white, - marginLeft: SizeConfig - .widthMultiplier * - 3, - ), - AppText( - checkList(approvalsList[ - index] - [ - "ApporvalDetails"]) - ? approvalsList[ - index] - [ - "ApporvalDetails"][0] - [ - "ProcedureName"] - : "", - fontSize: 12, - fontWeight: - FontWeight - .bold, - marginLeft: SizeConfig - .widthMultiplier * - 3, - marginTop: 3, - color: - Colors.white, - ), - ], - ), - ), - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .status, - fontSize: 10, - color: - Colors.white, - marginLeft: SizeConfig - .widthMultiplier * - 9, - ), - AppText( - approvalsList[ - index][ - "ApprovalStatusDescption"], - fontSize: 12, - fontWeight: - FontWeight - .bold, - marginLeft: SizeConfig - .widthMultiplier * - 9, - marginTop: 3, - color: - Colors.white, - ), - ], - ), - ), - ], - ), - Row( - children: [ - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .receiptOn, - fontSize: 10, - color: - Colors.white, - marginLeft: SizeConfig - .widthMultiplier * - 3, - marginTop: SizeConfig - .heightMultiplier * - 1.5, - ), - AppText( - convertDateFormat( - approvalsList[ - index] - [ - "ReceiptOn"]), - fontSize: 12, - fontWeight: - FontWeight - .bold, - marginLeft: SizeConfig - .widthMultiplier * - 3, - marginTop: 3, - marginBottom: - SizeConfig - .heightMultiplier * - 2, - color: - Colors.white, - ), - ], - ), - ), - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .expiryDate, - fontSize: 10, - color: - Colors.white, - marginTop: SizeConfig - .heightMultiplier * - 1.5, - marginLeft: SizeConfig - .widthMultiplier * - 9, - ), - AppText( - convertDateFormat( - approvalsList[ - index] - [ - "ExpiryDate"]), - fontSize: 12, - fontWeight: - FontWeight - .bold, - marginLeft: SizeConfig - .widthMultiplier * - 9, - marginTop: 3, - marginBottom: - SizeConfig - .heightMultiplier * - 2, - color: - Colors.white, - ), - ], - ), - ), - ], - ), - ], - )), - ], - ), - ], - )); - }), - ), - ), - ], - ), - ),); - } - - InputDecoration buildInputDecoration(BuildContext context, hint) { - return InputDecoration( - prefixIcon: Icon(Icons.search, color: Colors.black), - filled: true, - fillColor: Colors.white, - hintText: hint, - hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey), //), - )); - } - - searchData(String str, PatientViewModel model) { - var strExist = str.length > 0 ? true : false; - - if (strExist) { - filteredApprovalsList = null; - filteredApprovalsList = approvalsList - .where((note) => - note["ClinicName"].toString().contains(str.toUpperCase())) - .toList(); - setState(() { - approvalsList = filteredApprovalsList; - }); - } else { - setState(() { - approvalsList = model.insuranceApporvalsList; - }); - } - } - - convertDateFormat(String str) { - if (str == null) return ''; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } - - bool checkList(List list) { - return list.length > 0 ? true : false; - } -} diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 4bf0b0c3..fcc9746a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -4,11 +4,10 @@ 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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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:hexcolor/hexcolor.dart'; import 'lab_result_chart_and_detials.dart'; @@ -17,46 +16,50 @@ class FlowChartPage extends StatelessWidget { final PatientLabOrders patientLabOrder; final String filterName; final PatiantInformtion patient; - FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); + final bool isInpatient; + + FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, procedure: filterName,patient: patient), + patientLabOrder: patientLabOrder, + procedure: filterName, + patient: patient), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, baseViewModel: model, - body: SingleChildScrollView( - child: model.labOrdersResultsList.isNotEmpty - ? Container( + body: model.labOrdersResultsList.isNotEmpty + ? SingleChildScrollView( + child: Container( child: LabResultChartAndDetails( name: filterName, labResult: model.labOrdersResultsList, ), - ) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], + ) + : Container( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noDataAvailable, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ) + ], + ), + ), ), - ), - ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 570e3a6f..0d059000 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -4,22 +4,29 @@ 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/patients/profile/lab_result/FlowChartPage.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - class LabResultWidget extends StatelessWidget { - final String filterName; final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + final bool isInpatient; + + LabResultWidget( + {Key key, + this.filterName, + this.patientLabResultList, + this.patientLabOrder, + this.patient, + this.isInpatient}) + : super(key: key); ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -29,39 +36,42 @@ class LabResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, + // if (!isInpatient) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(filterName), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + patient: patient, + isInpatient: isInpatient, + ), ), - ), - ); - }, - child: Texts( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, + ); + }, + child: AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, + ), ), - ), - ], - ), + ], + ), Row( children: [ Expanded( child: Container( child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).description, - color: Colors.black,bold: true, + color: Colors.black, + bold: true, ), ), ), @@ -69,68 +79,87 @@ class LabResultWidget extends StatelessWidget { Expanded( child: Container( child: Center( - child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).value, + color: Colors.black, + bold: true, + ), ), ), ), Expanded( child: Container( child: Center( - child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).range, + color: Colors.black, + bold: true, + ), ), ), ) ], ), - SizedBox(height: 7,), - Divider(color: Colors.black,thickness: 1,), - SizedBox(height: 12,), - ...List.generate(patientLabResultList.length, (index) => Column( - children: [ - Row( - children: [ - Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${patientLabResultList[index].testCode}\n'+ - patientLabResultList[index].description, - textAlign: TextAlign.center, - ), - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM, - textAlign: TextAlign.center, - ), - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - patientLabResultList[index].referanceRange, - textAlign: TextAlign.center, - ), + SizedBox( + height: 7, + ), + Divider( + color: Colors.black, + thickness: 1, + ), + SizedBox( + height: 12, + ), + ...List.generate( + patientLabResultList.length, + (index) => Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${patientLabResultList[index].testCode}\n' + + patientLabResultList[index].description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + patientLabResultList[index].resultValue ??""+ + " " + + "${patientLabResultList[index].uOM ?? ""}", + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + patientLabResultList[index].referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], ), - ), - ), - ], - ), - Divider(), - ], - )) + Divider(), + ], + )) // Table( // border: TableBorder.symmetric( // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), @@ -141,27 +170,37 @@ class LabResultWidget extends StatelessWidget { ), ); } - List fullData(List labResultList,context) { + + List fullData(List labResultList, context) { List tableRow = []; tableRow.add( TableRow( children: [ Container( child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).description, - color: Colors.black,bold: true, + color: Colors.black, + bold: true, ), ), ), Container( child: Center( - child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).value, + color: Colors.black, + bold: true, + ), ), ), Container( child: Center( - child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).range, + color: Colors.black, + bold: true, + ), ), ), ], @@ -176,7 +215,7 @@ class LabResultWidget extends StatelessWidget { padding: EdgeInsets.all(10), color: Colors.white, child: Center( - child: Texts( + child: AppText( lab.description, textAlign: TextAlign.center, ), @@ -188,8 +227,8 @@ class LabResultWidget extends StatelessWidget { padding: EdgeInsets.all(10), color: Colors.white, child: Center( - child: Texts( - lab.resultValue+" "+lab.uOM, + child: AppText( + lab.resultValue + " " + lab.uOM, textAlign: TextAlign.center, ), ), @@ -200,7 +239,7 @@ class LabResultWidget extends StatelessWidget { padding: EdgeInsets.all(10), color: Colors.white, child: Center( - child: Texts( + child: AppText( lab.referanceRange, textAlign: TextAlign.center, ), @@ -213,7 +252,4 @@ class LabResultWidget extends StatelessWidget { }); return tableRow; } - } - - 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 a429507e..112680e8 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 @@ -3,12 +3,9 @@ import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class LabResultDetailsWidget extends StatefulWidget { @@ -49,7 +46,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, fontFamily: 'Poppins', ), ), @@ -63,7 +59,6 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).labResult, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, fontFamily: 'Poppins', ), // height: 60 @@ -102,7 +97,7 @@ class _VitalSignDetailsWidgetState extends State { '${projectViewModel.isArabic? DateUtils.getWeekDayArabic(date.weekday): DateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtils.getMonthArabic(date.month) : DateUtils.getMonth(date.month)} ${date.year}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), @@ -115,7 +110,7 @@ class _VitalSignDetailsWidgetState extends State { '${vital.resultValue}', fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index fe4677ae..2734286d 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -59,13 +59,13 @@ class LineChartCurvedState extends State { widget.title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', textAlign: TextAlign.center, ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 16.0, left: 6.0), + padding: const EdgeInsets.only(right: 16.0, left: 8.0), child: LineChart( sampleData1(), swapAnimationDuration: const Duration(milliseconds: 250), @@ -99,9 +99,9 @@ class LineChartCurvedState extends State { showTitles: true, getTextStyles: (value) => const TextStyle( color: Colors.black, - fontSize: 12, + fontSize: 11, ), - margin: 22, + margin: 28, rotateAngle:-65, getTitles: (value) { print(value); @@ -160,7 +160,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY(), + maxY: getMaxY()+2, minY: getMinY(), lineBarsData: getData(), ); @@ -213,8 +213,9 @@ class LineChartCurvedState extends State { spots: spots, isCurved: true, colors: [Colors.red], - barWidth: 5, + barWidth: 3, isStrokeCapRound: true, + curveSmoothness: 0.12, dotData: FlDotData( show: false, ), diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart deleted file mode 100644 index 75e4c33b..00000000 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ /dev/null @@ -1,262 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_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'; -import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; - -import '../../../../config/shared_pref_kay.dart'; -import '../../../../config/size_config.dart'; -import '../../../../models/patient/lab_orders/lab_orders_req_model.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'; -import 'lab_result_secreen.dart'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: Elham Rababah - *@Date:26/4/2020 - *@param: - *@return:LabOrdersScreen - *@desc: LabOrdersScreen class - */ - -class LabOrdersScreen extends StatefulWidget { - @override - _LabOrdersScreenState createState() => _LabOrdersScreenState(); -} - -class _LabOrdersScreenState extends State { - - - /* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: context - *@return: - *@desc: getLabResultOrders Function - */ - getLabResultOrders(BuildContext context, PatientViewModel model) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - LabOrdersReqModel labOrdersReqModel = LabOrdersReqModel( - patientID: patient.patientId, - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType??1, - languageID: 2); - - model.getLabResultOrders(labOrdersReqModel.toJson()); - } - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => getLabResultOrders(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .labOrders, - body: model.patientLabResultOrdersList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .errorNoLabOrders) - : Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: Container( - margin: EdgeInsets.symmetric(vertical: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: ListView.builder( - itemCount: - model.patientLabResultOrdersList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - LabResult( - labOrders: model - .patientLabResultOrdersList[index], - ), - ), - ); - }, - child: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10)), - border: Border( - bottom: BorderSide( - color: Colors.grey, width: 0.5), - top: BorderSide( - color: Colors.grey, width: 0.5), - left: BorderSide( - color: Colors.grey, width: 0.5), - right: BorderSide( - color: Colors.grey, width: 0.5), - ), - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - LargeAvatar( - url: model - .patientLabResultOrdersList[ - index] - .doctorImageURL, - name: model - .patientLabResultOrdersList[ - index] - .doctorName, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.fromLTRB( - 8, 0, 0, 0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if(model - .patientLabResultOrdersList[index] - .doctorName != null ) - AppText( - '${model - .patientLabResultOrdersList[index] - .doctorName}', - fontSize: 1.7 * - SizeConfig - .textMultiplier, - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 8, - ), - AppText( - ' ${model - .patientLabResultOrdersList[index] - .projectName}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Colors.grey[800]), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).invoiceNo, - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Colors.grey[800], - ), - AppText( - ' ${model - .patientLabResultOrdersList[index] - .invoiceNo}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Colors.grey[800], - ), - ], - ),SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).orderNo, - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Colors.grey[800], - ), - AppText( - ' ${model - .patientLabResultOrdersList[index] - .orderNo}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Colors.grey[800], - ), - ], - ) - ], - ), - ), - ) - ], - ), - SizedBox( - height: 3, - ), - Divider( - color: Colors.grey, - ), - SizedBox( - height: 3, - ), - Row( - children: [ - Icon( - EvaIcons.calendar, - color: Colors.grey[700], - ), - SizedBox( - width: 10, - ), - Expanded( - child: AppText( - '${Helpers.getDate(model - .patientLabResultOrdersList[index] - .createdOn)}', - fontSize: 2.0 * - SizeConfig.textMultiplier, - ), - ) - ], - ) - ], - ), - ), - ); - }), - ), - ), - ),); - } -} diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart index 6f05d865..b6699b22 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -1,12 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; - import 'Lab_Result_details_wideget.dart'; import 'LineChartCurved.dart'; @@ -51,7 +48,6 @@ class LabResultChartAndDetails extends StatelessWidget { "Graph Details", fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, fontFamily: 'Poppins', ), SizedBox(height: 8,), 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 0d8b1749..1c5104f8 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -2,23 +2,25 @@ 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/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_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.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 'laboratory_result_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; final PatiantInformtion patient; final String patientType; final String arrivalType; - LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType}); + + LaboratoryResultPage( + {Key key, + this.patientLabOrders, + this.patient, + this.patientType, + this.arrivalType}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -33,15 +35,16 @@ class _LaboratoryResultPageState extends State { clinicID: widget.patientLabOrders.clinicID, projectID: widget.patientLabOrders.projectID, orderNo: widget.patientLabOrders.orderNo, - patient: widget.patient), + patient: widget.patient, + isInpatient: widget.patientType == "1"), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: widget.patient, - patientType: widget.patientType??"0", - arrivalType: widget.arrivalType??"0", + patientType: widget.patientType ?? "0", + arrivalType: widget.arrivalType ?? "0", orderNo: widget.patientLabOrders.orderNo, - appointmentDate:widget.patientLabOrders.orderDate, + appointmentDate: widget.patientLabOrders.orderDate, doctorName: widget.patientLabOrders.doctorName, branch: widget.patientLabOrders.projectName, clinic: widget.patientLabOrders.clinicDescription, @@ -53,17 +56,18 @@ class _LaboratoryResultPageState extends State { body: SingleChildScrollView( child: Column( children: [ - ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( - onTap: () async { - - }, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - )), - + ...List.generate( + model.patientLabSpecialResult.length, + (index) => LaboratoryResultWidget( + onTap: () async {}, + billNo: widget.patientLabOrders.invoiceNo, + details: model + .patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + isInpatient: widget.patientType == "1", + )), ], ), ), 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 fdc5759d..d9132b7a 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -5,12 +5,10 @@ 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/patients/profile/lab_result/LabResultWidget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_html/flutter_html.dart'; - import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { @@ -20,13 +18,17 @@ class LaboratoryResultWidget extends StatefulWidget { final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; + final bool isInpatient; + const LaboratoryResultWidget( {Key key, this.onTap, this.billNo, this.details, this.orderNo, - this.patientLabOrder, this.patient}) + this.patientLabOrder, + this.patient, + this.isInpatient}) : super(key: key); @override @@ -41,7 +43,10 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrder, + patient: widget.patient, + isInpatient: widget.isInpatient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -77,9 +82,15 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Container( - margin: EdgeInsets.only(left: 10, right: 10), - child: Texts(TranslationBase.of(context).generalResult,bold: true,))), + Expanded( + child: Container( + margin: EdgeInsets.only( + left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .generalResult, + bold: true, + ))), Container( width: 25, height: 25, @@ -115,14 +126,15 @@ class _LaboratoryResultWidgetState extends State { children: [ ...List.generate( model.labResultLists.length, - (index) => LabResultWidget( + (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, filterName: model .labResultLists[index].filterName, patientLabResultList: model .labResultLists[index] .patientLabResultList, - patient:widget.patient, + patient: widget.patient, + isInpatient: widget.isInpatient, ), ) ], @@ -135,7 +147,6 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 10, ), - ], ), ], 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 8ae3f3ac..290f9569 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -1,44 +1,50 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; -import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; 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/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/add_lab_orders.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-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.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'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -class LabsHomePage extends StatelessWidget { +class LabsHomePage extends StatefulWidget { + @override + _LabsHomePageState createState() => _LabsHomePageState(); +} + +class _LabsHomePageState extends State { String patientType; + String arrivalType; + PatiantInformtion patient; + bool isInpatient; @override - Widget build(BuildContext context) { + void didChangeDependencies() { + super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - - PatiantInformtion patient = routeArgs['patient']; + patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; + isInpatient = routeArgs['isInpatient']; print(arrivalType); + } + + @override + Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getLabs(patient,isArrived: (patientType != null && patientType == '7' && patient.patientStatusType == 43)), + onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType), + patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -49,39 +55,41 @@ class LabsHomePage extends StatelessWidget { SizedBox( height: 12, ), - if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - 'Lab', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - Texts( - 'Result', - bold: true, - fontSize: 22, - ), - ], + if (model.patientLabOrdersList.isNotEmpty && + patient.patientStatusType != 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Lab', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), ), - ), - if(patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( 'Lab', style: "caption2", color: Colors.black, fontSize: 13, ), - Texts( + AppText( 'Result', bold: true, fontSize: 22, @@ -89,8 +97,9 @@ class LabsHomePage extends StatelessWidget { ], ), ), - if (patientType != null && patientType == '7' && patient.patientStatusType == 43) - InkWell( + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + AddNewOrder( onTap: () { Navigator.push( context, @@ -101,94 +110,99 @@ class LabsHomePage extends StatelessWidget { )), ); }, - - // () { - // addSelectedLabOrder(context, model, patient); - // }, - child: Container( - width: double.maxFinite, - height: 140, - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Container( - height: 90, - child: Column( - children: [ - Container( - height: 40, - width: 40, - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), - ), - ), - SizedBox( - height: 10, - ), - Texts( - 'Apply for New Lab Order', - color: Colors.grey[600], - fontWeight: FontWeight.w600, - ) - ], - ), - ), - ), - ), + label: 'Apply for New Lab Order', ), ...List.generate( model.patientLabOrdersList.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - arrivalType: arrivalType, - patientType: patientType, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: model.patientLabOrdersList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), ), ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), ), - doctorName: labOrder.doctorName, - invoiceNO: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - branch: labOrder.projectName, - clinic: labOrder.clinicDescription, - appointmentDate: labOrder.orderDate, - orderNo: labOrder.orderNo, - ); - }).toList(), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: model.patientLabOrdersList[index], + patient: patient, + arrivalType: arrivalType, + patientType: patientType, + ), + ), + ), + doctorName: model.patientLabOrdersList[index].doctorName, + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: model.patientLabOrdersList[index].clinicDescription, + appointmentDate: model.patientLabOrdersList[index].orderDate, + orderNo: model.patientLabOrdersList[index].orderNo, + isShowTime: false, + ), + ), + ], + ), ), ), - if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('No Lab Result Found'), + child: AppText('No Lab Result Found'), ) - ], ), ) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart new file mode 100644 index 00000000..d7506402 --- /dev/null +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -0,0 +1,615 @@ +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/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/note/update_note.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/add-order/addNewOrder.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import '../../../../config/shared_pref_kay.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'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class ProgressNoteScreen extends StatefulWidget { + final int visitType; + + const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + List notesList; + var filteredNotesList; + final _controller = TextEditingController(); + var _isInit = true; + bool isDischargedPatient = false; + AuthViewModel authProvider; + + + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String token = await sharedPref.getString(TOKEN); + String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + + print(type); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: int.parse(patient.admissionNo), + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { + notesList = model.patientProgressNoteList; + }); + } + + @override + Widget build(BuildContext context) { + authProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + String arrivalType = routeArgs['arrivalType']; + if(routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => getProgressNoteList(context, model), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), + body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoProgressNote) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + if(!isDischargedPatient) + AddNewOrder( onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + )), + ); + },label: widget.visitType ==3?'Add a New Order Sheet':'Create a New Progress Note',), + Expanded( + child: Container( + + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authProvider.doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14):model + .patientProgressNoteList[ + index] + .status == + 4?Colors.red.shade700 + : model + .patientProgressNoteList[ + index] + .status == + 2?Colors.green[600]:Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authProvider + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + 'Pending', + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + 'Canceled', + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + 'Verified', + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authProvider + .doctorProfile.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Update', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: + false, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: true, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons + .check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Verify', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "cancel", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context, + ); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: true, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: false, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons + .trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + + SizedBox( + width: 10, + ) + ], + ), + 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( + 'Created By: ', + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils.getDayMonthYearDateFormatted( + DateUtils.getDateTimeFromServerFormat( + model + .patientProgressNoteList[ + index] + .createdOn)) + : DateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils.getHour(DateUtils + .getDateTimeFromServerFormat( + model + .patientProgressNoteList[ + index] + .createdOn)) + : DateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .notes, + fontSize: 10, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } + + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { + showDialog( + context: context, + child: Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.8, + height: 200, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // SizedBox(height: 20,), + SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,), + ], + ), + SizedBox(height: 10,), + DividerWithSpacesAround(), + SizedBox(height: 12,), + + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), + + SizedBox(height: 8,), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + "Cancel", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,),//Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16,), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) + + ], + ), + ) + ], + ), + ), + ), + ), + ), + )); + } + + + + +} diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart new file mode 100644 index 00000000..207e56a6 --- /dev/null +++ b/lib/screens/patients/profile/note/update_note.dart @@ -0,0 +1,284 @@ +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/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/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_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'; +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:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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:permission_handler/permission_handler.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class UpdateNoteOrder extends StatefulWidget { + final NoteModel note; + final PatientViewModel patientModel; + final PatiantInformtion patient; + final int visitType; + final bool isUpdate; + + const UpdateNoteOrder( + {Key key, + this.note, + this.patientModel, + this.patient, + this.visitType, + this.isUpdate}) + : super(key: key); + + @override + _UpdateNoteOrderState createState() => _UpdateNoteOrderState(); +} + +class _UpdateNoteOrderState extends State { + int selectedType; + bool isSubmitted = false; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + TextEditingController progressNoteController = TextEditingController(); + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + if (widget.note != null) { + progressNoteController.text = widget.note.notes; + } + + 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 ? 'Update' : 'Add') + ' Order Sheet' + : (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: widget.visitType == 3 + ? (widget.isUpdate ? 'Update' : 'Add') + + ' Order Sheet' + : (widget.isUpdate ? 'Update' : 'Add') + + ' Progress Note', + //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: 0, //MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + ), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' + : (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', + color: Color(0xff359846), + // 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); + + 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); + + await widget.patientModel + .createPatientProgressNote(reqModel); + } + + 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( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); + } + }), + ], + ), + ), + ); + } + + 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'}); + //SpeechToText.closeAlertDialog(context); + 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(); + progressNoteController.text = reconizedWord; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } +} diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart deleted file mode 100644 index a7182546..00000000 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ /dev/null @@ -1,219 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.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/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/shared_pref_kay.dart'; -import '../../../config/size_config.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'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: ibrahim albitar - *@Date:21/5/2020 - *@param: - *@return: - *@desc: - */ - -class PatientsOrdersScreen extends StatefulWidget { - @override - _PatientsOrdersState createState() => _PatientsOrdersState(); -} - -class _PatientsOrdersState extends State { - var notesList; - var filteredNotesList; - final _controller = TextEditingController(); - var _isInit = true; - - /* - *@author: ibrahim al bitar - *@Date:21/5/2020 - *@param: - *@return: - *@desc: - */ - getProgressNoteList(BuildContext context, PatientViewModel model ) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - - print(type); - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: 3, // if equal 3 then this will return orders - admissionNo: int.parse(patient.admissionNo), - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2); - model.getPatientProgressNote(progressNoteRequest.toJson()).then((c){ - notesList = model.patientProgressNoteList; - }); - } - - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => getProgressNoteList(context, model), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).orders, - body: notesList == null || notesList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoOrders) - : Column( - children: [ - Container( - margin: EdgeInsets.all(10), - width: SizeConfig.screenWidth * 0.80, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str, model); - }, - textInputAction: TextInputAction.done, - decoration: buildInputDecoration(context, - TranslationBase.of(context).searchOrders), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: ListView.builder( - itemCount: notesList.length, - itemBuilder: (BuildContext ctxt, int index) { - return RoundedContainer( - backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - notesList[index] - ["DoctorName"], - marginTop: 10, - marginLeft: 10, - marginBottom: 5, - fontWeight: FontWeight.bold, - ), - AppText( - notesList[index] - ["AdmissionNo"], - marginLeft: 10, - color: Colors.grey[600], - ), - AppText( - convertDateFormat( - notesList[index] - ["AssessmentDate"]), - marginLeft: 10, - color: Colors.grey[600], - ), - ], - ), - ), - children: [ - Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - notesList[index]["Notes"], - margin: 5, - ), - ], - ) - ], - ), - ], - )); - }), - ), - ), - ], - ), - ),); - } - - InputDecoration buildInputDecoration(BuildContext context, hint) { - return InputDecoration( - prefixIcon: Icon(Icons.search, color: Colors.black), - filled: true, - fillColor: Colors.white, - hintText: hint, - hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(50.0)), - borderSide: BorderSide(color: Colors.grey), //), - )); - } - - searchData(String str, PatientViewModel model) { - var strExist = str.length > 0 ? true : false; - - if (strExist) { - filteredNotesList = null; - filteredNotesList = notesList - .where((note) => - note["DoctorName"].toString().contains(str.toUpperCase())) - .toList(); - setState(() { - notesList = filteredNotesList; - }); - } else { - setState(() { - notesList = model.patientProgressNoteList; - }); - } - } - - convertDateFormat(String str) { - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } -} diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 63a1247b..bae49ef9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,177 +1,1127 @@ -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +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/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/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/borderedButton.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/loader/gif_loader_dialog_utils.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 '../../../routes.dart'; -// ignore: must_be_immutable -class PatientProfileScreen extends StatelessWidget { +class PatientProfileScreen extends StatefulWidget { + @override + _PatientProfileScreenState createState() => _PatientProfileScreenState(); +} + +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { PatiantInformtion patient; + bool isFromSearch = false; + bool isInpatient = false; + + bool isDischargedPatient = false; + bool isSearchAndOut = false; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; + int index = 0; + int _activeTab = 0; @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - ProjectViewModel projectViewModel = Provider.of(context); + void initState() { + _tabController = TabController(length: 2, vsync: this); + super.initState(); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - String from = routeArgs['from']; - String to = routeArgs['to']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + }if (routeArgs.containsKey("isSearchAndOut")) { + isSearchAndOut = routeArgs['isSearchAndOut']; + } + if (isInpatient) + _activeTab = 0; + else + _activeTab = 1; + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase + .of(context) + .patientProfile, + isShowAppBar: false, + //TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + + Container( + height: !isSearchAndOut ? MediaQuery + .of(context) + .size + .height * 0.70 : MediaQuery + .of(context) + .size + .height * 0.69, + child: ListView( + children: [ + Container( + child: isSearchAndOut + ? Column( + children: [ - return BaseView( - onModelReady: (model) async { - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN ?? patient.patientId, - doctorID: '', - editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP); - if (model.allergiesList.length == 0) { - await model.getMasterLookup(MasterKeysService.Allergies); - } - if (model.allergySeverityList.length == 0) { - await model.getMasterLookup(MasterKeysService.AllergySeverity); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false, - body: Container( - color: Color(0XFFF2F2F2), - child: Stack( - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), - Expanded( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: SingleChildScrollView( - child: Column( + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: LAB_RESULT, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: "ECG", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ORDER_PROCEDURE, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), + ], + ), + ), + ], + ) + : isInpatient + ? Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, children: [ - isFromSearch - ? ProfileMedicalInfoWidgetSearch( + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", + nameLine2: + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: + "Medical", + //Health + isInPatient: isInpatient, + nameLine2: + "Report", + //Report + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + ], + ), + ) + : Column( + children: [ + Padding( + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - ) - : ProfileMedicalInfoWidget( + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - ), - ], - ), + patientType: + patientType, + arrivalType: + arrivalType, + route: LAB_RESULT, + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: "ECG", + icon: + 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ORDER_PROCEDURE, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: ADD_SICKLEAVE, + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), + ], + ), + ), + ], ), ), - ) - ], + ], + ), ), - ), - if (int.parse(patientType) == 7 || - int.parse(patientType) == 6) - Positioned( - top: 175, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - BorderedButton( - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - backgroundColor: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - textColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - handler: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: patient.patientMRN); - GifLoaderDialogUtils.showMyDialog(context); - await model - .postEpisode(postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog(context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: {'patient': patient}); - } - }, - ), - if (patient.episodeNo != 0) - BorderedButton( - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - backgroundColor: - patient.patientStatusType == 43 + ], + ), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => + Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase + .of(context) + .createNew}\n${TranslationBase + .of(context) + .episode}", + color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, - textColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - handler: () { - if (patient.patientStatusType == 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); - } - } + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase + .of(context) + .update}\n${TranslationBase + .of(context) + .episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], ), - ], - ), - ), - ], + )), + ], + ), + ], + ), + )); + } + + Widget tabsBar(BuildContext context, Size screenSize) { + List _tabs = [ + "Inpatient Info".toUpperCase(), + "Outpatient Info".toUpperCase(), + ]; + + return Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), ), ), - )); + ), + ); + }).toList(), + ), + ); } } @@ -197,500 +1147,3 @@ class AvatarWidget extends StatelessWidget { ); } } - -/* Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration(boxShadow: [ - BoxShadow( - color: Colors.grey.shade300, - blurRadius: 10.0, - spreadRadius: 0, - offset: Offset(0, 10)), - ], color: Colors.white), - child: Column(children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + - ' ' + - patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .fileNo, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 4, - ), - AppText( - patient.patientId.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - model.patientAllergiesList - .isNotEmpty && - model.getAllergicNames( - projectViewModel - .isArabic) != - '' - ? Container( - width: MediaQuery.of(context) - .size - .width * - 0.65, - child: Padding( - padding: const EdgeInsets - .symmetric(vertical: 8), - child: AppText( - TranslationBase.of( - context) - .allergicTO + - " : " + - model.getAllergicNames( - projectViewModel - .isArabic), - color: Color(0xFFB9382C), - fontWeight: - FontWeight.bold, - ), - ), - ) - : AppText(''), - ], - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - Container( - height: 11 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - fontWeight: FontWeight.bold, - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", - fontWeight: FontWeight.normal, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .nationality, - fontWeight: FontWeight.bold, - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.nationalityName ?? - patient.nationality, - fontWeight: FontWeight.normal, - fontSize: 1.7 * - SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .gender, - fontWeight: FontWeight.bold, - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.gender.toString() == '1' - ? 'Male' - : 'Female', - fontWeight: FontWeight.normal, - fontSize: 1.8 * - SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ]), - ), - if (patient.admissionNo != null) - Container( - margin: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .admissionDetail, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.8 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - Container( - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(16), - child: Column( - children: [ - Row( - children: [ - Container( - width: 14 * - SizeConfig - .textMultiplier, - child: AppText( - TranslationBase.of( - context) - .dateTime, - color: Colors.black, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - Expanded( - child: AppText( - patient.createdOn != - null - ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" - : "", - color: Colors.black, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: 14 * - SizeConfig - .textMultiplier, - child: AppText( - TranslationBase.of( - context) - .admissionNo, - color: Colors.black, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - AppText( - patient.admissionNo != - null - ? patient.admissionNo - : '', - color: Colors.black, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: 14 * - SizeConfig - .textMultiplier, - child: AppText( - TranslationBase.of( - context) - .losNo, - color: Colors.black, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - AppText( - patient.createdOn != null - ? DateUtils - .differenceBetweenServerDateAndCurrent( - patient - .createdOn, - context) - : "", - color: Colors.black, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), - ], - ), - ), - const Divider( - color: Color(0xffCCCCCC), - height: 5, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - height: - 10 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets - .fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .area, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient - .clinicDescription, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets - .fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - children: [ - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .room, - fontWeight: - FontWeight - .bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - Expanded( - child: AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: - FontWeight - .normal, - fontSize: 1.4 * - SizeConfig - .textMultiplier, - ), - ), - ], - ), - ), - SizedBox( - height: 4, - ), - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .bed, - fontWeight: - FontWeight - .bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - AppText( - "${patient.bedId}", - fontWeight: - FontWeight - .normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ) - ], - ), - ) - ], - ), - ), - ], - ),*/ 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 5ca818bf..a7aab586 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,13 +1,12 @@ 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/util/helpers.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'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class InpatientPrescriptionDetailsScreen extends StatefulWidget { @override @@ -97,11 +96,11 @@ class _InpatientPrescriptionDetailsScreenState key: 'UOM'), buildTableRow( des: - '${Helpers.getDate(prescription.startDatetime)}', + '${DateUtils.getDate(prescription.startDatetime)}', key: 'Start Date'), buildTableRow( des: - '${Helpers.getDate(prescription.stopDatetime)}', + '${DateUtils.getDate(prescription.stopDatetime)}', key: 'Stop Date'), buildTableRow( des: '${prescription.noOfDoses}', @@ -116,7 +115,7 @@ class _InpatientPrescriptionDetailsScreenState key: 'Pharmacy Remarks'), buildTableRow( des: - '${Helpers.getDate(prescription.prescriptionDatetime)}', + '${DateUtils.getDate(prescription.prescriptionDatetime)}', key: 'Prescription Date'), buildTableRow( des: '${prescription.refillID}', diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart deleted file mode 100644 index 496e5478..00000000 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ /dev/null @@ -1,88 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/reauest_prescription_report_for_in_patient.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/prescription_in_patinets_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/prescription_out_patinets_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import '../../../../config/shared_pref_kay.dart'; -import '../../../../models/patient/patiant_info_model.dart'; -import '../../../../models/patient/prescription/prescription_req_model.dart'; -import '../../../../util/dr_app_shared_pref.dart'; -import '../../../../widgets/shared/app_scaffold_widget.dart'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: Elham Rababah - *@Date:26/4/2020 - *@param: - *@return:PrescriptionScreen - *@desc: PrescriptionScreen class - */ - -class PrescriptionScreen extends StatefulWidget { - @override - _PrescriptionScreenState createState() => _PrescriptionScreenState(); -} - -class _PrescriptionScreenState extends State { - String type = '2'; - - /* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: context - *@return: - *@desc: getPrescriptionsList Function - */ - getPrescriptionsList(BuildContext context, PatientViewModel model) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - - if (type == '1') { - RequestPrescriptionReportForInPatient prescriptionReqModel = - RequestPrescriptionReportForInPatient( - patientID: patient.patientId, - patientTypeID: patient.patientType, - admissionNo: int.parse(patient.admissionNo)); - model.getInPatientPrescriptions(prescriptionReqModel.toJson()); - } else { - PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel( - patientID: patient.patientId, - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2, - setupID: 0); - model.getOutPatientPrescriptions(prescriptionReqModel.toJson()); - } - } - - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => getPrescriptionsList(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .prescription, - body: type == '1' - ? PrescriptionInPatientWidget( - prescriptionReportForInPatientList: - model.prescriptionReportForInPatientList, - ) - : PrescriptionOutPatientWidget( - patientPrescriptionsList: - model.patientPrescriptionsList, - ), - ),); - } -} diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart deleted file mode 100644 index 56a5cd5e..00000000 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ /dev/null @@ -1,217 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/progress_note_request.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/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/shared_pref_kay.dart'; -import '../../../config/size_config.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'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: ibrahim albitar - *@Date:15/5/2020 - *@param: ' - *@return: - *@desc: - */ - -class ProgressNoteScreen extends StatefulWidget { - @override - _ProgressNoteState createState() => _ProgressNoteState(); -} - -class _ProgressNoteState extends State { - var notesList; - var filteredNotesList; - final _controller = TextEditingController(); - var _isInit = true; - - /* - *@author: ibrahim al bitar - *@Date:16/5/2020 - *@param: - *@return: - *@desc: - */ - getProgressNoteList(BuildContext context, PatientViewModel model) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - - print(type); - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: 5, - // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2); - model.getPatientProgressNote(progressNoteRequest.toJson()).then((c) { - notesList = model.patientProgressNoteList; - }); - } - - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => getProgressNoteList(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .progressNote, - body: notesList == null || notesList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .errorNoProgressNote) - : Column( - children: [ - Container( - margin: EdgeInsets.all(10), - width: SizeConfig.screenWidth * 0.80, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str, model); - }, - textInputAction: TextInputAction.done, - decoration: buildInputDecoration(context, - TranslationBase.of(context).searchNote), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: ListView.builder( - itemCount: notesList.length, - itemBuilder: (BuildContext ctxt, int index) { - return RoundedContainer( - backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - notesList[index] - ["DoctorName"], - marginTop: 10, - marginLeft: 10, - marginBottom: 5, - fontWeight: FontWeight.bold, - ), - AppText( - convertDateFormat( - notesList[index] - ["AssessmentDate"]), - marginLeft: 10, - color: Colors.grey[600], - ), - ], - ), - ), - children: [ - Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row(mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - notesList[index]["Notes"], - margin: 5, - ), - ], - ) - ], - ), - ], - )); - }), - ), - ), - ], - ), - ),); - } - - InputDecoration buildInputDecoration(BuildContext context, hint) { - return InputDecoration( - prefixIcon: Icon(Icons.search, color: Colors.black), - filled: true, - fillColor: Colors.white, - hintText: hint, - hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey), //), - )); - } - - searchData(String str, PatientViewModel model) { - var strExist = str.length > 0 ? true : false; - - if (strExist) { - filteredNotesList = null; - filteredNotesList = model.patientProgressNoteList - .where((note) => - note["DoctorName"].toString().contains(str.toUpperCase())) - .toList(); - setState(() { - notesList = filteredNotesList; - }); - } else { - setState(() { - notesList = model.patientProgressNoteList; - }); - } - } - - convertDateFormat(String str) { - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } -} diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index fc98fefb..acc79d19 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,17 +1,12 @@ -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/viewModel/project_view_model.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/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_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -69,17 +64,18 @@ class RadiologyDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(TranslationBase.of(context).generalResult), - SizedBox( - height: 5, + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), ), + Padding( padding: const EdgeInsets.all(8.0), - child: Texts( + child: AppText( '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, fontSize: 17, - color: Colors.grey, + color: Color(0xff575757), ), ), SizedBox( @@ -93,14 +89,15 @@ class RadiologyDetailsPage extends StatelessWidget { ), bottomSheet: model.radImageURL.isNotEmpty ? Container( - height: 80, + height: 80, width: double.maxFinite, child: Container( margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( - color: Colors.red[600], + color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", + textColor: Color(0xffFFFFFF), onTap: () { launch(model.radImageURL); }, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index dfbbdff3..81e0e6cf 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,41 +1,53 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; 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/core/viewModel/radiology_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/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.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/add-order/addNewOrder.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.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'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class RadiologyHomePage extends StatelessWidget { +class RadiologyHomePage extends StatefulWidget { @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + _RadiologyHomePageState createState() => _RadiologyHomePageState(); +} + +class _RadiologyHomePageState extends State { + String patientType; + PatiantInformtion patient; + String arrivalType; + bool isInpatient; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + isInpatient = routeArgs['isInpatient']; + print(arrivalType); + } + @override + Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient,patientType: patientType), + onModelReady: (model) => model.getPatientRadOrders(patient, + patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -45,39 +57,41 @@ class RadiologyHomePage extends StatelessWidget { SizedBox( height: 12, ), - if(model.radiologyList.isNotEmpty && patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && + patient.patientStatusType != 43) Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - 'Radiology', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - Texts( - 'Result', - bold: true, - fontSize: 22, - ), - ], + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Radiology', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), ), - ), - if(patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( 'Radiology', style: "caption2", color: Colors.black, fontSize: 13, ), - Texts( + AppText( 'Result', bold: true, fontSize: 22, @@ -85,10 +99,9 @@ class RadiologyHomePage extends StatelessWidget { ], ), ), - if (patientType != null && - patientType == '7' && + if (patient.patientStatusType != null && patient.patientStatusType == 43) - InkWell( + AddNewOrder( onTap: () { Navigator.push( context, @@ -99,83 +112,98 @@ class RadiologyHomePage extends StatelessWidget { )), ); }, - // () { - // addSelectedRadiologyOrder(context, model, patient); - // }, - child: Container( - width: double.maxFinite, - height: 140, - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Container( - height: 90, - child: Column( + label: 'Apply for Radiology Order', + ), + ...List.generate( + model.radiologyList.length, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( children: [ Container( - height: 40, - width: 40, + width: 20, + height: 160, decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, + //Colors.red[900] Color(0xff404545) + color: model.radiologyList[index].isLiveCareAppodynamicment + ? Colors.red[900] + : !model.radiologyList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + ), ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), ), - SizedBox( - height: 10, + Expanded( + child: DoctorCard( + isNoMargin: true, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, + appointmentDate: model.radiologyList[index].orderDate?? + model.radiologyList[index].reportDate, + onTap: () { + Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: model.radiologyList[index], + patient: patient, + ), + ), + ); + }, + ), ), - Texts( - 'Apply for Radiology Order', - color: Colors.grey[600], - fontWeight: FontWeight.w600, - ) ], ), - ), - ), - ), - ), - ...List.generate( - model.radiologyList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], - patient: patient, - ), - ), - ), - child: DoctorCard( - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, - appointmentDate: model.radiologyList[index].orderDate, - ), - )), - if(model.radiologyList.isEmpty && patient.patientStatusType != 43) + )), + if (model.radiologyList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('No Radiology Found'), + child: AppText('No Radiology Found'), ) - ], ), ) diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 75be23e8..e7714074 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart deleted file mode 100644 index 0bce886a..00000000 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ /dev/null @@ -1,192 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/radiology/radiology_req_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_report_screen.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:flutter/material.dart'; - -import '../../../../config/shared_pref_kay.dart'; -import '../../../../config/size_config.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'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: Elham Rababah - *@Date:26/4/2020 - *@param: - *@return:RadiologyScreen - *@desc: RadiologyScreen class - */ - -class RadiologyScreen extends StatefulWidget { - @override - _RadiologyScreenState createState() => _RadiologyScreenState(); -} - -class _RadiologyScreenState extends State { - - /* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: context - *@return: - *@desc: getRadiologyList Function - */ - getRadiologyList(context, PatientViewModel model) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - int inOutpatientType = 1; - if (type == '0') { - inOutpatientType = 2; - } - print(type); - RadiologyReqModel radiologyReqModel = RadiologyReqModel( - patientID: patient.patientId, - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2, - ); - model.getPatientRadiology(radiologyReqModel.toJson()); - } - - - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => getRadiologyList(context, model), - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .radiology, - body: - model.patientRadiologyList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .youDoNotHaveAnyItem) - : Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: Container( - margin: EdgeInsets.symmetric(vertical: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: ListView.builder( - itemCount: model.patientRadiologyList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - RadiologyReportScreen( - reportData: model - .patientRadiologyList[index] - .reportData, - url: model - .patientRadiologyList[index].imageURL, - )), - ); - }, - child: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10)), - border: Border( - bottom: BorderSide( - color: Colors.grey, width: 0.5), - top: BorderSide( - color: Colors.grey, width: 0.5), - left: BorderSide( - color: Colors.grey, width: 0.5), - right: BorderSide( - color: Colors.grey, width: 0.5), - ), - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - LargeAvatar( - url: model - .patientRadiologyList[index] - .doctorImageURL, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.fromLTRB( - 8, 0, 0, 0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - '${model.patientRadiologyList[index].doctorName}', - fontSize: 2.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold), - SizedBox( - height: 8, - ), - AppText( - 'Invoice No:${model.patientRadiologyList[index].invoiceNo}', - fontSize: 2 * - SizeConfig - .textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText( - ' ${model.patientRadiologyList[index].clinicName}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Theme.of(context) - .primaryColor, - ), - SizedBox( - height: 8, - ), - ], - ), - ), - ) - ], - ), - ], - ), - ), - ); - }), - ), - ), - ),); - } -} diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart deleted file mode 100644 index ffa1608a..00000000 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ /dev/null @@ -1,407 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_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/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; - -import '../../../config/size_config.dart'; -import '../../../util/dr_app_shared_pref.dart'; -import '../../../util/extenstions.dart'; -import '../../../widgets/shared/app_scaffold_widget.dart'; -import '../../../widgets/shared/app_texts_widget.dart'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: ibrahim albitar - *@Date:4/6/2020 - *@param: - *@return: - *@desc: - */ - -class ReferPatientScreen extends StatefulWidget { - @override - _ReferPatientState createState() => _ReferPatientState(); -} - -class _ReferPatientState extends State { - dynamic _selectedClinic; - dynamic _selectedDoctor; - final _extController = TextEditingController(); - int _activePriority = 1; - dynamic _selectedFrequency; - final _remarksController = TextEditingController(); - bool isValid; - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - - return BaseView( - onModelReady: (model) => model.getClinicsList(), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).referralPatient, - body: model.clinicsList == null - ? DrAppEmbeddedError(error: 'Something Wrong!') - : SingleChildScrollView( - child: Container( - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.clinicsList != null && - model.clinicsList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.clinicsList, - attributeName: 'ClinicDescription', - attributeValueId: 'ClinicID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = null; - _selectedClinic = selectedValue; - model.getDoctorsList( - _selectedClinic['ClinicID']); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).clinicSelect, - _selectedClinic != null - ? _selectedClinic['ClinicDescription'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doctorSelect, - _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).ext, null, false), - enabled: true, - controller: _extController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - keyboardType: TextInputType.number, - )), - SizedBox( - height: 10, - ), - priorityBar(context, screenSize), - SizedBox( - height: 20, - ), - AppText( - "${TranslationBase.of(context).referralFrequency} ${getPriority()}", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 20, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.referralFrequencyList != null && - model.referralFrequencyList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.referralFrequencyList, - attributeName: 'Description', - attributeValueId: 'ParameterCode', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedFrequency = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .selectReferralFrequency, - _selectedFrequency != null - ? _selectedFrequency['Description'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).clinicDetailsandRemarks, - null, - false), - enabled: true, - controller: _remarksController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_LETTERS)) - ], - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 10, - ), - Container( - child: Column( - children: [ - AppText( - TranslationBase.of(context).pleaseFill, - color: HexColor("#B8382B"), - fontWeight: FontWeight.bold, - margin: 10, - visibility: isValid == null ? false : !isValid, - ), - // TODO replace AppButton with secondary button and add loading - AppButton( - title: TranslationBase.of(context).send, - color: HexColor("#B8382B"), - onPressed: () => {referToDoctor(context, model)}, - ) - ], - ), - ), - ], - ), - ), - ), - ), - ); - } - - Widget priorityBar(BuildContext _context, Size screenSize) { - List _priorities = [ - TranslationBase.of(context).veryUrgent.toUpperCase(), - TranslationBase.of(context).urgent.toUpperCase(), - TranslationBase.of(context).routine.toUpperCase(), - ]; - return Container( - height: screenSize.height * 0.070, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - return Expanded( - child: InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, - _isActive ? HexColor("#B8382B") : Colors.white), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - fontWeight: FontWeight.bold, - ), - ), - )), - ), - onTap: () { - print(_priorities.indexOf(item)); - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }, - ), - ); - }).toList(), - ), - ); - } - - String getPriority() { - DateTime date = DateTime.now(); - switch (_activePriority) { - case 0: - date = date.add(new Duration(hours: 3)); - break; - case 1: - date = date.add(new Duration(hours: 6)); - break; - case 2: - date = date.add(new Duration(days: 1)); - break; - } - var format = DateFormat('yyyy/mm/dd HH:mm a'); - var time = format.format(date); - print(time); - return time; - } - - referToDoctor(BuildContext context, PatientViewModel model) async { - if (!validation()) { - return; - } - - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - - try { - await model.referToDoctor( - extension: _extController.value.text, - admissionNo: int.parse(patient.admissionNo), - referringDoctorRemarks: _remarksController.value.text, - frequency: _selectedFrequency['ParameterCode'].toString(), - patientID: patient.patientId, - patientTypeID: patient.patientType, - priority: (_activePriority + 1).toString(), - roomID: patient.roomId, - selectedClinicID: _selectedClinic['ClinicID'].toString(), - selectedDoctorID: _selectedDoctor['DoctorID'].toString(), - projectID: patient.projectId); - // TODO: Add Translation - DrAppToastMsg.showSuccesToast('Reply Successfully'); - Navigator.pop(context); - } catch (e) { - DrAppToastMsg.showErrorToast(e); - } - } - - bool validation() { - setState(() { - isValid = !_extController.value.text.isNullOrEmpty() && - !_remarksController.value.text.isNullOrEmpty() && - _selectedClinic != null && - _selectedDoctor != null && - _selectedFrequency != null; - }); - return isValid; - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown) { - 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(Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 2.0, - )), - ); - } -} diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart new file mode 100644 index 00000000..fd5ec6bb --- /dev/null +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -0,0 +1,186 @@ +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/MyReferralPatientModel.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/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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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:permission_handler/permission_handler.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + + +class AddReplayOnReferralPatient extends StatefulWidget { + final PatientReferralViewModel patientReferralViewModel; + final MyReferralPatientModel myReferralInPatientModel; + //TODO Jammal + const AddReplayOnReferralPatient( + {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) + : super(key: key); + + @override + _AddReplayOnReferralPatientState createState() => + _AddReplayOnReferralPatientState(); +} + +class _AddReplayOnReferralPatientState extends State { + + bool isSubmitted = false; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + TextEditingController progressNoteController = TextEditingController(); + @override + void initState() { + requestPermissions(); + super.initState(); + } + + + @override + Widget build(BuildContext context) { + 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: 'Replay'), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: 'Replay your responses here', + controller: progressNoteController, + maxLines: 35, + minLines: 25, + hasBorder: true, + validationError: + progressNoteController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + Positioned( + top: 0,//MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + ), + onPressed: () { + onVoiceText(); + }, + ), + ) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'Submit Replay', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientReferralViewModel.replay(progressNoteController.text.trim(), widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientReferralViewModel.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }else { + Helpers.showErrorToast("You can't add empty replay"); + setState(() { + isSubmitted = false; + }); + } + }), + ], + ), + ), + ); + } + + 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: ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError 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); + progressNoteController.text = reconizedWord; + }); + } + } +} 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 dcba8fba..71edabb6 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -9,11 +9,10 @@ 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/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -73,7 +72,6 @@ class MyReferralDetailScreen extends StatelessWidget { .fullName)), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', ), ), @@ -113,107 +111,148 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "", + pendingReferral.referralStatus != null + ? pendingReferral.referralStatus + : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: + 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: pendingReferral.referralStatus != null - ? pendingReferral.referralStatus == 'Pending' - ? Color(0xffc4aa54) - : pendingReferral.referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] + color: pendingReferral + .referralStatus != + null + ? pendingReferral + .referralStatus == + 'Pending' + ? Color(0xffc4aa54) + : pendingReferral + .referralStatus == + 'Accepted' + ? Colors.green[700] + : Colors.red[700] : Colors.grey[500], ), AppText( - pendingReferral.referredOn.split(" ")[0], + pendingReferral.referredOn + .split(" ")[0], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: + 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context) + .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${pendingReferral.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( - pendingReferral.referredOn.split(" ")[1], + pendingReferral.referredOn + .split(" ")[1], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).referredFrom, + TranslationBase.of(context) + .referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig + .textMultiplier, color: Color(0XFF575757), ), AppText( - pendingReferral.isReferralDoctorSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context) - .otherBranch, + pendingReferral + .isReferralDoctorSameBranch + ? TranslationBase.of( + context) + .sameBranch + : TranslationBase.of( + context) + .otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context) + .remarks + + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig + .textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - pendingReferral.remarksFromSource, + pendingReferral + .remarksFromSource, fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: + FontWeight.w700, + fontSize: 1.8 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ), @@ -225,52 +264,74 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - pendingReferral - .patientDetails.nationalityName != null ? pendingReferral - .patientDetails.nationalityName : "", + pendingReferral.patientDetails + .nationalityName != + null + ? pendingReferral + .patientDetails + .nationalityName + : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * + SizeConfig.textMultiplier, ), - pendingReferral.nationalityFlagUrl != null + pendingReferral + .nationalityFlagUrl != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - pendingReferral.nationalityFlagUrl, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) + borderRadius: + BorderRadius.circular( + 20.0), + child: Image.network( + pendingReferral + .nationalityFlagUrl, + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace + stackTrace) { + return Text('No Image'); + }, + )) : SizedBox() ], ) ], ), Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), - child: Image.asset('assets/images/patient/ic_ref_arrow_up.png', + margin: EdgeInsets.only( + left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_up.png', height: 50, width: 30, ), ), Container( margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: CircleAvatar( radius: 25.0, - backgroundImage: NetworkImage(pendingReferral.doctorImageUrl), - backgroundColor: Colors.transparent, + backgroundImage: NetworkImage( + pendingReferral + .doctorImageUrl), + backgroundColor: + Colors.transparent, ), ), ), @@ -278,14 +339,19 @@ class MyReferralDetailScreen extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + left: 10, + top: 25, + right: 10, + bottom: 0), child: Column( children: [ AppText( - pendingReferral.referredByDoctorInfo, + pendingReferral + .referredByDoctorInfo, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -312,39 +378,6 @@ class MyReferralDetailScreen extends StatelessWidget { SizedBox( height: 16, ), - /*Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), - child: AppText( - TranslationBase.of(context).myReferralPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ),*/ - /*PatientReferralItemWidget( - referralStatus: pendingReferral.referralStatus, - patientName: pendingReferral.patientName, - patientGender: - pendingReferral.patientDetails.gender, - referredDate: - pendingReferral.referredOn.split(" ")[0], - referredTime: - pendingReferral.referredOn.split(" ")[1], - patientID: "${pendingReferral.patientID}", - isSameBranch: - pendingReferral.isReferralDoctorSameBranch, - isReferral: true, - remark: pendingReferral.remarksFromSource, - nationality: pendingReferral - .patientDetails.nationalityName, - nationalityFlag: - pendingReferral.nationalityFlagUrl, - doctorAvatar: pendingReferral.doctorImageUrl, - referralDoctorName: - pendingReferral.referredByDoctorInfo, - clinicDescription: null, - ),*/ Padding( padding: const EdgeInsets.symmetric(horizontal: 16), @@ -367,14 +400,14 @@ class MyReferralDetailScreen extends StatelessWidget { child: Row( children: [ Expanded( - child: BorderedButton( - TranslationBase.of(context).accept, - backgroundColor: Color(0xFF4BA821), - textColor: Colors.white, - fontSize: 16, + child: AppButton( + title: TranslationBase.of(context).accept, + color: Color(0xFF4BA821), + fontColor: Colors.white, + fontSize: 1.6, hPadding: 8, vPadding: 12, - handler: () async { + onPressed: () async { await model.responseReferral( pendingReferral, true); if (model.state == ViewState.ErrorLocal) { @@ -390,17 +423,17 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), SizedBox( - height: 8, + width: 8, ), Expanded( - child: BorderedButton( - TranslationBase.of(context).reject, - backgroundColor: Color(0xFFB9382C), - textColor: Colors.white, - fontSize: 16, + child: AppButton( + title: TranslationBase.of(context).reject, + color: Color(0xFFB9382C), + fontColor: Colors.white, + fontSize: 1.6, hPadding: 8, vPadding: 12, - handler: () async { + onPressed: () async { await model.responseReferral( pendingReferral, true); if (model.state == ViewState.ErrorLocal) { @@ -435,7 +468,7 @@ class MyReferralDetailScreen extends StatelessWidget { "", fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, + fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart new file mode 100644 index 00000000..f3bbf698 --- /dev/null +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -0,0 +1,92 @@ +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/referral_patient_detail_in-paint.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-referral-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/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class MyReferralInPatientScreen extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getMyReferralPatientService(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).referPatient, + body: model.myReferralPatients.isEmpty + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).referralEmptyMsg, + color: Theme.of(context).errorColor, + ), + ) + ], + ), + ) + : SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70), + // color: Colors.white, + // height: MediaQuery.of(context).size.height, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 50), + ...List.generate( + model.myReferralPatients.length, + (index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferralPatientDetailScreen(model.myReferralPatients[index],model), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context), + referralStatusCode: model.myReferralPatients[index].referralStatus, + patientName: model.myReferralPatients[index].patientName, + patientGender: model.myReferralPatients[index].gender, + referredDate: DateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate), + referredTime: DateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), + patientID: "${model.myReferralPatients[index].patientID}", + isSameBranch: false, + isReferral: true, + isReferralClinic: true, + referralClinic:"${model.myReferralPatients[index].referringClinicDescription}", + remark: model.myReferralPatients[index].referringDoctorRemarks, + nationality: model.myReferralPatients[index].nationalityName, + nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, + doctorAvatar: model.myReferralPatients[index].doctorImageURL, + referralDoctorName: model.myReferralPatients[index].referringDoctorName, + clinicDescription: model.myReferralPatients[index].referringClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 1d9bbbfd..b2953cca 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -1,10 +1,8 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.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/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/profile-welcome-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:flutter/material.dart'; diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index ef18866c..1206c9c3 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -1,5 +1,5 @@ import 'dart:ui'; -import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; + import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -7,6 +7,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'my-referral-inpatient-screen.dart'; + class PatientReferralScreen extends StatefulWidget { @override _PatientReferralScreen createState() => _PatientReferralScreen(); @@ -89,7 +91,7 @@ class _PatientReferralScreen extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - MyReferralPatientScreen(), + MyReferralInPatientScreen(), ReferredPatientScreen(), // MyReferredPatient(), ], 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 new file mode 100644 index 00000000..38182570 --- /dev/null +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -0,0 +1,654 @@ +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/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/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-header-new-design-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/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:intl/intl.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; +class PatientMakeInPatientReferralScreen extends StatefulWidget { + @override + _PatientMakeInPatientReferralScreenState createState() => + _PatientMakeInPatientReferralScreenState(); +} + +class _PatientMakeInPatientReferralScreenState + extends State { + PatiantInformtion patient; + List referToList; + dynamic _referTo; + dynamic _selectedBranch; + dynamic _selectedClinic; + dynamic _selectedDoctor; + dynamic _selectedFrequency; + final _remarksController = TextEditingController(); + final _extController = TextEditingController(); + int _activePriority = 1; + String appointmentDate; + + String branchError; + String hospitalError; + String clinicError; + String doctorError; + String frequencyError; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + + @override + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + 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'}); + //SpeechToText.closeAlertDialog(context); + 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(); + _remarksController.text = reconizedWord; + }); + } 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 routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; + referToList = List(); + dynamic sameBranch = { + "id": 1, + "name": TranslationBase.of(context).sameBranch + }; + dynamic otherBranch = { + "id": 2, + "name": TranslationBase.of(context).otherBranch + }; + referToList.add(sameBranch); + referToList.add(otherBranch); + + final screenSize = MediaQuery.of(context).size; + + return BaseView( + onModelReady: (model) => model.getReferralFrequencyList(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).referPatient, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType,isInpatient: isInpatient,), + body: SingleChildScrollView( + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).refer}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + "${TranslationBase.of(context).patient}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).branch, + dropDownText: + _referTo != null ? _referTo['name'] : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: branchError, + onClick: referToList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: referToList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _referTo = selectedValue; + _selectedBranch = null; + _selectedClinic = null; + _selectedDoctor = null; + model + .getDoctorBranch() + .then((value) async { + _selectedBranch = value; + if (_referTo['id'] == 1) { + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getClinics(_selectedBranch[ + 'facilityId']) + .then((_) => + GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } + } else { + _selectedBranch = null; + } + }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).hospital, + dropDownText: _selectedBranch != null + ? _selectedBranch['facilityName'] + : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: hospitalError, + onClick: model.branchesList != null && + model.branchesList.length > 0 && + _referTo != null && + _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.branchesList, + attributeName: 'facilityName', + attributeValueId: 'facilityId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getClinics( + _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).clinic, + dropDownText: _selectedClinic != null + ? _selectedClinic['ClinicDescription'] + : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: clinicError, + onClick: _selectedBranch != null && + model.clinicsList != null && + model.clinicsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.clinicsList, + attributeName: 'ClinicDescription', + attributeValueId: 'ClinicID', + usingSearch: true, + hintSearchText: + TranslationBase.of(context) + .clinicSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() async { + _selectedDoctor = null; + _selectedClinic = selectedValue; + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getClinicDoctors( + patient, + _selectedClinic['ClinicID'], + _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: TranslationBase.of(context).doctor, + dropDownText: _selectedDoctor != null + ? _selectedDoctor['Name'] + : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: doctorError, + onClick: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'Name', + attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: + TranslationBase.of(context) + .doctorSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : () { + if (_selectedClinic == null) { + DrAppToastMsg.showErrorToast( + "You need to select a clinic first"); + } else if (model.doctorsList == null || + model.doctorsList.length == 0) { + DrAppToastMsg.showErrorToast( + "There is no doctors for this clinic"); + } + }, + ), + SizedBox( + height: 10, + ), + AppText( + "${TranslationBase.of(context).priority}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 4, + ), + priorityBar(context, screenSize), + SizedBox( + height: 10, + ), + AppText( + "${TranslationBase.of(context).replayBefore}: ${getPriority()}", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 1.9, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.075, + hintText: + TranslationBase.of(context).referralFrequency, + dropDownText: _selectedFrequency != null + ? _selectedFrequency['Description'] + : null, + enabled: false, + isTextFieldHasSuffix: true, + validationError: frequencyError, + onClick: () { + ListSelectDialog dialog = ListSelectDialog( + list: model.referralFrequencyList, + attributeName: 'Description', + attributeValueId: 'ParameterCode', + usingSearch: true, + hintSearchText: TranslationBase.of(context) + .selectReferralFrequency, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedFrequency = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + }, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + hintText: TranslationBase.of(context).ext, + controller: _extController, + inputType: TextInputType.text, + ), + SizedBox( + height: 10, + ), + Stack( + children: [ + AppTextFieldCustom( + hintText:"Remarks", + controller: _remarksController, + inputType: TextInputType.multiline, + minLines: 4, + maxLines: 6, + ), + Positioned( + top: 0, //MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + ), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ), + ], + ), + ], + ), + ) + ], + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + fontWeight: FontWeight.w700, + color: Color(0XFF359846), + onPressed: () async{ + setState(() { + if (_referTo == null) { + branchError = + TranslationBase.of(context).fieldRequired; + } else { + branchError = null; + } + if (_selectedBranch == null) { + hospitalError = + TranslationBase.of(context).fieldRequired; + } else { + hospitalError = null; + } + if (_selectedClinic == null) { + clinicError = + TranslationBase.of(context).fieldRequired; + } else { + clinicError = null; + } + if (_selectedDoctor == null) { + doctorError = + TranslationBase.of(context).fieldRequired; + } else { + doctorError = null; + } + if (_selectedFrequency == null) { + frequencyError = + TranslationBase.of(context).fieldRequired; + } else { + frequencyError = null; + } + }); + if (_selectedFrequency == null || + _selectedBranch == null || + _selectedClinic == null || + _selectedDoctor == null || + _remarksController.text == null || + _extController.text == null) return;{ + + await model.makeInPatientReferral( + patient: patient, + projectID: _selectedBranch['facilityId'], + clinicID: _selectedClinic['ClinicID'], + doctorID: _selectedDoctor['DoctorID'], + frequencyCode: _selectedFrequency['ParameterCode'], + ext: _extController.text, + remarks: _remarksController.text, + priority: _activePriority, + referralDate: appointmentDate + ); + if(model.state == ViewState.ErrorLocal) + DrAppToastMsg.showErrorToast(model.error); + else{ + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); + Navigator.pop(context); + } + + } + }, + ), + ) + ], + ), + ), + ), + ), + ); + } + + Widget priorityBar(BuildContext _context, Size screenSize) { + List _priorities = [ + TranslationBase.of(context).veryUrgent.toUpperCase(), + TranslationBase.of(context).urgent.toUpperCase(), + TranslationBase.of(context).routine.toUpperCase(), + ]; + return Container( + height: screenSize.height * 0.070, + decoration: + containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map((item) { + bool _isActive = _priorities[_activePriority] == item ? true : false; + return Expanded( + child: InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + _isActive ? Color(0XFFB8382B) : Colors.white, + _isActive ? Color(0XFFB8382B) : Colors.white), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + )), + ), + onTap: () { + print(_priorities.indexOf(item)); + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }, + ), + ); + }).toList(), + ), + ); + } + + String getPriority() { + DateTime date = DateTime.now(); + switch (_activePriority) { + case 0: + date = date.add(new Duration(hours: 3)); + break; + case 1: + date = date.add(new Duration(hours: 6)); + break; + case 2: + date = date.add(new Duration(days: 1)); + break; + } + var format = DateFormat('yyyy/mm/dd HH:mm a'); + var time = format.format(date); + print(time); + + appointmentDate = time; + return time; + } + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 2.0, + )), + ); + } +} diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index c27a5c46..2d9ca8dc 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -1,4 +1,3 @@ -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/patient-referral-viewmodel.dart'; @@ -6,18 +5,15 @@ 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/patients/patient-referral-item-widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/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'; @@ -242,7 +238,7 @@ class _PatientMakeReferralScreenState extends State { hintText: TranslationBase.of(context).branch, dropDownText: _referTo != null ? _referTo['name'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: branchError, onClick: referToList != null ? () { @@ -295,7 +291,7 @@ class _PatientMakeReferralScreenState extends State { ? _selectedBranch['facilityName'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: hospitalError, onClick: model.branchesList != null && model.branchesList.length > 0 && @@ -343,7 +339,7 @@ class _PatientMakeReferralScreenState extends State { ? _selectedClinic['ClinicDescription'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: clinicError, onClick: _selectedBranch != null && model.clinicsList != null && @@ -393,7 +389,7 @@ class _PatientMakeReferralScreenState extends State { dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, enabled: false, - isDropDown: true, + isTextFieldHasSuffix: true, validationError: doctorError, onClick: _selectedClinic != null && model.doctorsList != null && @@ -441,11 +437,12 @@ class _PatientMakeReferralScreenState extends State { ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null, enabled: false, - isDropDown: true, - suffixIcon: Icon( + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( Icons.calendar_today, color: Colors.black, - ), + )), onClick: () { _selectDate(context, model); }, 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 new file mode 100644 index 00000000..cc2c7136 --- /dev/null +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -0,0 +1,502 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.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/screens/base/base_view.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/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; +import 'AddReplayOnReferralPatient.dart'; + +class ReferralPatientDetailScreen extends StatelessWidget { + final MyReferralPatientModel referredPatient; + final PatientReferralViewModel patientReferralViewModel; + ReferralPatientDetailScreen(this.referredPatient, this.patientReferralViewModel); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + referredPatient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromReferralO(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Icon( + Icons.account_circle, + size: 25, + ), + ) + ]), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromReferralO(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).viewProfile, + fontWeight: FontWeight.w700, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Colors.red[700], + ) + ], + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + fontFamily: 'Poppins', + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: referredPatient.referralStatus == 1 + ? Color(0xffc4aa54) + : referredPatient.referralStatus == 46 + ? Colors.green[700] + : Colors.red[700], + ), + AppText( + DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Color(0XFF28353E), + ) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .fileNumber, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + "${referredPatient.patientID}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + AppText( + DateUtils.getTimeHHMMA(referredPatient.referralDate,), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).refClinic}: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient + .referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + ], + ), + ), + Row( + children: [ + AppText( + referredPatient.nationalityName != + null + ? referredPatient.nationalityName + : "", + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + fontSize: + 1.4 * SizeConfig.textMultiplier, + ), + referredPatient.nationalityFlagURL != + null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + referredPatient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext + context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.priorityDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_up.png', + height: 50, + width: 30, + ), + ), + Container( + margin: EdgeInsets.only( + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != + null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + referredPatient.doctorImageURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : Container( + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 10, + top: 30, + right: 10, + bottom: 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "Dr ${referredPatient.referringDoctorName}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w800, + fontSize: 1.5 * + SizeConfig.textMultiplier, + color: Colors.black, + ), + AppText( + referredPatient + .referringClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.3 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + Expanded( + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient.referringDoctorRemarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + + ], + ), + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: AppButton( + title: TranslationBase.of(context).replay, + color: Colors.red[700], + fontColor: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 1.8, + hPadding: 8, + vPadding: 12, + onPressed: () async { + Navigator.push( + context, + SlideUpPageRoute( + widget: AddReplayOnReferralPatient(patientReferralViewModel: patientReferralViewModel,myReferralInPatientModel: referredPatient,),),); + }, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 0bacb1d8..23bbb2b9 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -1,11 +1,14 @@ 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'; 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-referral-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/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ReferredPatientScreen extends StatelessWidget { // previous design page is: MyReferredPatient @@ -20,59 +23,94 @@ class ReferredPatientScreen extends StatelessWidget { body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).referralEmptyMsg, + color: Theme.of(context).errorColor, + ), + ) + ], ), ) - ], - ), - ) : SingleChildScrollView( + // DoctorApplication.svc/REST/GtMyReferredPatient child: Container( + margin: EdgeInsets.only(top: 70), child: Column( children: [ - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 2, - indent: 0, - endIndent: 0, - ), + // const Divider( + // color: Color(0xffCCCCCC), + // height: 1, + // thickness: 2, + // indent: 0, + // endIndent: 0, + // ), ...List.generate( model.listMyReferredPatientModel.length, - (index) => - PatientReferralItemWidget( - referralStatus: "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", - patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", - patientGender: model.getReferredPatientItem(index).gender, - referredDate: DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy"), - referredTime: " ", - patientID: - "${model.getReferredPatientItem(index).patientID}", - isSameBranch: model.getReferredPatientItem(index) - .isReferralDoctorSameBranch, - isReferral: false, - remark: - model.getReferredPatientItem(index).referringDoctorRemarks, - nationality: model.getReferredPatientItem(index) - .nationalityName, - nationalityFlag: - model.getReferredPatientItem(index).nationalityFlagURL, - doctorAvatar: - model.getReferredPatientItem(index).doctorImageURL, - referralDoctorName: "${model.getReferredPatientItem(index).referringDoctorName}(${model.getReferredPatientItem(index).referringClinicDescription})", - clinicDescription: null, - ), + (index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: ReferredPatientDetailScreen( + model.getReferredPatientItem(index)), + ), + ); + }, + child: PatientReferralItemWidget( + referralStatus:model.getReferredPatientItem(index).referralStatusDesc, + referralStatusCode: model + .getReferredPatientItem(index) + .referralStatus, + patientName: + "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + patientGender: + model.getReferredPatientItem(index).gender, + referredDate: DateUtils.convertDateFromServerFormat( + model + .getReferredPatientItem(index) + .referralDate, + "dd/MM/yyyy"), + referredTime: DateUtils.convertDateFromServerFormat( + model + .getReferredPatientItem(index) + .referralDate, + "hh:mm a"), + patientID: + "${model.getReferredPatientItem(index).patientID}", + isSameBranch: model + .getReferredPatientItem(index) + .isReferralDoctorSameBranch, + isReferral: false, + remark: model + .getReferredPatientItem(index) + .referringDoctorRemarks, + nationality: model + .getReferredPatientItem(index) + .nationalityName, + nationalityFlag: model + .getReferredPatientItem(index) + .nationalityFlagURL, + doctorAvatar: model + .getReferredPatientItem(index) + .doctorImageURL, + referralDoctorName: + "Dr. ${model.getReferredPatientItem(index).referralDoctorName}", + clinicDescription: model + .getReferredPatientItem(index) + .referralClinicDescription, + infoIcon: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black), + ), + ), ), ], ), 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 new file mode 100644 index 00000000..a9ca6c27 --- /dev/null +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -0,0 +1,567 @@ +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/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/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/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 { + final MyReferredPatientModel referredPatient; + + ReferredPatientDetailScreen(this.referredPatient); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + (Helpers.capitalize( + "${referredPatient.firstName} ${referredPatient.lastName}")), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + referredPatient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromReferral(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Icon( + Icons.account_circle, + size: 25, + ), + ) + ]), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: (){ + PatiantInformtion patient = + model.getPatientFromReferral(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat( + DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).viewProfile, + fontWeight: FontWeight.w700, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Colors.red[700], + ) + ], + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + referredPatient.referralStatusDesc, + fontFamily: 'Poppins', + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: referredPatient.referralStatus == 1 + ? Color(0xffc4aa54) + : referredPatient.referralStatus == 46 + ? Colors.green[700] + : Colors.red[700], + ), + AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.referralDate, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Color(0XFF28353E), + ) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .fileNumber, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + "${referredPatient.patientID}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0XFF2E303A), + ), + ], + ), + AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.referralDate, + "hh:mm a"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).refClinic}: ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient + .referralClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 13, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0XFF2E303A), + ), + ), + ], + ), + ], + ), + ), + Row( + children: [ + AppText( + referredPatient.nationalityName != + null + ? referredPatient.nationalityName + : "", + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + fontSize: + 1.4 * SizeConfig.textMultiplier, + ), + referredPatient.nationalityFlagURL != + null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + referredPatient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext + context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient.priorityDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0XFF2E303A), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + DateUtils.convertDateFromServerFormat( + referredPatient.mAXResponseTime, + "dd MMM,yyyy"), + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_left.png', + height: 50, + width: 30, + ), + ), + Container( + margin: EdgeInsets.only( + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != + null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + referredPatient.doctorImageURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : Container( + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 10, + top: 30, + right: 10, + bottom: 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "Dr ${referredPatient.referralDoctorName}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w800, + fontSize: 1.5 * + SizeConfig.textMultiplier, + color: Colors.black, + ), + AppText( + referredPatient + .referralClinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.3 * + SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + Expanded( + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: Colors.white, + width: 1.0, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 2.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient.referringDoctorRemarks, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 0, top: 0, right: 4, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + referredPatient.doctorImageURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : Container( + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).reply, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + AppText( + referredPatient + .referredDoctorRemarks.isNotEmpty + ? referredPatient.referredDoctorRemarks + : " Not Replied yet", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 1.6 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: AppButton( + title: TranslationBase.of(context).acknowledged, + color: Colors.red[700], + fontColor: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 1.8, + hPadding: 8, + vPadding: 12, + disabled: referredPatient.referredDoctorRemarks.isNotEmpty + ? false + : true, + onPressed: () async { + await model.verifyReferralDoctorRemarks(referredPatient); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast( + "Referral is acknowledged"); + Navigator.pop(context); + } + }, + ), + ), + ], + ), + ), + ), + ); + } +} 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 a2083bd9..87015bbb 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 @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.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/core/viewModel/auth_view_model.dart'; +// import 'package:doctor_app_flutter/core/viewModel/auth_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'; @@ -13,33 +13,33 @@ 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/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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../../../../../widgets/shared/user-guid/custom_validation_error.dart'; - class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) - addSelectedAssessment; + addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; AddAssessmentDetails( {Key key, - this.mySelectedAssessment, - this.addSelectedAssessment, - this.patientInfo, - this.isUpdate = false, - this.mySelectedAssessmentList}); + this.mySelectedAssessment, + this.addSelectedAssessment, + this.patientInfo, + this.isUpdate = false, + this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -76,21 +76,32 @@ class _AddAssessmentDetailsState extends State { } InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( + {IconData icon, String validationError}) { + return new InputDecoration( fillColor: Colors.white, - contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderSide: BorderSide( + color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), + width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderSide: BorderSide( + color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), + width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), + borderSide: BorderSide( + color: (validationError != null + ? Colors.red.shade700 + : Color(0xFFEFEFEF)), + width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -133,227 +144,224 @@ class _AddAssessmentDetailsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - height: 55.0, - hintText: + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + // height: 55.0, + hintText: TranslationBase.of(context).appointmentNumber, - isDropDown: false, - enabled: false, - controller: appointmentIdController, - ), - ), - SizedBox( - height: 10, - ), - Container( - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - child: widget - .mySelectedAssessment.selectedICD == - null - ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - widget.mySelectedAssessment - .selectedICD != - null - ? widget.mySelectedAssessment - .selectedICD.nameEn - : null, - true, - icon: Icons.keyboard_arrow_down), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts(suggestion - .description + - " / " + - suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ) - : AppTextFieldCustom( - onClick: model.listOfICD10 != null - ? () { + isTextFieldHasSuffix: false, + enabled: false, + controller: appointmentIdController, + ), + ), + SizedBox( + height: 10, + ), + Container( + child: InkWell( + onTap: model.listOfICD10 != null + ? () { setState(() { widget.mySelectedAssessment .selectedICD = null; icdNameController.text = null; }); } - : null, - hintText: TranslationBase.of(context) - .nameOrICD, - maxLines: 2, - minLines: 1, - controller: icdNameController, - - enabled: true, - ) - ), - ), - if (isFormSubmitted && - widget.mySelectedAssessment.selectedICD == null) - CustomValidationError(), - SizedBox( - height: 7, - ), - AppTextFieldCustom( - height: 55.0, - onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - conditionController - .text = projectViewModel - .isArabic - ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).condition, - maxLines: 2, - minLines: 1, - controller: conditionController, - isDropDown: true, - enabled: false, - ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null) - CustomValidationError(), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: 55.0, - onClick: model.listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - typeController.text = - projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } : null, - hintText: TranslationBase.of(context).dType, - maxLines: 2, - minLines: 1, - enabled: false, - isDropDown: true, - controller: typeController, - ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).remarks, - fontSize: 13.5, - fontWeight: FontWeight.w600, - maxLines: 18, - minLines: 5, - hasLabelText: - remarkController.text != '' ? true : false, - showLabelText: true, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; - }, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - ])), + child: widget + .mySelectedAssessment.selectedICD == + null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + widget.mySelectedAssessment + .selectedICD == + null, + child: AutoCompleteTextField< + MasterKeyModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase.of(context) + .nameOrICD, + null, + true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text = + '${item.code.trim()}/${item.description}'; + }), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding( + child: AppText( + suggestion.description + + " / " + + suggestion.code + .toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.code + .toLowerCase() + .startsWith( + input.toLowerCase()), + ), + ) + : AppTextFieldCustom( + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, + hintText: TranslationBase.of(context) + .nameOrICD, + maxLines: 2, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + )), + ), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedDiagnosisCondition = + selectedValue; + conditionController + .text = projectViewModel + .isArabic + ? widget + .mySelectedAssessment + .selectedDiagnosisCondition + .nameAr + : widget + .mySelectedAssessment + .selectedDiagnosisCondition + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).condition, + maxLines: 2, + minLines: 1, + controller: conditionController, + isTextFieldHasSuffix: true, + enabled: false, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == + null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedDiagnosisType = + selectedValue; + typeController.text = + projectViewModel.isArabic + ? selectedValue.nameAr + : selectedValue.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).dType, + maxLines: 2, + minLines: 1, + enabled: false, + isTextFieldHasSuffix: true, + controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == + null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + maxLines: 18, + minLines: 5, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = + remarkController.text; + }, + ), + ), + SizedBox( + height: 10, + ), + ])), ), ], ), @@ -394,17 +402,17 @@ class _AddAssessmentDetailsState extends State { widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && + .selectedDiagnosisCondition != + null && widget.mySelectedAssessment - .selectedDiagnosisType != + .selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD != null) { await submitAssessment( isUpdate: widget.isUpdate, model: model, mySelectedAssessment: - widget.mySelectedAssessment); + widget.mySelectedAssessment); } }, ), @@ -424,8 +432,8 @@ class _AddAssessmentDetailsState extends State { submitAssessment( {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, - bool isUpdate = false}) async { + MySelectedAssessment mySelectedAssessment, + bool isUpdate = false}) async { if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -441,11 +449,11 @@ class _AddAssessmentDetailsState extends State { await model.patchAssessment(patchAssessmentReqModel); } else { PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, @@ -458,7 +466,7 @@ class _AddAssessmentDetailsState extends State { } if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -472,4 +480,4 @@ class _AddAssessmentDetailsState extends State { Navigator.of(context).pop(); } } -} \ No newline at end of file +} 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 7a42fe79..1c3c7e3f 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 @@ -9,11 +9,11 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -387,7 +387,7 @@ class _UpdateAssessmentPageState extends State { children: [ Column( children: [ - Texts( + AppText( assessment.createdOn != null ? DateUtils .getDayMonthYearDateFormatted( @@ -400,7 +400,7 @@ class _UpdateAssessmentPageState extends State { fontWeight: FontWeight .w600, fontSize: 14, - ), Texts( + ), AppText( assessment.createdOn != null ? DateUtils.getHour( DateTime.parse( @@ -453,7 +453,7 @@ class _UpdateAssessmentPageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet:Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -462,55 +462,67 @@ class _UpdateAssessmentPageState extends State { border: Border.all( color: HexColor('#707070'), width: 0), - ), child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.05, - ), - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - helpers.showErrorToast( - TranslationBase - .of(context) - .assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ) + , + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast( + TranslationBase + .of(context) + .assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], ), ), - ], - ), - ), - ), + ),), + SizedBox( + height: 5, + ), + ], + ),) + ), ); } 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 b9f1bd63..c77e9a49 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 @@ -7,7 +7,7 @@ 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'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -115,16 +115,15 @@ class _AddExaminationPageState extends State { Container( padding: EdgeInsets.all(16), color: Colors.white, - child: BorderedButton( - "${TranslationBase.of(context).addExamination}", - backgroundColor: HexColor("#359846"), - textColor: Colors.white, + child: AppButton( + title:"${TranslationBase.of(context).addExamination}", + color: HexColor("#359846"), + fontColor: Colors.white, vPadding: 12, radius: 12, fontWeight: FontWeight.w600, fontSize: SizeConfig.textMultiplier * 2.5, - fontFamily: 'Poppins', - handler: () { + onPressed: () { widget.addSelectedExamination(); }, ), 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 82cef2e9..e990be79 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 @@ -4,9 +4,9 @@ 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/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.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 941b60ca..36b65d4c 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,8 +1,8 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'add_examination_widget.dart'; @@ -43,16 +43,17 @@ class _ExaminationsListSearchWidgetState AppTextFieldCustom( height: MediaQuery.of(context).size.height * 0.080, hintText: TranslationBase.of(context).searchExamination, - isDropDown: true, + isTextFieldHasSuffix: true, hasBorder: false, controller: filteredSearchController, onChanged: (value) { filterSearchResults(value); }, - suffixIcon: Icon( + suffixIcon: IconButton( + icon: Icon( Icons.search, color: Colors.black, - ), + )), ), DividerWithSpacesAround( height: 2, 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 abb62808..8fdfffc2 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 @@ -2,8 +2,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.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/core/viewModel/auth_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -11,10 +9,11 @@ import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model. 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/screens/base/base_view.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_buttons_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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -131,15 +130,21 @@ class _UpdateObjectivePageState extends State { }).toList(), ) ], + ), isExpanded: isSysExaminationExpand, ), + SizedBox(height: MediaQuery + .of(context) + .size + .height * 0.12,) ], ), ), ), ), - bottomSheet: Container( + bottomSheet: + Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -149,55 +154,56 @@ class _UpdateObjectivePageState extends State { color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: 80, width: double.infinity, - child: FractionallySizedBox( - widthFactor: 0.9, - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.4, - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width *0.1, - ), - Container( - width: MediaQuery.of(context).size.width *0.4, - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - loading: model.state == ViewState.BusyLocal, - color: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? Colors.red[700] - : HexColor("#A5A5A5"), - fontColor: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"), - disabled: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? false - : true, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ) + , + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], ), ), - ], - ), - ), - ), + ),), + SizedBox( + height: 5, + ), + ], + ),) + + ), ); } @@ -250,14 +256,14 @@ class _UpdateObjectivePageState extends State { } if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else { widget.changeLoadingState(true); widget.changePageViewIndex(2); } } else { - helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } } 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 6f57ceb8..8e7e3f98 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 @@ -1,7 +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/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/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; @@ -12,10 +11,10 @@ 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'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -85,7 +84,7 @@ class _UpdatePlanPageState extends State { await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = helpers + progressNoteController.text = Helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); widget.patientProgressNote.planNote = progressNoteController.text; widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; @@ -164,12 +163,12 @@ class _UpdatePlanPageState extends State { children: [ Row( children: [ - Texts('Appointment No: ',fontSize: 12,), - Texts(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), + AppText('Appointment No: ',fontSize: 12,), + AppText(widget.patientProgressNote.appointmentNo??'',fontWeight: FontWeight.w600,), ], ), - Texts( + AppText( widget.patientProgressNote.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w600, @@ -186,13 +185,13 @@ class _UpdatePlanPageState extends State { children: [ Row( children: [ - Texts('Condition: ', + AppText('Condition: ', fontSize: 12,), - Texts( + AppText( widget.patientProgressNote.mName??'',fontWeight: FontWeight.w600), ], ), - Texts( + AppText( widget.patientProgressNote.createdOn !=null?DateUtils.getHour(DateTime.parse(widget.patientProgressNote.createdOn)):DateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, @@ -206,7 +205,7 @@ class _UpdatePlanPageState extends State { MainAxisAlignment.start, children: [ Expanded( - child: Texts( + child: AppText( progressNoteController.text, fontSize: 10, ), @@ -237,7 +236,8 @@ class _UpdatePlanPageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet: + Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -247,76 +247,85 @@ class _UpdatePlanPageState extends State { color: HexColor('#707070'), width: 0), ), - width: double.maxFinite, - height: 90, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - margin: EdgeInsets.all(6), - child: Column( - children: [ - Row( + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).previous, + title: TranslationBase + .of(context) + .previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, onPressed: () async { - setState(() { - widget.changePageViewIndex(2); - }); + widget.changePageViewIndex(2); }, - ), + ) + , ), SizedBox(width: 5,), Expanded( child: AppButton( - title: isAddProgress? TranslationBase.of(context).next: "Finish", + title: TranslationBase + .of(context) + .next, fontWeight: FontWeight.w600, color: Colors.red[700], loading: model.state == ViewState.BusyLocal, disabled: progressNoteController.text.isEmpty, onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - Map profile = - await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote - .createdByName ?? - doctorProfile.doctorName; - widget.patientProgressNote.editedByName = - doctorProfile.doctorName; - widget.patientProgressNote.createdOn = - DateTime.now().toString(); - widget.patientProgressNote.planNote = - progressNoteController.text; - isAddProgress = !isAddProgress; - }); - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - helpers.showErrorToast(TranslationBase.of(context) - .progressNoteErrorMsg); - } - }, + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + Map profile = + await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = + widget.patientProgressNote + .createdByName ?? + doctorProfile.doctorName; + widget.patientProgressNote.editedByName = + doctorProfile.doctorName; + widget.patientProgressNote.createdOn = + DateTime.now().toString(); + widget.patientProgressNote.planNote = + progressNoteController.text; + isAddProgress = !isAddProgress; + }); + submitPlan(model); + } else { + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast(TranslationBase.of(context) + .progressNoteErrorMsg); + } + }, ), ), ], ), - - ], + ), + ),), + SizedBox( + height: 5, ), - ), - ), - ), + ], + ),) + ), ); } @@ -342,12 +351,12 @@ class _UpdatePlanPageState extends State { } if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else { widget.changePageViewIndex(4,isChangeState:false); } } else { - helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 962f8adb..d4666428 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; @@ -39,7 +39,7 @@ class ExpandableSOAPWidget extends StatelessWidget { onTap: onTap, child: Row( children: [ - Texts(headerTitle, + AppText(headerTitle, variant: isExpanded ? "bodyText" : '', fontSize: 15, color: Colors.black), 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 c1cbcd28..fc7329e5 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 @@ -1,13 +1,13 @@ import 'package:autocomplete_textfield/autocomplete_textfield.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/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.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'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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/master_key_checkbox_search_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; @@ -207,7 +207,7 @@ class _AddAllergiesState extends State { addAllergyLocally(MySelectedAllergy mySelectedAllergy) { if (mySelectedAllergy.selectedAllergy == null) { - helpers.showErrorToast(TranslationBase + Helpers.showErrorToast(TranslationBase .of(context) .requiredMsg); } else { 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 ff88718e..6f7439e6 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,7 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/material.dart'; @@ -62,7 +62,7 @@ class _UpdateAllergiesWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( projectViewModel.isArabic ? selectedAllergy.selectedAllergy.nameAr : selectedAllergy.selectedAllergy.nameEn @@ -72,7 +72,7 @@ class _UpdateAllergiesWidgetState extends State { : TextDecoration.lineThrough, bold: true, color: Color(0xFF2B353E)), - Texts( + AppText( projectViewModel.isArabic ? selectedAllergy.selectedAllergySeverity .nameAr @@ -95,7 +95,7 @@ class _UpdateAllergiesWidgetState extends State { InkWell( child: Row( children: [Container( - child: Texts( + child: AppText( TranslationBase .of(context) .remove, @@ -187,7 +187,7 @@ class _UpdateAllergiesWidgetState extends State { changeParentState(); Navigator.of(context).pop(); } else { - helpers.showErrorToast(TranslationBase + Helpers.showErrorToast(TranslationBase .of(context) .requiredMsg); } diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index cdc6cad5..10f9c2a6 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -1,9 +1,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../../../../../../widgets/shared/user-guid/custom_validation_error.dart'; import '../medication/update_medication_widget.dart'; class UpdateChiefComplaints extends StatelessWidget { @@ -35,33 +34,28 @@ class UpdateChiefComplaints extends StatelessWidget { height: 20, ), //TODO handel error cases - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase.of(context).addChiefComplaints, controller: complaintsController, maxLines: 25, - minLines: 3, - ), + minLines: 7, + hasBorder: true, + validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null , - Container( - child: CustomValidationError( - error: complaintsControllerError, - )), + ), SizedBox( height: 20, ), - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase .of(context) .historyOfPresentIllness, controller: illnessController, maxLines: 25, - minLines: 3, - ), - Container( - child: CustomValidationError(error: illnessControllerError,)), - SizedBox( - height: 20, + minLines: 7, + hasBorder: true, + validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , ), SizedBox( height: 10, @@ -72,16 +66,17 @@ class UpdateChiefComplaints extends StatelessWidget { SizedBox( height: 10, ), - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase .of(context) .currentMedications, controller: medicationController, - maxLines: 25, - minLines: 3, + maxLines: 25, + minLines: 7, + hasBorder: true, + validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null , + ), - Container(child: CustomValidationError( - error: medicationControllerError,)), SizedBox( height: 10, ), 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 6f610a8e..1da8db17 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 @@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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_buttons_widget.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/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.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 41df16ed..f114702d 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 @@ -2,7 +2,7 @@ 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/my_selected_history.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -59,7 +59,7 @@ class _UpdateHistoryWidgetState extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Texts( + child: AppText( projectViewModel.isArabic ? myHistory.selectedHistory.nameAr : myHistory.selectedHistory.nameEn, @@ -78,7 +78,7 @@ class _UpdateHistoryWidgetState extends State child: Row( children: [ Container( - child: Texts( + child: AppText( TranslationBase .of(context) .remove, 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 3b96cd65..667bbb4b 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 @@ -7,17 +7,17 @@ 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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../../../../../../widgets/shared/user-guid/custom_validation_error.dart'; import '../../shared_soap_widgets/bottom_sheet_title.dart'; // ignore: must_be_immutable @@ -45,52 +45,20 @@ class _AddMedicationState extends State { GetMedicationResponseModel _selectedMedication; GlobalKey key = - new GlobalKey>(); + new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( - filled: true, - fillColor: Colors.white, - - contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 0.00), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 0.00), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 0.00), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 10, - color: Theme - .of(context) - .hintColor, - fontWeight: FontWeight.w700 - ), - ); - } - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery - .of(context) - .size; + final screenSize = MediaQuery.of(context).size; return FractionallySizedBox( child: BaseView( onModelReady: (model) async { if (model.medicationStrengthList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationStrength,); + await model.getMasterLookup( + MasterKeysService.MedicationStrength, + ); } if (model.medicationFrequencyList.length == 0) { await model.getMasterLookup(MasterKeysService.MedicationFrequency); @@ -104,364 +72,366 @@ class _AddMedicationState extends State { if (model.allMedicationList.length == 0) await model.getMedicationList(); }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - BottomSheetTitle( - title: TranslationBase.of(context).addMedication, - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: - textFieldSelectorDecoration( - - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication - .genericName - : null, - true, - icon: EvaIcons.search), - itemSubmitted: (item) => setState( - () => - _selectedMedication = item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: Texts(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()), - ) - : AppTextFieldCustom( - hintText: _selectedMedication != null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) - .searchMedicineNameHere, - minLines: 2, - maxLines: 2, - enabled: false, - ), - ), - ), - if (isFormSubmitted && - _selectedMedication == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - onClick: model.medicationDoseTimeList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: TranslationBase.of(context).addMedication, + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 16, + ), + SizedBox( + height: 16, + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { setState(() { - _selectedMedicationDose = - selectedValue; - - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; + _selectedMedication = null; }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + _selectedMedication == null, + child: AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase.of( + context) + .searchMedicineNameHere, + null, + true, + suffixIcon: Icons.search), + itemSubmitted: (item) => setState( + () => _selectedMedication = + 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()), + ), + ) + : AppTextFieldCustom( + hintText: _selectedMedication != + null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context) + .searchMedicineNameHere, + minLines: 2, + maxLines: 2, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + onClick: model.medicationDoseTimeList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; + + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).doseTime, - maxLines: 2, - minLines: 2, - isDropDown: true, - controller: doseController, - ), - SizedBox( - height: 5, - ), - if (isFormSubmitted && - _selectedMedicationDose == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isDropDown: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationStrengthList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + maxLines: 2, + minLines: 2, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && + _selectedMedicationDose == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationStrengthList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).strength, - maxLines: 2, - minLines: 2, - controller: strengthController, - ), - SizedBox( - height: 5, - ), - if (isFormSubmitted && - _selectedMedicationStrength == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isDropDown: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + maxLines: 2, + minLines: 2, + controller: strengthController, + validationError: isFormSubmitted && + _selectedMedicationStrength == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 2, - minLines: 2, - controller: routeController, - ), - SizedBox( - height: 5, - ), - if (isFormSubmitted && - _selectedMedicationRoute == null) - CustomValidationError(), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationFrequencyList, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 2, + minLines: 2, + controller: routeController, + validationError: isFormSubmitted && + _selectedMedicationRoute == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + onClick: model.medicationFrequencyList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationFrequencyList, + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).frequency, - enabled: false, - maxLines: 2, - minLines: 2, - isDropDown: true, - controller: frequencyController, - ), - SizedBox( - height: 5, - ), - if (isFormSubmitted && - _selectedMedicationFrequency == null) - CustomValidationError(), - SizedBox( - height: 30, - ), - ], - )), - ), - ), - ]), - ), + enabled: false, + maxLines: 2, + minLines: 2, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && + _selectedMedicationFrequency == null + ? TranslationBase.of(context).emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 30, + ), + ], + )), + ), + ), + ]), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0.30), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, ), - 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).addMedication.toUpperCase(), - color: Color(0xFF359846), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = widget + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context) + .addMedication + .toUpperCase(), + color: Color(0xFF359846), + onPressed: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; - Navigator.of(context).pop(); - } - }, - ), - ), + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, ), ), - SizedBox( - height: 5, - ), - ], + ), ), - ), + SizedBox( + height: 5, + ), + ], ), + ), + ), ), ); } } - - - 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 d78c8c45..b0db0414 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,4 +1,3 @@ -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/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -15,17 +14,18 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_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/screens/base/base_view.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_buttons_widget.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 '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import 'allergies/update_allergies_widget.dart'; -import 'history/update_history_widget.dart'; import 'cheif_complaints/update_Chief_complaints.dart'; +import 'history/update_history_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -208,7 +208,7 @@ class _UpdateSubjectivePageState extends State { await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = helpers.parseHtmlString( + complaintsController.text = Helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; @@ -323,18 +323,15 @@ class _UpdateSubjectivePageState extends State { color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: 80, width: double.infinity, - child: Column( children: [ SizedBox( height: 10, ), - Container(child: FractionallySizedBox( + Container(child: + FractionallySizedBox( widthFactor: .80, child: Center( child: AppButton( @@ -376,19 +373,19 @@ class _UpdateSubjectivePageState extends State { complaintsController.text.length > 25) { await postChiefComplaint(model: model); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } if (myHistoryList.length != 0) { await postHistories(model: model, myHistoryList: myHistoryList); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } if (myAllergiesList.length != 0) { await postAllergy(myAllergiesList: myAllergiesList, model: model); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } widget.changeLoadingState(true); @@ -419,7 +416,7 @@ class _UpdateSubjectivePageState extends State { .emptyMessage; } }); - helpers.showErrorToast(TranslationBase + Helpers.showErrorToast(TranslationBase .of(context) .chiefComplaintErrorMsg); } @@ -470,7 +467,7 @@ class _UpdateSubjectivePageState extends State { await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } @@ -501,7 +498,7 @@ class _UpdateSubjectivePageState extends State { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 8393131b..564c8c2c 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -48,7 +48,6 @@ class LineChartCurved extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, fontFamily: 'Poppins', textAlign: TextAlign.center, ), diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 3c0e4add..1c387c9a 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -10,9 +10,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final List timeSeries1; final List timeSeries2; final int indexes; + final bool isOX; LineChartCurvedBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); List xAxixs = List(); List yAxixs = List(); @@ -42,7 +43,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { title, fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', textAlign: TextAlign.center, ), @@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Theme.of(context).primaryColor), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).systolicLng) + AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) ], ), SizedBox(width: 15,), @@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Colors.red), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).diastolicLng,) + AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) ], ), ], @@ -259,6 +260,14 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - return [lineChartBarData1, lineChartBarData2]; + List lineChartData = List(); + if(spots.isNotEmpty){ + lineChartData.add(lineChartBarData1); + } + if(spots2.isNotEmpty){ + lineChartData.add(lineChartBarData2); + } + return lineChartData; + // return [lineChartBarData1, lineChartBarData2]; } } diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart index 6b2543be..0bf2197b 100644 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart @@ -1,10 +1,8 @@ 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/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-data.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-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; 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 new file mode 100644 index 00000000..ef6bc48f --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -0,0 +1,278 @@ +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/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/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +class VitalSignDetailPainScale extends StatelessWidget { + final List vitalList; + + VitalSignDetailPainScale(this.vitalList); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate( + vitalList.length, + (index) => Container( + margin: EdgeInsets.all(5), + color: Colors.white, + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + child: Center( + child: AppText( + TranslationBase.of(context).description, + color: Colors.black, + bold: true, + ), + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + TranslationBase.of(context).value, + color: Colors.black, + bold: true, + ), + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + TranslationBase.of(context).date, + color: Colors.black, + bold: true, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 7, + ), + Divider( + color: Colors.black, + thickness: 1, + ), + SizedBox( + height: 12, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16), + padding: EdgeInsets.only(left: 8), + child: Row( + children: [ + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: AppText( + TranslationBase.of(context).painScale, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painScore ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + child: AppText( + "Location", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painLocation ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + "Character", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painCharacter ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + "Duration", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painDuration ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + TranslationBase.of(context).painManagement, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].isPainManagementDone ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + child: AppText( + "Frequency", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Color(0XFF28353E), + fontWeight: FontWeight.w600, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: AppText( + "${vitalList[index].painFrequency ?? "-"}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.3, + ), + ), + ), + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Center( + child: AppText( + "${DateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ), + ), + ) + ], + ), + ), + SizedBox( + height: 8, + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } +} 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 98238c58..a6170f6f 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,5 @@ 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-data.dart'; import 'package:doctor_app_flutter/models/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'; @@ -64,7 +63,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), // height: 60, @@ -86,7 +85,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), // height: 60 @@ -108,7 +107,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title3, fontSize: SizeConfig.textMultiplier * 1.5, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), // height: 60 @@ -163,11 +162,11 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${DateUtils.getHour(elementDate)}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), @@ -181,7 +180,7 @@ class _VitalSignDetailsWidgetState extends State { // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), @@ -195,7 +194,7 @@ class _VitalSignDetailsWidgetState extends State { // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), 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 8488c94d..5ceaedd5 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 @@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sig 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-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/fade_page.dart'; @@ -30,12 +29,13 @@ class VitalSignDetailsScreen extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; String from = routeArgs['from']; String to = routeArgs['to']; + bool isInpatient = routeArgs['isInpatient']; String imageBasePath = 'assets/images/'; String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( onModelReady: (model) => - model.getPatientVitalSignHistory(patient, from, to), + model.getPatientVitalSignHistory(patient, from, to, isInpatient), builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, @@ -44,400 +44,735 @@ class VitalSignDetailsScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 ? Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${patient.firstName ?? patient.patientDetails.firstName}'s", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.6, - fontWeight: FontWeight.w600, - ), - AppText( - TranslationBase.of(context).vitalSign, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - ) - ], - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.23, - width: double.infinity, - padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric(horizontal: 16.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(16), - border: Border.fromBorderSide(BorderSide( - color: Colors.grey.shade400, - width: 0.4, - )), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, - fontWeight: FontWeight.w700, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 1 - ? '${assetBasePath}underweight_BMI.png' - : '${assetBasePath}underweight_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - AppText( - "${TranslationBase.of(context).bmiUnderWeight}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, - fontWeight: FontWeight.w700, - ), - AppText( - "(<18.5)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, - fontWeight: FontWeight.w700, - ), - ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 2 - ? '${assetBasePath}health_BMI.png' - : '${assetBasePath}health_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - Container( - child: AppText( - "${TranslationBase.of(context).normal}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, - ), - ), - AppText( - "(18.5-24.9)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, - ), - ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 3 - ? '${assetBasePath}ovrweight_BMI.png' - : '${assetBasePath}ovrweight_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - AppText( - "${TranslationBase.of(context).bmiOverWeight}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, - ), - AppText( - "(25-29.9)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.155, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, - ), - ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - mode.getBMIStatus() != 4 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), AppText( - "${TranslationBase.of(context).bmiObese}", + "${patient.firstName ?? patient.patientDetails.firstName}'s", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, ), AppText( - "(30-34.9)", + TranslationBase.of(context).vitalSign, fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) ], - )), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.23, + width: double.infinity, + padding: EdgeInsets.all(12.0), + margin: EdgeInsets.symmetric( + horizontal: 16.0, vertical: 8.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - mode.getBMIStatus() != 5 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: - MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - FittedBox( - fit: BoxFit.fitWidth, - child: AppText( - "${TranslationBase.of(context).bmiObeseExtreme}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, - ), - ), AppText( - "(35<)", + "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 1 + ? '${assetBasePath}underweight_BMI.png' + : '${assetBasePath}underweight_BMI-r.png', + height: MediaQuery.of(context) + .size + .height * + 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiUnderWeight}", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + AppText( + "(<18.5)", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 2 + ? '${assetBasePath}health_BMI.png' + : '${assetBasePath}health_BMI-r.png', + height: MediaQuery.of(context) + .size + .height * + 0.10, + ), + const SizedBox( + height: 4, + ), + Container( + child: AppText( + "${TranslationBase.of(context).normal}", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * + 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + ), + AppText( + "(18.5-24.9)", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 3 + ? '${assetBasePath}ovrweight_BMI.png' + : '${assetBasePath}ovrweight_BMI-r.png', + height: MediaQuery.of(context) + .size + .height * + 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiOverWeight}", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.155, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(25-29.9)", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.155, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 4 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context) + .size + .height * + 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiObese}", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(30-34.9)", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 5 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context) + .size + .height * + 0.10, + ), + const SizedBox( + height: 4, + ), + FittedBox( + fit: BoxFit.fitWidth, + child: AppText( + "${TranslationBase.of(context).bmiObeseExtreme}", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * + 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ), + AppText( + "(35<)", + fontFamily: 'Poppins', + fontSize: + SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ], + )), + ], + ) ], - )), - ], - ) - ], - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 8.0), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 4, - mainAxisSpacing: 4, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context).height, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), - ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).height, - imagePath: "${assetBasePath}height.png", - lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm, - ), ), ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context).weight, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), + Expanded( + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: 16.0, vertical: 16), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 6, + mainAxisSpacing: 6, + crossAxisCount: 3, + children: [ + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Height, + pageTitle: + TranslationBase.of( + context) + .height, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context) + .height, + imagePath: + "${assetBasePath}height.png", + lastVal: mode.heightCm, + unit: TranslationBase.of(context) + .cm, + ), + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Weight, + pageTitle: + TranslationBase.of( + context) + .weight, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .weight, + imagePath: + "${assetBasePath}weight.png", + unit: + TranslationBase.of(context).kg, + lastVal: mode.weightKg, + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Temperature, + pageTitle: + TranslationBase.of( + context) + .temperature, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context) + .temperature, + imagePath: + "${assetBasePath}temperature.png", + lastVal: mode.temperatureCelcius, + unit: TranslationBase.of(context) + .tempC, + ), + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .heart, + pageTitle: + TranslationBase.of( + context) + .heart, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .heart, + imagePath: + "${assetBasePath}heart_rate.png", + lastVal: mode.hartRat, + unit: + TranslationBase.of(context).bpm, + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Respiration, + pageTitle: + TranslationBase.of( + context) + .respirationRate, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .respirationRate, + imagePath: + "${assetBasePath}respiration_rate.png", + lastVal: + mode.respirationBeatPerMinute, + unit: TranslationBase.of(context) + .respirationSigns, + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .BloodPressure, + pageTitle: + TranslationBase.of( + context) + .bloodPressure, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .bloodPressure, + imagePath: + "${assetBasePath}blood_pressure.png", + lastVal: mode.bloodPressure, + unit: TranslationBase.of(context) + .sysDias, + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .Oxygenation, + pageTitle: + TranslationBase.of( + context) + .oxygenation, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .oxygenation, + imagePath: + "${assetBasePath}oxg.png", + lastVal: mode.oxygenation, + unit: "%", + ), + ), + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: + VitalSignItemDetailsScreen( + pageKey: vitalSignDetails + .PainScale, + pageTitle: + TranslationBase.of( + context) + .painScale, + vitalList: mode + .patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .painScale, + imagePath: + "${assetBasePath}painScale.png", + lastVal: mode.painScore, + unit: "", + ), + ), + ], ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).weight, - imagePath: "${assetBasePath}weight.png", - unit: TranslationBase.of(context).kg, - lastVal: mode.weightKg, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: TranslationBase.of(context) - .temperature, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + /*RoundedContainer( + width: MediaQuery.of(context).size.width / 2, + margin: EdgeInsets.symmetric( + horizontal: 0.0, vertical: 16), + child: Container( + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(top: 8), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).painScale}", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painScore}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "Location", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painLocation}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "Character", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painCharacter}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "Duration", + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painDuration}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).painManagement, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.isPainDone}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).frequency, + fontSize: SizeConfig.textMultiplier * 1.5, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${mode.painFrequency}", + fontSize: SizeConfig.textMultiplier * 1.3, + color: Colors.grey.shade700, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ), + ), + ), + Container( + child: Image.asset( + "${assetBasePath}painScale.png", + width: 40, + height: 40, + )) + ], + ), + ), + Container( + child: Column( + children: [ + Align( + alignment: + Alignment.topRight, + child: Icon( + EvaIcons.eye, + ), + ), + Align( + alignment: + Alignment.topLeft, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: AppText( + "${TranslationBase.of(context).painScale}", + fontFamily: 'Poppins', + fontSize: SizeConfig + .textMultiplier * + 1.3, + fontWeight: + FontWeight.bold, + ), + ), + ), + ], + ), + ), + ], + ), ), - ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).temperature, - imagePath: "${assetBasePath}temperature.png", - lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC, + ),*/ + ], + ), ), ), ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context).heart, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).heart, - imagePath: "${assetBasePath}heart_rate.png", - lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: TranslationBase.of(context) - .respirationRate, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).respirationRate, - imagePath: "${assetBasePath}respiration_rate.png", - lastVal: mode.respirationBeatPerMinute, - unit: - TranslationBase.of(context).respirationSigns, - ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context) - .bloodPressure, - vitalList: - mode.patientVitalSignsHistory, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure, - imagePath: "${assetBasePath}blood_pressure.png", - lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias, - ), - ), ], ), ), @@ -467,4 +802,4 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ); } -} +} \ No newline at end of file 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 4941ed87..f058ac3e 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,13 +1,11 @@ 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-data.dart'; import 'package:doctor_app_flutter/models/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'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class VitalSignDetailsWidget extends StatefulWidget { @@ -57,7 +55,7 @@ class _VitalSignDetailsWidgetState extends State { TranslationBase.of(context).date, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), // height: 60, @@ -79,7 +77,7 @@ class _VitalSignDetailsWidgetState extends State { widget.title2, fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), // height: 60 @@ -121,11 +119,11 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(8), color: Colors.white, child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ${DateUtils.getHour(elementDate)}', // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), @@ -139,7 +137,7 @@ class _VitalSignDetailsWidgetState extends State { // textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.w600, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 3431a011..fbea0452 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -1,8 +1,8 @@ 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/rounded_container_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class VitalSignItem extends StatelessWidget { final String des; @@ -55,13 +55,17 @@ class VitalSignItem extends StatelessWidget { margin: 0, ), Expanded( - child: AppText( - "$unit", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.2, - fontWeight: FontWeight.w700, - color: HexColor('#B8382C'), - margin: 0, + child: Column( + children: [ + AppText( + "$unit", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.2, + fontWeight: FontWeight.w700, + color: Color(0xFFB8382C), + margin: 0, + ), + ], ), ), ], @@ -80,17 +84,27 @@ class VitalSignItem extends StatelessWidget { ), Container( width: double.infinity, - child: Align( - alignment: Alignment.topLeft, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: AppText( - "$des", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.3, - fontWeight: FontWeight.bold, + child: Column( + children: [ + Align( + alignment: Alignment.topRight, + child: Icon( + EvaIcons.eye, + ), ), - ), + Align( + alignment: Alignment.topLeft, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: AppText( + "$des", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.3, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), ), ], 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 349120f4..343d0590 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 @@ -2,8 +2,8 @@ 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-data.dart'; import 'package:doctor_app_flutter/models/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'; @@ -141,6 +141,21 @@ class VitalSignItemDetailsScreen extends StatelessWidget { }, ]; + break; + case vitalSignDetails.Oxygenation: + VSchart = [ + { + 'name': 'Oxygenation', + 'nameAr': 'الأوكسجين', + 'title1': 'Date', + 'title2': 'SAO2', + 'title3': 'FIO2', + 'title2Ar': 'SAO2', + 'title3Ar': 'FIO2', + 'viewKey': 'O2', + }, + ]; + break; case vitalSignDetails.Weight: VSchart = [ @@ -210,8 +225,12 @@ class VitalSignItemDetailsScreen extends StatelessWidget { (element) => element.toJson()[chartInfo['viewKey']] != null, ); + if (chartInfo['viewKey'] == 'PainScore') { + return VitalSignDetailPainScale(vitalList); + } + if (vitalListTemp.length != 0 && - chartInfo['viewKey'] == 'BloodPressure') { + chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, name: projectViewModel.isArabic @@ -224,8 +243,8 @@ class VitalSignItemDetailsScreen extends StatelessWidget { title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], - viewKey1: 'BloodPressureHigher', - viewKey2: 'BloodPressureLower', + viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', + viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); } 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 b4c87129..f59f6c23 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 @@ -7,8 +7,6 @@ import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; - import 'LineChartCurved.dart'; class VitalSingChartAndDetials extends StatelessWidget { @@ -63,7 +61,7 @@ class VitalSingChartAndDetials extends StatelessWidget { "Graph Details", fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), SizedBox(height: 8,), 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 934a88b8..27256525 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,16 +1,12 @@ import 'package:doctor_app_flutter/config/size_config.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/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'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; - -import 'LineChartCurved.dart'; import 'LineChartCurvedBloodPressure.dart'; class VitalSingChartBloodPressure extends StatelessWidget { @@ -38,54 +34,55 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { generateData(); - return Padding( - padding: const EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), - child: LineChartCurvedBloodPressure( - title: name, - timeSeries1: timeSeriesData1, - timeSeries2: timeSeriesData2, - indexes: timeSeriesData1.length ~/ 5.5, - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), - padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12) - ), + return timeSeriesData1.length != 0 || timeSeriesData2.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "Graph Details", - fontSize: SizeConfig.textMultiplier * 2.3, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.black, - fontFamily: 'Poppins', + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: LineChartCurvedBloodPressure( + title: name, + isOX: title2=="SAO2", + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), ), - SizedBox(height: 8,), - VitalSignBloodPressureWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - title3: title3, - viewKey1: viewKey1, - viewKey2: viewKey2, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Graph Details", + fontSize: SizeConfig.textMultiplier * 2.3, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + SizedBox( + height: 8, + ), + VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ], + ), ), - ], - ), - ), - /*AppExpandableNotifier( + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurvedBloodPressure( title: name, @@ -102,9 +99,16 @@ class VitalSingChartBloodPressure extends StatelessWidget { viewKey2: viewKey2, ), ),*/ - ], - ), - ); + ], + ), + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + child: Center( + child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + ), + ); } generateData() { diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 67c483a8..c99bb063 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1,11 +1,10 @@ import 'package:autocomplete_textfield/autocomplete_textfield.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/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_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/SOAP/GetAssessmentReqModel.dart'; @@ -17,17 +16,15 @@ 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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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/network_base_view.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'; import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { @@ -83,7 +80,7 @@ postProcedure( await model.postPrescription(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { model.getPrescriptions(patient); DrAppToastMsg.showSuccesToast('Medication has been added'); @@ -287,118 +284,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // color: Colors.white, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // Helpers.hideKeyboard(context); - // setState(() { - // _selectedMedication = null; - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }); - // } - // : null, - // child: _selectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // onFocusChanged: (__) { - // if (_selectedMedication != - // null) { - // model.getItem( - // itemID: - // _selectedMedication - // .itemId); - // uom = _selectedMedication.uom; - // } else { - // null; - // } - // 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; - // } - // }, - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => _selectedMedication = - // item), - // key: key, - // suggestions: - // model.allMedicationList, - // itemBuilder: (context, - // suggestion) => - // new Padding( - // child: Texts(suggestion - // .description + - // '/' + - // suggestion - // .genericName), - // padding: - // EdgeInsets.all(15.0)), - // itemSorter: (a, b) => 1, - // suggestionsAmount: 7, - // itemFilter: (suggestion, input) => - // suggestion.genericName.toLowerCase().startsWith( - // input.toLowerCase()) || - // suggestion.description - // .toLowerCase() - // .startsWith(input - // .toLowerCase()) || - // suggestion.keywords - // .toLowerCase() - // .startsWith( - // input.toLowerCase()), - // ) - // : TextField( - // onEditingComplete: () { - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }, - // decoration: textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .description + - // ('${_selectedMedication.genericName}') - // : null, - // false, - // suffixIcon: - // Icon(Icons.search)), - // enabled: false, - // ), - // ), - // ), + FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -715,7 +601,7 @@ class _PrescriptionFormWidgetState extends State { }); if (route == null) { - helpers.showErrorToast( + Helpers.showErrorToast( 'plase fill'); } }, @@ -1556,12 +1442,12 @@ class _PrescriptionFormWidgetState extends State { searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); // if (myController.text.isEmpty()) { - // helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + // Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); // //"Type Medicine Name") // return; // } if (myController.text.length < 3) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); return; } diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index ec2bda43..15abfeb6 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -2,20 +2,14 @@ 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/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; -import 'package:doctor_app_flutter/core/model/prescription_model.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/patient_view_model.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/models/patient/vital_sign/vital_sign_req_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/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/network_base_view.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart index e5d9ef7d..623cee90 100644 --- a/lib/screens/prescription/prescription_details_page.dart +++ b/lib/screens/prescription/prescription_details_page.dart @@ -1,7 +1,7 @@ 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/Text.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'; @@ -45,7 +45,7 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Center( - child: Texts( + child: AppText( prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN), @@ -70,7 +70,7 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 30, width: double.infinity, child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).route, fontSize: 14, ))), @@ -79,7 +79,7 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 30, width: double.infinity, child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).frequency, fontSize: 14, ))), @@ -88,7 +88,7 @@ class PrescriptionDetailsPage extends StatelessWidget { width: double.infinity, padding: EdgeInsets.symmetric(horizontal: 4), child: Center( - child: Texts( + child: AppText( "${TranslationBase.of(context).dailyDoses}", fontSize: 14, ))), @@ -97,7 +97,7 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 30, width: double.infinity, child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).duration, fontSize: 14, ))), @@ -144,7 +144,7 @@ class PrescriptionDetailsPage extends StatelessWidget { child: Center( child: Column( children: [ - Texts(TranslationBase.of(context).notes), + AppText(TranslationBase.of(context).notes), SizedBox( height: 5, ), @@ -155,7 +155,7 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(prescriptionReport.remarks ?? ''), + 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 new file mode 100644 index 00000000..af0f66e5 --- /dev/null +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -0,0 +1,445 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.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-header-new-design-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 PrescriotionInPatient 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.inPatientPrescription.length == 0) { + await model.getPrescriptionsInPatient(patient); + } + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + backgroundColor: Colors.grey[100], + baseViewModel: model, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patient.patientType.toString(), patient.arrivedOn), + 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, + // child: 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 + + 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.inPatientPrescription[prescriptionIndex] + .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, + // // child: ShowImageDialog( + // // imageUrl: model + // // .inPatientPrescription[index] + // // .imageSRCUrl, + // // ), + // ); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // // child: Image.network( + // // model.prescriptionReportEnhList[index] + // // .imageSRCUrl, + // // fit: BoxFit.cover, + // // ), + // ), + // ), + // ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'Direction', + color: Colors.grey, + ), + Expanded( + child: AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .direction ?? + '')), + ], + ), + Row( + children: [ + AppText( + 'Route', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .route + .toString() ?? + ''), + ], + ), + Row( + children: [ + AppText( + 'Refill', + color: Colors.grey, + ), + Expanded( + child: AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .refillType ?? + '')), + ], + ), + Row( + children: [ + AppText( + 'Start Date ', + color: Colors.grey, + ), + Expanded( + child: AppText( + '${DateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + ], + ), + Row( + children: [ + AppText( + 'Stop Date', + color: Colors.grey, + ), + Expanded( + child: AppText( + '${DateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + ], + ), + Row( + children: [ + AppText( + 'UOM', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .unitofMeasurementDescription ?? + ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .dose + .toString() ?? + ''), + ], + ), + Row( + children: [ + AppText( + 'Status', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .statusDescription + .toString() ?? + ''), + ], + ), + Row( + children: [ + AppText( + 'Processed', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .processedBy ?? + ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .dose + .toString() ?? + ''), + ], + ), + SizedBox( + height: 12, + ), + AppText(model + .inPatientPrescription[ + prescriptionIndex] + .comments ?? + ''), + ], + ), + ) + ], + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a92f5365..06d9634c 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -1,18 +1,13 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/viewModel/prescriptions_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/screens/prescription/prescription_details_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/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -30,6 +25,7 @@ class PrescriptionItemsPage extends StatelessWidget { model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, @@ -63,7 +59,7 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 18,right: 18), - child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), + child: AppText(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)), SizedBox(height: 12,), Row( children: [ @@ -99,30 +95,30 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Row( children: [ - Texts(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: Texts(" "+model.prescriptionReportList[index].routeN)), + AppText(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportList[index].routeN)), ], ), Row( children: [ - Texts(TranslationBase.of(context).frequency,color: Colors.grey,), - Texts(" "+model.prescriptionReportList[index].frequencyN ?? ''), + AppText(TranslationBase.of(context).frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].frequencyN ?? ''), ], ), Row( children: [ - Texts(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - Texts(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), + AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), ], ), Row( children: [ - Texts(TranslationBase.of(context).duration,color: Colors.grey,), - Texts(" "+model.prescriptionReportList[index].days.toString() ?? ''), + AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), SizedBox(height: 12,), - Texts(model.prescriptionReportList[index].remarks ?? ''), + AppText(model.prescriptionReportList[index].remarks ?? ''), ], ),) @@ -150,7 +146,7 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Container( margin: EdgeInsets.only(left: 18,right: 18), - child: Texts(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), + child: AppText(model.prescriptionReportEnhList[index].itemDescription,bold: true,),), SizedBox(height: 12,), Row( mainAxisAlignment: MainAxisAlignment.start, @@ -189,30 +185,30 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ Row( children: [ - Texts(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: Texts(" "+model.prescriptionReportEnhList[index].route??'')), + AppText(TranslationBase.of(context).route,color: Colors.grey,), + Expanded(child: AppText(" "+model.prescriptionReportEnhList[index].route??'')), ], ), Row( children: [ - Texts(TranslationBase.of(context).frequency,color: Colors.grey,), - Texts(" "+model.prescriptionReportEnhList[index].frequency ?? ''), + AppText(TranslationBase.of(context).frequency,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].frequency ?? ''), ], ), Row( children: [ - Texts(TranslationBase.of(context).dailyDoses,color: Colors.grey,), - Texts(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), + AppText(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + AppText(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), ], ), Row( children: [ - Texts(TranslationBase.of(context).duration,color: Colors.grey,), - Texts(" "+model.prescriptionReportList[index].days.toString() ?? ''), + AppText(TranslationBase.of(context).duration,color: Colors.grey,), + AppText(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), SizedBox(height: 12,), - Texts(model.prescriptionReportEnhList[index].remarks?? ''), + AppText(model.prescriptionReportEnhList[index].remarks?? ''), ], ),) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 18655e65..3b207d5a 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -3,14 +3,13 @@ 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/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; -import 'package:doctor_app_flutter/util/helpers.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-page-header-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/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; class NewPrescriptionScreen extends StatefulWidget { @override @@ -227,7 +226,7 @@ class _NewPrescriptionScreenState extends State { 13.5, ), AppText( - Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -250,7 +249,7 @@ class _NewPrescriptionScreenState extends State { .green, ), AppText( - Helpers.getTimeFormated(DateTime.parse(model + DateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -290,7 +289,7 @@ class _NewPrescriptionScreenState extends State { Expanded( child: AppText( - Helpers.getDateFormatted(DateTime.parse(model + DateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart index 940cfc2a..cf038ff6 100644 --- a/lib/screens/prescription/prescription_screen_history.dart +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -1,16 +1,13 @@ 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/add_prescription_form.dart'; -import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; -import 'package:doctor_app_flutter/util/helpers.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-page-header-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/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; class NewPrescriptionHistoryScreen extends StatefulWidget { @override @@ -128,7 +125,7 @@ class _NewPrescriptionHistoryScreenState 13.5, ), AppText( - Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn != null ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) @@ -151,7 +148,7 @@ class _NewPrescriptionHistoryScreenState .green, ), AppText( - Helpers.getTimeFormated(DateTime.parse(model + DateUtils.getTimeFormated(DateTime.parse(model .prescriptionList[ 0] .entityList[ @@ -190,7 +187,7 @@ class _NewPrescriptionHistoryScreenState Expanded( child: AppText( - Helpers.getDateFormatted(DateTime.parse(model + DateUtils.getDateFormatted(DateTime.parse(model .prescriptionList[0] .entityList[index] .startDate)), diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart index 44bcab0c..c91ce9c9 100644 --- a/lib/screens/prescription/prescription_warnings.dart +++ b/lib/screens/prescription/prescription_warnings.dart @@ -1,8 +1,8 @@ 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_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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'; diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index fafd753d..be212dc9 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -1,19 +1,17 @@ -import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescriptions_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/screens/prescription/add_prescription_form.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/util/date-utils.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-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.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'; +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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -26,159 +24,199 @@ class PrescriptionsPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; + bool isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPrescriptions(patient,patientType:patientType), + onModelReady: (model) => + isSelectInpatient + ? model.getPrescriptionsInPatient(patient) + : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType), - body: 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: [ - Texts( - 'Order', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - Texts( - 'Prescriptions', - bold: true, - fontSize: 22, - ), - ], - ), - ), - if(patient.patientStatusType == 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - 'Order', - style: "caption2", - color: Colors.black, - fontSize: 13, + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType ?? '0', arrivalType,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: [ + AppText( + 'Order', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Prescriptions', + bold: true, + fontSize: 22, + ), + ], ), - Texts( - 'Prescriptions', - bold: true, - fontSize: 22, + ), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Order', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Prescriptions', + bold: true, + fontSize: 22, + ), + ], ), - ], - ), - ), - if (patientType != null && - patientType == '7' && - patient.patientStatusType == 43) - InkWell( - onTap: () { - addPrescriptionForm( - context, model, patient, model.prescriptionList); - }, - child: Container( - width: double.maxFinite, - height: 140, - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(10), ), - child: Center( - child: Container( - height: 90, - child: Column( - children: [ - Container( - height: 40, - width: 40, - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: BorderRadius.circular(10), - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + AddNewOrder( + onTap: () { + addPrescriptionForm(context, model, patient, + model.prescriptionList); + }, + label: 'Apply for New Prescriptions Order', + ), + ...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: + DateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index] + .appointmentDate, ), - SizedBox( - height: 10, - ), - Texts( - 'Apply for New Prescriptions Order', - color: Colors.grey[600], - fontWeight: FontWeight.w600, - ) - ], - ), + ))), + if (model.prescriptionsList.isEmpty && + patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Prescriptions Found'), + ) + ], ), - ), - ), - ), - ...List.generate( - model.prescriptionsList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: - model.prescriptionsList[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ) + ], + ), + ) + : FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + // SizedBox( + // height: 12, + // ), + + ...List.generate( + model.inPatientPrescription.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: model + .inPatientPrescription[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: DateUtils + .getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .startDatetime, + ), + stopOn: DateUtils + .getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .stopDatetime, + ), + ), + ), ), + child: InPatientDoctorCard( + doctorName: model.inPatientPrescription[index] + .itemDescription, + profileUrl: 'sss', + branch: 'hamza', + clinic: 'basheer', + isPrescriptions: true, + appointmentDate: + DateUtils.getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .prescriptionDatetime, ), + createdBy: model.inPatientPrescription[index] + .createdByName, + ))), + if (model.inPatientPrescription.length == 0) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, ), - 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: - DateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index].appointmentDate, - ), - ))), - if(model.prescriptionsList.isEmpty && patient.patientStatusType != 43) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts('No Lab Result Found'), - ) - - ], - ), - ) - ], - ), - ), - )); + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + 'No Prescriptions Found In Patentiss'), + ) + ], + ), + ) + ], + ), + ))); } } diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 7c1bc88e..378909ad 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -1,5 +1,4 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/client/base_app_client.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/get_medication_response_model.dart'; @@ -12,10 +11,9 @@ 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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/network_base_view.dart'; import 'package:flutter/cupertino.dart'; @@ -204,7 +202,7 @@ class _UpdatePrescriptionFormState extends State { // itemBuilder: (context, // suggestion) => // new Padding( - // child: Texts(suggestion + // child: AppText(suggestion // .description + // '/' + // suggestion.genericName), @@ -666,7 +664,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: Helpers .textFieldSelectorDecoration( - Helpers.getDateFormatted( + DateUtils.getDateFormatted( DateTime.parse( widget.startDate)), selectedDate != null @@ -1005,7 +1003,7 @@ class _UpdatePrescriptionFormState extends State { updatePrescriptionReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('Medication has been updated'); } diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 2f3718a3..5b882c94 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -1,9 +1,10 @@ +//import 'package:doctor_app_flutter/client/base_app_client.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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; @@ -13,18 +14,22 @@ class ProcedureCard extends StatelessWidget { final EntityList entityList; final String categoryName; final int categoryID; + final PatiantInformtion patient; + final String doctorName; - const ProcedureCard( - {Key key, - this.onTap, - this.entityList, - this.categoryID, - this.categoryName}) - : super(key: key); - + const ProcedureCard({ + Key key, + this.onTap, + this.entityList, + this.categoryID, + this.categoryName, + this.patient, + this.doctorName, + }) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + return Container( width: double.maxFinite, height: MediaQuery.of(context).size.height * .22, @@ -47,7 +52,7 @@ class ProcedureCard extends StatelessWidget { bottomLeft: Radius.circular(10), ), color: - entityList.orderType == 1 ? Colors.red[500] : Colors.black, + entityList.orderType == 0 ? Colors.black : Colors.red[500], ), ), Expanded( @@ -66,7 +71,7 @@ class ProcedureCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( entityList.orderType == 0 ? 'Routine' : 'Urgent', @@ -78,7 +83,7 @@ class ProcedureCard extends StatelessWidget { SizedBox( height: 5, ), - Texts( + AppText( entityList.procedureName, bold: true, fontSize: 14, @@ -93,13 +98,13 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, children: [ - Texts( + AppText( '${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), - Texts( + AppText( '${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}', fontWeight: FontWeight.w600, color: Colors.grey[700], @@ -111,13 +116,13 @@ class ProcedureCard extends StatelessWidget { ), Row( children: [ - Texts( + AppText( TranslationBase.of(context).orderNo, //color: Colors.grey, fontSize: 12, color: Colors.grey, ), - Texts( + AppText( entityList.orderNo.toString(), fontSize: 12, bold: true, @@ -126,13 +131,13 @@ class ProcedureCard extends StatelessWidget { ), Row( children: [ - Texts( + AppText( TranslationBase.of(context).doctorName + ": ", //color: Colors.grey, fontSize: 12, color: Colors.grey, ), - Texts( + AppText( entityList.doctorName.toString(), fontSize: 12, bold: true, @@ -141,28 +146,50 @@ class ProcedureCard extends StatelessWidget { ), Row( children: [ - Texts( + AppText( TranslationBase.of(context).clinic + ": ", //color: Colors.grey, fontSize: 12, color: Colors.grey, ), - Texts( + AppText( entityList.clinicDescription ?? "", bold: true, fontSize: 12, ), ], ), + /*Container( + alignment: Alignment.centerRight, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: entityList.procedureName, + patient: patient, + ), + ), + ); + }, + child: AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, + ), + ), + ),*/ // Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ - // Texts( + // AppText( // entityList.remarks.toString() ?? '', // fontSize: 12, // ), // if (entityList.categoryID == 2 || - // entityList.categoryID == 4) + // entityList.categoryID == 4 && + // doctorName == entityList.doctorName) // InkWell( // child: Icon(DoctorApp.edit), // onTap: onTap, diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 8fe7deea..7cc9818b 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/client/base_app_client.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/procedure/ControlsModel.dart'; @@ -9,13 +8,14 @@ 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/screens/base/base_view.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_buttons_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/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:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; @@ -75,22 +75,22 @@ postProcedure( await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { - helpers.showErrorToast( + Helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); } } } else { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } @@ -127,6 +127,7 @@ class _AddSelectedProcedureState extends State { TextEditingController remarksController = TextEditingController(); List entityList = List(); List entityListProcedure = List(); + TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -140,7 +141,7 @@ class _AddSelectedProcedureState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getCategory(), + //onModelReady: (model) => model.getCategory(), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -160,136 +161,197 @@ class _AddSelectedProcedureState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + 'Please Enter Procedure', + 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, + ), Row( children: [ - AppText( - 'Please Select Category', - fontWeight: FontWeight.w700, - fontSize: 20, + Container( + width: MediaQuery.of(context).size.width * 0.85, + child: AppTextFieldCustom( + hintText: 'Search Procedure here...', + isTextFieldHasSuffix: false, + + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + // onSubmitted: (_) { + // model.getProcedureCategory( + // categoryName: procedureName.text); + // }, + onClick: () { + if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + model.getProcedureCategory( + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast('At least three Characters'); + }, + ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.29, + width: MediaQuery.of(context).size.width * 0.02, ), InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), onTap: () { - Navigator.pop(context); + if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + model.getProcedureCategory( + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast('At least three Characters'); }, + child: Icon( + Icons.search, + size: 25.0, + ), ), ], ), - SizedBox( - height: 10.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: selectedCategory[ - 'categoryName'], - categoryID: selectedCategory[ - 'categoryId'] <= - 9 - ? "0" + - selectedCategory[ - 'categoryId'] - .toString() - : selectedCategory[ - 'categoryId'] - .toString()); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - //model.getProcedureCategory(); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .procedureCategorise, - selectedCategory != null - ? selectedCategory['categoryName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - if (widget.model.categoriesList.length != 0) + // SizedBox( + // width: MediaQuery.of(context).size.width * 0.29, + // ), + // InkWell( + // child: Icon( + // Icons.close, + // size: 24.0, + // ), + // onTap: () { + // Navigator.pop(context); + // }, + // ), + // ], + // ), + // SizedBox( + // height: 10.0, + // ), + // Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: model.categoryList != null && + // model.categoryList.length > 0 + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: model.categoryList, + // attributeName: 'categoryName', + // attributeValueId: 'categoryId', + // okText: TranslationBase.of(context).ok, + // okFunction: (selectedValue) { + // setState(() { + // selectedCategory = selectedValue; + // model.getProcedureCategory( + // categoryName: selectedCategory[ + // 'categoryName'], + // categoryID: selectedCategory[ + // 'categoryId'] <= + // 9 + // ? "0" + + // selectedCategory[ + // 'categoryId'] + // .toString() + // : selectedCategory[ + // 'categoryId'] + // .toString()); + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + // //model.getProcedureCategory(); + // } + // : null, + // child: TextField( + // decoration: textFieldSelectorDecoration( + // TranslationBase.of(context) + // .procedureCategorise, + // selectedCategory != null + // ? selectedCategory['categoryName'] + // : null, + // true, + // suffixIcon: Icon( + // Icons.search, + // color: Colors.black, + // )), + // enabled: false, + // ), + // ), + // ), + if (procedureName.text.isNotEmpty && + model.procedureList.length != 0) NetworkBaseView( baseViewModel: model, - child: selectedCategory != null - ? selectedCategory['categoryId'] == 02 || - selectedCategory['categoryId'] == 03 - ? EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget.model - .categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ) - : ProcedureListWidget( - model: widget.model, - masterList: widget.model - .categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ) - : null), + child: + // selectedCategory != null + // ? selectedCategory['categoryId'] == 02 || + // selectedCategory['categoryId'] == 03 + // ? + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ) + // : ProcedureListWidget( + // model: widget.model, + // masterList: widget.model + // .categoriesList[0].entityList, + // removeHistory: (item) { + // setState(() { + // entityList.remove(item); + // }); + // }, + // addHistory: (history) { + // setState(() { + // entityList.add(history); + // }); + // }, + // addSelectedHistories: () { + // //TODO build your fun herr + // // widget.addSelectedHistories(); + // }, + // isEntityListSelected: (master) => + // isEntityListSelected(master), + // ) + // : null, + ), SizedBox( height: 15.0, ), diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 29f01858..b7bc2835 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/client/base_app_client.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/procedure/ControlsModel.dart'; @@ -9,17 +8,14 @@ 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/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/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/util/helpers.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/dailog-list-select.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:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -import 'entity_list_procedure_widget.dart'; valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { @@ -75,22 +71,22 @@ postProcedure( await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getLabs(patient); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getLabs(patient); } else if (model.state == ViewState.Idle) { - helpers.showErrorToast( + Helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); } } } else { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 9e614d44..4c1c8468 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/client/base_app_client.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/procedure/ControlsModel.dart'; @@ -9,17 +8,14 @@ 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/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/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/util/helpers.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/dailog-list-select.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:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -import 'entity_list_procedure_widget.dart'; valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { @@ -75,22 +71,22 @@ postProcedure( await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } } else { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getPatientRadOrders(patient); } else if (model.state == ViewState.Idle) { - helpers.showErrorToast( + Helpers.showErrorToast( model.valadteProcedureList[0].entityList[0].warringMessages); } } } else { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); } } diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 0ca2e360..801c730c 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,12 +1,7 @@ -import 'dart:ffi'; - -import 'package:doctor_app_flutter/core/enum/viewstate.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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -120,7 +115,7 @@ class _EntityListCheckboxSearchWidgetState child: Padding( padding: const EdgeInsets.symmetric( horizontal: 10, vertical: 0), - child: Texts( + child: AppText( historyInfo.procedureName, fontSize: 14.0, variant: "bodyText", @@ -231,8 +226,7 @@ class _EntityListCheckboxSearchWidgetState ) : Center( child: Container( - child: AppText( - "There's no procedures for this category", + child: AppText("Sorry , No Match", color: Color(0xFFB9382C)), ), ) diff --git a/lib/screens/procedures/entity_list_procedure_widget.dart b/lib/screens/procedures/entity_list_procedure_widget.dart index 2f5c6ea2..125262e4 100644 --- a/lib/screens/procedures/entity_list_procedure_widget.dart +++ b/lib/screens/procedures/entity_list_procedure_widget.dart @@ -1,10 +1,7 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -67,7 +64,7 @@ class _ProcedureListWidgetState extends State { NetworkBaseView( baseViewModel: widget.model, child: Container( - height: MediaQuery.of(context).size.height * 0.55, + height: MediaQuery.of(context).size.height * 0.75, child: Center( child: Container( margin: EdgeInsets.only(top: 15), @@ -112,7 +109,7 @@ class _ProcedureListWidgetState extends State { child: Padding( padding: const EdgeInsets.symmetric( horizontal: 10, vertical: 0), - child: Texts( + child: AppText( historyInfo.procedureName, variant: "bodyText", bold: true, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 1e6d55a8..51122999 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -1,40 +1,46 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; +//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/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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.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/profile/patient-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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:flutter/material.dart'; import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { + String doctorNameP; + + void initState() async { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + doctorNameP = doctorProfile.doctorName; + } + @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']; return BaseView( onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType), + model.getProcedure(mrn: patient.patientId, patientType: patientType,), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType), + patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( @@ -50,13 +56,13 @@ class ProcedureScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( 'Order Test or', style: "caption2", color: Colors.black, fontSize: 13, ), - Texts( + AppText( 'Procedure', bold: true, fontSize: 22, @@ -64,19 +70,20 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( 'Order Test or', style: "caption2", color: Colors.black, fontSize: 13, ), - Texts( + AppText( 'Procedure', bold: true, fontSize: 22, @@ -84,8 +91,7 @@ class ProcedureScreen extends StatelessWidget { ], ), ), - if (patientType != null && - patientType == '7' && + if (patient.patientStatusType != null && patient.patientStatusType == 43) InkWell( onTap: () { @@ -128,7 +134,7 @@ class ProcedureScreen extends StatelessWidget { SizedBox( height: 10, ), - Texts( + AppText( 'Add More Procedure', color: Colors.grey[600], fontWeight: FontWeight.w600, @@ -170,29 +176,15 @@ class ProcedureScreen extends StatelessWidget { limetNo: model.procedureList[0].entityList[index] .lineItemNo); // } else - // helpers.showErrorToast( + // Helpers.showErrorToast( // 'You Cant Update This Procedure'); }, + patient: patient, + doctorName: doctorNameP, ), ), - if (model.procedureList.length != 0 && - patient.patientStatusType != 43) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts('No Procedure Found'), - ) - ], - ), - ), - if (model.state == ViewState.ErrorLocal) + if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) + Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -203,7 +195,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: Texts(model.error), + child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '), ) ], ), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index d9c6a20a..6190e92e 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/client/base_app_client.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/procedure/ControlsModel.dart'; @@ -7,15 +6,12 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request 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/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; -import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_widget.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_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -410,7 +406,7 @@ class _UpdateProcedureWidgetState extends State { mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + Helpers.showErrorToast(model.error); model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been updated'); diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart deleted file mode 100644 index 1e9e2459..00000000 --- a/lib/screens/profile_screen.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:flutter/material.dart'; - -import '../config/size_config.dart'; -import '../widgets/shared/app_scaffold_widget.dart'; -import '../widgets/shared/drawer_item_widget.dart'; -import '../widgets/shared/profile_image_widget.dart'; -import '../widgets/shared/rounded_container_widget.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; - -class ProfileScreen extends StatefulWidget { - ProfileScreen({Key key, this.title, this.doctorProfileall}) : super(key: key); - - final String title; - DoctorProfileModel doctorProfileall; - - @override - _ProfileScreenState createState() => _ProfileScreenState(); -} - -class _ProfileScreenState extends State { -//************************** - DoctorProfileModel doctorProfile; - //AppDrawer dr; -//****************** - @override - Widget build(BuildContext context) { - Map arg = ModalRoute.of(context).settings.arguments - as Map; //ModalRoute.of(context).settings.arguments; - doctorProfile = arg['doctorProfileall']; - print("******************"); - //print(doctorProfile.doctorName); - print("******************"); - return AppScaffold( - appBarTitle: TranslationBase.of(context).profile, - body: ListView(padding: EdgeInsets.zero, children: [ - Container( - height: MediaQuery.of(context).size.height * - 0.35, //SizeConfig.heightMultiplier * 35, - - child: Container( - child: DrawerHeader( - child: Container( - child: ProfileImageWidget( - url: doctorProfile.doctorImageURL, - //"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", - name: doctorProfile.doctorName, //"Dr. Chris evans", - des: doctorProfile - .clinicDescription //"Director of medical records", - ), - ), - ), - ), - ), - RoundedContainer( - child: ListView( - children: [ - DrawerItem( - TranslationBase.of(context).gender, - icon: Icons.person_pin, - color: Colors.black, - subTitle: doctorProfile.genderDescription //"Male" - , - ), - DrawerItem(TranslationBase.of(context).clinic, icon: Icons.build, - color: Colors.black, - subTitle: - doctorProfile.clinicDescription //"Neurology Clinic", - ), - DrawerItem( - TranslationBase.of(context).hospital, - icon: Icons.local_hospital, - color: Colors.black, - subTitle: doctorProfile.projectName, //"Al-Takkassussi", - ), - DrawerItem( - TranslationBase.of(context).speciality, - icon: Icons.crop_square, - color: Colors.black, - subTitle: doctorProfile.doctorRate == 0 - ? TranslationBase.of(context).beingBad - : TranslationBase.of(context).beingGreat, - ), - ], - ), - width: SizeConfig.screenWidth * 0.70, - height: SizeConfig.screenHeight * 0.40, - ), - ])); - } -} diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index bd753080..c7c52745 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -3,16 +3,16 @@ 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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.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/add-order/addNewOrder.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_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; class AddRescheduleLeavScreen extends StatelessWidget { ProjectViewModel projectsProvider; @@ -28,47 +28,12 @@ class AddRescheduleLeavScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: SingleChildScrollView( child: Column(children: [ - Container( - width: MediaQuery.of(context).size.width, - margin: EdgeInsets.all(10), - padding: - EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), - decoration: BoxDecoration( - color: HexColor('#EAEAEA'), - borderRadius: BorderRadius.all(Radius.circular(20))), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(10)), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - color: Colors.white, - ), - onPressed: () { - openLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context).applyForReschedule, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 18, - color: HexColor('#7E7E7E')), - padding: EdgeInsets.all(10), - ), - ], - ), - ), + AddNewOrder( onTap: () { + openLeave( + context, + false, + ); + },label: TranslationBase.of(context).applyForReschedule,), Column( children: model.getReschduleLeave .map((GetRescheduleLeavesResponse item) { diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e2959c75..dc3d0adf 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -5,28 +5,23 @@ 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/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; -import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.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/text_validator.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_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:dropdown_search/dropdown_search.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; -import 'package:dropdown_search/dropdown_search.dart'; Helpers helpers = Helpers(); @@ -881,7 +876,7 @@ class _RescheduleLeaveScreen extends State { ), // Column( // children: [ - // Texts(TranslationBase.of(context) + // AppText(TranslationBase.of(context) // .previousSickLeaveIssue + // ' ') // ], diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart deleted file mode 100644 index 16d53831..00000000 --- a/lib/screens/settings/settings_screen.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.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/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; -class SettingsScreen extends StatelessWidget { - - ProjectViewModel projectsProvider; - @override - Widget build(BuildContext context) { - projectsProvider = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).settings.toUpperCase(), - body: ListView( - children: [ - AppText(TranslationBase.of(context).language.toUpperCase(),fontSize: 18,margin: 5,fontWeight: FontWeight.bold,), - Container( - margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey[600],width: 2.0), - borderRadius: BorderRadius.circular(8.0) - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(7.0), - child: Row( - children: [ - Expanded( - child: InkWell( - onTap: () { projectsProvider.changeLanguage('en'); }, - child: AnimatedContainer( - duration: Duration(milliseconds: 350), - decoration: BoxDecoration( - color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent, - border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) - ), - child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500])) - ), - ), - ), - Expanded( - child: InkWell( - onTap: (){projectsProvider.changeLanguage('ar');}, - child: AnimatedContainer( - duration: Duration(milliseconds: 350), - decoration: BoxDecoration( - color: projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent, - border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) - ), - child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],)) - ), - ), - ) - ], - ), - ), - ) - ], - ), - ); - } -} \ No newline at end of file diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 45088b8d..6ee37745 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,22 +1,15 @@ 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/core/model/sick_leave_patient_model.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/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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-page-header-widget.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/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -28,8 +21,10 @@ class AddSickLeavScreen extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => model.getSickLeave(patient.patientMRN), + onModelReady: (model) => + model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -38,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget { patient, routeArgs['patientType'] ?? "0", routeArgs['arrivalType'] ?? "0", + isInpatient: isInpatient, ), body: SingleChildScrollView( child: Column(children: [ @@ -109,136 +105,150 @@ class AddSickLeavScreen extends StatelessWidget { ], ) : SizedBox(), - model.getAllSIckLeave.length > 0 + model.getAllSIckLeavePatient.length > 0 ? Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { + children: model.getAllSIckLeavePatient + .map((SickLeavePatientModel item) { return RoundedContainer( + margin: EdgeInsets.all(10), child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + children: [ + Container( + // decoration: BoxDecoration( + // border: Border( + // left: BorderSide( + // // color: item.status == 1 + // // ? Colors.yellow[800] + // // : item.status == 2 + // // ? Colors.green + // // : Colors.black, + // color: Colors.red, + // width: 5.0, + // ))), + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .hold - : item.status == 2 - ? TranslationBase.of( - context) - .active - : TranslationBase.of( - context) - .all, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - ), - ), - Row( - children: [ - AppText(TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays.toString(), - fontWeight: FontWeight.bold, + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.doctorName, + // item.status == 1 + // ? TranslationBase.of( + // context) + // .hold + // : item.status == 2 + // ? TranslationBase + // .of( + // context) + // .active + // : TranslationBase + // .of(context) + // .all, + fontWeight: + FontWeight.bold, + // color: item.status == 1 + // ? Colors.yellow[800] + // : item.status == 2 + // ? Colors.green + // : Colors.black, + color: Colors.red, + ), ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .startDate + - ' ', + Row( + children: [ + AppText(TranslationBase + .of(context) + .daysSickleave + + ": "), + AppText( + item.sickLeaveDays + .toString(), + fontWeight: + FontWeight.bold, + ), + ], ), - Flexible( - child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: FontWeight.bold, - )) - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ + Row( + children: [ + AppText( + TranslationBase.of( + context) + .startDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils.getDayMonthYearDateFormatted(DateUtils + .convertStringToDate( + item.startDate)), + fontWeight: + FontWeight.bold, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .endDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils.getDayMonthYearDateFormatted(DateUtils + .convertStringToDate( + item.endDate, + )), + fontWeight: + FontWeight.bold, + ), + ) + ], + ), + Row(children: [ + AppText(TranslationBase.of( + context) + .branch + + ": "), AppText( - item.remarks ?? "", + item.projectName ?? "", ), - // (item.status == 1 || - // item.status == 2) - // ? IconButton( - // icon: Image.asset( - // 'assets/images/edit.png'), - // - // // color: Colors.green, //Colors.black, - // onPressed: () => { - // if (item.status == - // 1) - // { - // DrAppToastMsg.showErrorToast( - // TranslationBase.of( - // context) - // .sickleaveonhold) - // } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - // }, - // ) - // : SizedBox() ]), + Row(children: [ + AppText(TranslationBase.of( + context) + .clinic + + ": "), + AppText( + item.clinicName ?? "", + ), + ]), + ], + ), + SizedBox( + width: 20, + ), ], ), - SizedBox( - width: 20, - ), - ], - ), - ), - ], - )), - ], - )); + ), + ], + )), + ], + )); }).toList(), ) : patient.patientStatusType != 43 @@ -252,7 +262,8 @@ class AddSickLeavScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('No Sick Leave Found'), + child: AppText( + TranslationBase.of(context).noSickLeave), ) ], ), diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 6085dc19..31f186f1 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -1,23 +1,15 @@ -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/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/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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-page-header-widget.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/patient-profile-header-new-design.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_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class ShowSickLeaveScreen extends StatelessWidget { PatiantInformtion patient; @@ -32,6 +24,7 @@ class ShowSickLeaveScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, + backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( patient, routeArgs['patientType'] ?? "0", @@ -42,132 +35,162 @@ class ShowSickLeaveScreen extends StatelessWidget { children: [ // PatientProfileHeaderNewDesign( // patient, routeArgs['patientType'], routeArgs['arrivalType']), - Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { - return RoundedContainer( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + model.getAllSIckLeave.length > 0 + ? Column( + children: model.getAllSIckLeave + .map((GetAllSickLeaveResponse item) { + return RoundedContainer( + margin: EdgeInsets.all(10), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of(context) - .hold - : item.status == 2 - ? TranslationBase.of( - context) - .active - : TranslationBase.of( - context) - .all, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.status == 1 + ? TranslationBase.of( + context) + .hold + : item.status == 2 + ? TranslationBase + .of( + context) + .active + : TranslationBase + .of(context) + .all, + fontWeight: + FontWeight.bold, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + ), + ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .daysSickleave), + AppText( + item.noOfDays + .toString(), + fontWeight: + FontWeight.bold, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .startDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, + )) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + + // color: Colors.green, //Colors.black, + onPressed: () => + { + if (item.status == + 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), + ], + ), + SizedBox( + width: 20, + ), + ], ), ), - Row( - children: [ - AppText(TranslationBase.of(context) - .daysSickleave), - AppText( - item.noOfDays.toString(), - fontWeight: FontWeight.bold, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .startDate + - ' ', - ), - Flexible( - child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: FontWeight.bold, - )) - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - item.remarks ?? "", - ), - (item.status == 1) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), - - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .sickleaveonhold) - } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - }, - ) - : SizedBox() - ]), ], - ), - SizedBox( - width: 20, - ), - ], - ), - ), - ], - )), - ], - )); - }).toList(), - ) + )), + ], + )); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + TranslationBase.of(context).noSickLeave), + ) + ], + ), + ) ], ), ), diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 0e1a8491..199a7c82 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -4,26 +4,21 @@ 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/core/viewModel/sick_leave_view_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/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.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/text_validator.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_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/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; -import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; Helpers helpers = Helpers(); @@ -425,7 +420,7 @@ class _SickLeaveScreenState extends State { ), // Column( // children: [ - // Texts(TranslationBase.of(context) + // AppText(TranslationBase.of(context) // .previousSickLeaveIssue + // ' ') // ], diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index d55675c3..cd92f71b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -32,7 +32,7 @@ class DateUtils { const start = "/Date("; const end = "+0300)"; - + if(str.contains("/Date")){ final startIndex = str.indexOf(start); final endIndex = str.indexOf(end, startIndex + start.length); @@ -40,7 +40,11 @@ class DateUtils { date = new DateTime.fromMillisecondsSinceEpoch( int.parse(str.substring(startIndex + start.length, endIndex))); } else { - date = DateTime.now(); + date = DateTime.now(); + } + + } else { + date = DateTime.parse(str); } return date; @@ -235,16 +239,15 @@ class DateUtils { static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ + if (date != null) { const start = "/Date("; const end = "+0300)"; final startIndex = date.indexOf(start); final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); + DateTime newDate = DateTime.fromMillisecondsSinceEpoch( + int.parse(date.substring(startIndex + start.length, endIndex),),); + return newDate; } else return DateTime.now(); } @@ -287,6 +290,15 @@ class DateUtils { return ""; } + /// get data formatted like 26/4/2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDate(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return dateTime.day.toString()+"/"+ "${dateTime.month}"+ "/" + dateTime.year.toString(); + else + return ""; + } + /// get data formatted like 10:45 PM /// [dateTime] convert DateTime to data formatted static String getHour(DateTime dateTime) { @@ -320,4 +332,52 @@ class DateUtils { return false; } + + static String getDate(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + "," + + dateTime.year.toString(); + else + return ""; + } + + static String getDateFormatted(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return dateTime.day.toString() + + "/" + + dateTime.month.toString() + + "/" + + dateTime.year.toString(); + else + return ""; + } + + static String getTimeHHMMA(DateTime dateTime){ + return DateFormat('hh:mm a').format(dateTime); + } + + static String getTimeHHMMA2 (DateTime dateTime){ + return DateFormat('hh:mm').format(dateTime); + } + + static String getStartTime(String dateTime){ + String time=dateTime; + + if(dateTime.length>7) + time = dateTime.substring(0,5); + return time; + } + + static String getTimeFormated(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return dateTime.hour.toString() + ":" + dateTime.minute.toString(); + else + return ""; + } } diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index 2f6f3232..bac296bf 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -92,7 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - prefs.clear(); + var vvas= await prefs.clear(); + var asd; } remove(String key) async { diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index bf91a11f..1f2ebe8f 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -33,7 +33,7 @@ class DrAppToastMsg { textColor: Colors.white); } - void showShortToast(msg) { + static void showShortToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, @@ -50,7 +50,7 @@ class DrAppToastMsg { timeInSeconds: 1); } - void showCenterShortToast(msg) { + static void showCenterShortToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, @@ -59,7 +59,7 @@ class DrAppToastMsg { timeInSeconds: 1); } - void showCenterShortLoadingToast(msg) { + static void showCenterShortLoadingToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_LONG, @@ -68,11 +68,11 @@ class DrAppToastMsg { radius: 20, elevation: 10, textColor: Colors.white, - backgroundColor: Colors.black, + timeInSeconds: 2); } - void cancelToast(msg) { + static void cancelToast(msg) { FlutterFlexibleToast.cancel(); } } diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart index 1c79f01c..26e49670 100644 --- a/lib/util/extenstions.dart +++ b/lib/util/extenstions.dart @@ -1,7 +1,3 @@ -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Extension for all classes objects. - extension Extension on Object { bool isNullOrEmpty() => this == null || this == ''; diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 6a57bcfa..13b7b2ae 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,44 +1,26 @@ +import 'package:connectivity/connectivity.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/list_doctor_working_hours_table_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.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/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:html/parser.dart'; import '../UpdatePage.dart'; import '../config/size_config.dart'; import '../util/dr_app_toast_msg.dart'; - -import 'package:connectivity/connectivity.dart'; import 'dr_app_shared_pref.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: - *@return: - *@desc: This class will contian some Function will help developer - */ class Helpers { - int cupertinoPickerIndex = 0; + static int cupertinoPickerIndex = 0; get currentLanguage => null; - -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: context, items, decKey, onSelectFun - *@return: Container Widget - *@desc: showCupertinoPicker its a general function to show cupertino picker - */ - showCupertinoPicker(context, items, decKey, onSelectFun) { + static showCupertinoPicker(context, items, decKey, onSelectFun) { showModalBottomSheet( isDismissible: false, context: context, @@ -86,23 +68,14 @@ class Helpers { }); } - TextStyle textStyle(context) => + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: context, List items, decKey, onSelectFun - *@return: Container widget - *@desc: buildPickerIterm this function will build the items of the cupertino - */ - buildPickerItems(context, List items, decKey, onSelectFun) { + static buildPickerItems(context, List items, decKey, onSelectFun) { return CupertinoPicker( magnification: 1.5, scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), - - // backgroundColor: Colors.black87, children: items.map((item) { return Text( '${item["$decKey"]}', @@ -111,23 +84,14 @@ class Helpers { }).toList(), itemExtent: 25, - //height of each item looping: false, onSelectedItemChanged: (int index) { - // selectitem =index; cupertinoPickerIndex = index; }, ); } -/* - *@author: Elham Rababah - *@Date:12/4/2020 - *@param: msg - *@return: - *@desc: showErrorToast -*/ - showErrorToast([msg = null]) { + static showErrorToast([msg = null]) { String localMsg = generateContactAdminMsg(); if (msg != null) { @@ -136,14 +100,6 @@ class Helpers { DrAppToastMsg.showErrorToast(localMsg); } - -/* - *@author: Mohammad Aljammal - *@Date:27/4/2020 - *@param: - *@return: Boolean - *@desc: Check The Internet Connection - */ static Future checkConnection() async { ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); @@ -155,172 +111,6 @@ class Helpers { } } - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: date in String formatted - *@return: DateTime - *@desc: convert String to DateTime - */ - static DateTime convertStringToDate(String date) { - const start = "/Date("; - const end = "+0300)"; - final startIndex = date.indexOf(start); - final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); - } - - /* - *@author: Amjad Amireh - *@Date:5/5/2020 - *@param: checkDate - *@return: DateTime - *@desc: convert String to DateTime - */ - static String checkDate(String dateString) { - DateTime checkedTime = DateTime.parse(dateString); - DateTime currentTime = DateTime.now(); - - if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month) && - (currentTime.day == checkedTime.day)) { - return "Today"; - } else if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month)) { - if ((currentTime.day - checkedTime.day) == 1) { - return "YESTERDAY"; - } else if ((currentTime.day - checkedTime.day) == -1) { - return "Tomorrow"; - } - - if ((currentTime.day - checkedTime.day) <= -2) { - return "Next Week"; - } else { - return "Old Date"; - } - } - return "Old Date"; - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: month in int formatted - *@return: DateTime - *@desc: convert month in int to month name - */ - static getMonth(int month) { - switch (month) { - case 1: - return "Jan"; - case 2: - return "Feb"; - case 3: - return "Mar"; - case 4: - return "Apr"; - case 5: - return "May"; - case 6: - return "Jun"; - case 7: - return "Jul"; - case 8: - return "Aug"; - case 9: - return "Sep"; - case 10: - return "Oct"; - case 11: - return "Nov"; - case 12: - return "Dec"; - } - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: week day in int formatted - *@return: DateTime - *@desc: convert week day in int to week day name - */ - static getWeekDay(int weekDay) { - switch (weekDay) { - case 1: - return "Monday"; - case 2: - return "Tuesday"; - case 3: - return "Wednesday"; - case 4: - return "Thursday"; - case 5: - return "Friday"; - case 6: - return "Saturday "; - case 7: - return "Sunday"; - } - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: DateTime - *@return: data formatted like Apr 26,2020 - *@desc: convert DateTime to data formatted - */ - static String getDate(DateTime dateTime) { - print(dateTime); - if (dateTime != null) - return getMonth(dateTime.month) + - " " + - dateTime.day.toString() + - "," + - dateTime.year.toString(); - else - return ""; - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: DateTime - *@return: data formatted like 26/4/2020 - *@desc: convert DateTime to data formatted - */ - static String getDateFormatted(DateTime dateTime) { - print(dateTime); - if (dateTime != null) - return dateTime.day.toString() + - "/" + - dateTime.month.toString() + - "/" + - dateTime.year.toString(); - else - return ""; - } - - static String getTimeFormated(DateTime dateTime) { - print(dateTime); - if (dateTime != null) - return dateTime.hour.toString() + ":" + dateTime.minute.toString(); - else - return ""; - } - - /* - *@author: Mohammad Aljammal - *@Date:26/5/2020 - *@param: String workingHours - *@return: List - *@desc: convert workingHours string to List - */ static List getWorkingHours(String workingHours) { List myWorkingHours = []; List listOfHours = workingHours.split('a'); @@ -337,14 +127,7 @@ class Helpers { return myWorkingHours; } -/* - *@author: Elham Rababah - *@Date:12/5/2020 - *@param: - *@return: String - *@desc: generate Contact Admin Msg - */ - generateContactAdminMsg([err = null]) { + static generateContactAdminMsg([err = null]) { String localMsg = 'Something wrong happened, please contact the admin'; if (err != null) { localMsg = localMsg + '\n \n' + err.toString(); @@ -356,7 +139,7 @@ class Helpers { await sharedPref.clear(); } - logout() async { + static logout() async { DEVICE_TOKEN = ""; String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); @@ -378,7 +161,7 @@ class Helpers { (r) => false); } - String parseHtmlString(String htmlString) { + static String parseHtmlString(String htmlString) { final document = parse(htmlString); final String parsedString = parse(document.body.text).documentElement.text; diff --git a/lib/util/text_validator.dart b/lib/util/text_validator.dart deleted file mode 100644 index 1fe21c9e..00000000 --- a/lib/util/text_validator.dart +++ /dev/null @@ -1,37 +0,0 @@ - import '../util/extenstions.dart'; - - class TextValidator{ - -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Text Validator. - - String validateName(String value) { - if (value.isNullOrEmpty()||value.length < 3) - return 'Name must be more than 2 charater'; - else - return null; - } - - String validateMobile(String value) { - if (value.isNullOrEmpty()||value.length != 10) - return 'Mobile Number must be of 10 digit'; - else - return null; - } - - String validateIdNumber(String value) { - if (value.isNullOrEmpty()) - return 'Please input valid number'; - else - return null; - } - - String validateDate(String value) { - if (value.isNullOrEmpty()) - return 'Please input valid date'; - else - return null; - } - - } \ No newline at end of file diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7c4ac204..6602722c 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,6 +100,9 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; + + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -393,6 +396,9 @@ class TranslationBase { String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String get myOutPatient => + localizedValues['myOutPatient'][locale.languageCode]; + String get logout => localizedValues['logout'][locale.languageCode]; String get pharmaciesList => @@ -567,6 +573,7 @@ class TranslationBase { String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; @@ -1169,8 +1176,9 @@ class TranslationBase { localizedValues['SpecialResult'][locale.languageCode]; String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; @@ -1229,6 +1237,16 @@ class TranslationBase { String get updateNow => localizedValues['updateNow'][locale.languageCode]; String get updateTheApp => localizedValues['updateTheApp'][locale.languageCode]; + String get admissionDate => + localizedValues['admission-date'][locale.languageCode]; + String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; + String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; + String get replayBefore => + localizedValues['replayBefore'][locale.languageCode]; + String get trySaying => localizedValues["try-saying"][locale.languageCode]; + String get acknowledged => + localizedValues['acknowledged'][locale.languageCode]; + String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/auth_header.dart b/lib/widgets/auth/auth_header.dart index 364cfc85..f84e9425 100644 --- a/lib/widgets/auth/auth_header.dart +++ b/lib/widgets/auth/auth_header.dart @@ -1,3 +1,4 @@ +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'; import 'package:flutter/rendering.dart'; @@ -5,7 +6,6 @@ import 'package:hexcolor/hexcolor.dart'; import '../../config/size_config.dart'; import '../../lookups/auth_lookup.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class AuthHeader extends StatelessWidget { var userType; diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index e5c685bd..a2c200cb 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,62 +1,46 @@ -import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:imei_plugin/imei_plugin.dart'; import 'package:provider/provider.dart'; import '../../config/shared_pref_kay.dart'; import '../../config/size_config.dart'; -import '../../models/doctor/user_model.dart'; -import '../../core/viewModel/auth_view_model.dart'; import '../../core/viewModel/hospital_view_model.dart'; -import '../../routes.dart'; +import '../../models/doctor/user_model.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_toast_msg.dart'; import '../../util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppToastMsg toastMsg = DrAppToastMsg(); Helpers helpers = Helpers(); class LoginForm extends StatefulWidget with DrAppToastMsg { - LoginForm({this.changeLoadingStata}); + LoginForm({this.model}); - final Function changeLoadingStata; + final IMEIViewModel model; @override _LoginFormState createState() => _LoginFormState(); } -//TODO recreate the all page and apply the MVVM here + class _LoginFormState extends State { final loginFormKey = GlobalKey(); var projectIdController = TextEditingController(); - String _platformImei = 'Unknown'; - String uniqueId = "Unknown"; var projectsList = []; - bool _isInit = true; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); HospitalViewModel projectsProv; - var userInfo = UserModel( - userID: '', - password: '', - projectID: 15, - languageID: 2, - iPAdress: "11.11.11.11", - versionID: 5.5, - channel: 9, - sessionID: "i1UJwCTSqt"); - - AuthViewModel authProv; + var userInfo = UserModel(); @override void initState() { super.initState(); @@ -64,9 +48,7 @@ class _LoginFormState extends State { @override Widget build(BuildContext context) { - authProv = Provider.of(context); projectsProv = Provider.of(context); - return Form( key: loginFormKey, child: Column( @@ -108,10 +90,7 @@ class _LoginFormState extends State { borderColor: Colors.white, // keyboardType: TextInputType.number, textInputAction: TextInputAction.next, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).enterId, - // 'assets/images/user_id_icon.png'), + validator: (value) { if (value != null && value.isEmpty) { return TranslationBase.of(context) @@ -128,8 +107,6 @@ class _LoginFormState extends State { onFieldSubmitted: (_) { focusPass.nextFocus(); }, - // onEditingComplete: () {}, - // autofocus: false, ) ])), buildSizedBox(), @@ -156,10 +133,6 @@ class _LoginFormState extends State { obscureText: true, borderColor: Colors.white, textInputAction: TextInputAction.next, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).enterPassword, - // 'assets/images/password_icon.png'), validator: (value) { if (value != null && value.isEmpty) { return TranslationBase.of(context) @@ -172,7 +145,7 @@ class _LoginFormState extends State { }, onFieldSubmitted: (_) { focusPass.nextFocus(); - helpers.showCupertinoPicker(context, projectsList, + Helpers.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject); }, onTap: () { @@ -205,18 +178,12 @@ class _LoginFormState extends State { borderColor: Colors.white, suffixIcon: Icons.arrow_drop_down, onTap: () { - helpers.showCupertinoPicker( + Helpers.showCupertinoPicker( context, projectsList, 'facilityName', onSelectProject); }, - // showCursor: false, - // //readOnly: true, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).selectYourProject, - // 'assets/images/password_icon.png'), validator: (value) { if (value != null && value.isEmpty) { return TranslationBase.of(context) @@ -244,18 +211,13 @@ class _LoginFormState extends State { fontSize: 14, )), AppTextFormField( - readOnly: true, borderColor: Colors.white, + readOnly: true, + borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons.arrow_drop_down), iconSize: 30, padding: EdgeInsets.only(bottom: 30), ), - - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context) - // .pleaseEnterYourProject, - // 'assets/images/password_icon.png') ) ])), ]), @@ -264,71 +226,20 @@ class _LoginFormState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( - child: Button( + child: AppButton( title: TranslationBase.of(context).login, color: HexColor('#D02127'), - onTap: () { - login(context, authProv, widget.changeLoadingStata); + fontWeight: FontWeight.bold, + onPressed: () { + login(context, this.widget.model); }, )), ], ) - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // RaisedButton( - // onPressed: () { - // login(context, authProv, widget.changeLoadingStata); - // }, - // textColor: Colors.white, - // elevation: 0.0, - // padding: const EdgeInsets.all(0.0), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10), - // side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))), - // child: Container( - // padding: const EdgeInsets.all(10.0), - // height: 50, - // width: SizeConfig.realScreenWidth * 0.35, - // child: ), - // ) - // ], - // ), ], ), ); - } - -/* - *@author: Elham Rababah - *@Date:20/4/2020 - *@param: context, hint, asset - *@return: InputDecoration - *@desc: decorate input feilds - */ - InputDecoration buildInputDecoration(BuildContext context, hint, asset) { - return InputDecoration( - // prefixIcon: Image.asset(asset), - hintText: hint, - hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), - fillColor: Colors.white, - enabledBorder: OutlineInputBorder( - //borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - // borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).primaryColor), - ), - errorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), - ), - focusedErrorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), - ), - ); + //)); } SizedBox buildSizedBox() { @@ -337,103 +248,27 @@ class _LoginFormState extends State { ); } - login(context, AuthViewModel authProv, Function changeLoadingStata) { - showLoading(); + login( + context, + model, + ) { if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); sharedPref.setInt(PROJECT_ID, userInfo.projectID); - authProv.login(userInfo).then((res) { - //changeLoadingStata(false); - hideLoading(); - if (res['MessageStatus'] == 1) { - // insertDeviceImei(res, authProv); - saveObjToString(LOGGED_IN_USER, res); + model.login(userInfo).then((res) { + if (model.loginInfo['MessageStatus'] == 1) { + saveObjToString(LOGGED_IN_USER, model.loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, res['LogInTokenID']); - print("token" + res['LogInTokenID']); - Navigator.of(context).pushReplacement(MaterialPageRoute( + sharedPref.setString(TOKEN, model.loginInfo['LogInTokenID']); + Navigator.of(AppGlobal.CONTEX).pushReplacement(MaterialPageRoute( builder: (BuildContext context) => VerificationMethodsScreen( password: userInfo.password, ))); - } else { - // handel error - helpers.showErrorToast(res['ErrorEndUserMessage']); } - }).catchError((err) { - //TODO change the logic here - if(!err.contains('eservices.hmg@drsulaimanalhabib.com') ){ - hideLoading(); - changeLoadingStata(false); - helpers.showErrorToast(err);} }); - } else { - changeLoadingStata(false); } } - insertDeviceImei(preRes, AuthViewModel authProv) { - if (_platformImei != 'Unknown') { - var imeiInfo = { - "IMEI": _platformImei, - "LogInType": 1, - "DoctorID": preRes['DoctorID'], - "DoctorName": "Test User", - "Gender": 1, - "ClinicID": 3, - "ProjectID": 15, - "DoctorTitle": "Mr.", - "ClinicName": "MED", - "ProjectName": "", - "DoctorImageURL": "UNKNOWN", - "LogInTokenID": preRes['LogInTokenID'], - "VersionID": 5.5 - }; - authProv.insertDeviceImei(imeiInfo).then((res) { - if (res['MessageStatus'] == 1) { - setSharedPref('platformImei', _platformImei); - saveObjToString(LOGGED_IN_USER, preRes); - - Navigator.of(context).pushReplacement(MaterialPageRoute( - builder: (BuildContext context) => VerificationMethodsScreen( - password: userInfo.password, - ))); - - // save imei on shared preferance - } else { - // handel error - helpers.showErrorToast(res['ErrorEndUserMessage']); - } - }).catchError((err) { - print(err); - helpers.showErrorToast(); - }); - } - } - - // Platform messages are asynchronous, so we initialize in an async method. - Future initPlatformState() async { - String platformImei; - String idunique; - // Platform messages may fail, so we use a try/catch PlatformException. - try { - platformImei = - await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false); - idunique = await ImeiPlugin.getImei(); - } catch (e) { - platformImei = 'Failed to get platform version.'; - } - - // If the widget was removed from the tree while the asynchronous platform - // message was in flight, we want to discard the reply rather than calling - // setState to update our non-existent appearance. - if (!mounted) return; - - setState(() { - _platformImei = platformImei; - uniqueId = idunique; - }); - } - Future setSharedPref(key, value) async { sharedPref.setString(key, value).then((success) { print("sharedPref.setString" + success.toString()); @@ -441,9 +276,7 @@ class _LoginFormState extends State { } getProjectsList(memberID) { - //showLoading(); projectsProv.getProjectsList(memberID).then((res) { - //hideLoading(); if (res['MessageStatus'] == 1) { projectsList = res['ProjectInfo']; setState(() { @@ -452,16 +285,7 @@ class _LoginFormState extends State { }); } else { print(res); - // handel error - // setState(() { - // projectsList = ListProject; - // }); } - }).catchError((err) { - setState(() { - print(err); - }); - print(err); }); } @@ -478,26 +302,11 @@ class _LoginFormState extends State { primaryFocus.unfocus(); } - showLoading() { - showDialog( - context: context, - builder: (BuildContext context) { - return Center( - child: CircularProgressIndicator(), - ); - }); - } - - hideLoading() { - Navigator.pop(context); - } - getProjects(value) { if (value != null && value != '') { if (projectsList.length == 0) { getProjectsList(value); } } - //_isInit = false; } } diff --git a/lib/widgets/auth/show_timer_text.dart b/lib/widgets/auth/show_timer_text.dart index fd09ec25..a418e1b5 100644 --- a/lib/widgets/auth/show_timer_text.dart +++ b/lib/widgets/auth/show_timer_text.dart @@ -96,10 +96,10 @@ class _ShowTimerTextState extends State { if (res['MessageStatus'] == 1) {resendCode()} else - {helpers.showErrorToast(res['ErrorEndUserMessage'])} + {Helpers.showErrorToast(res['ErrorEndUserMessage'])} }) .catchError((err) { - helpers.showErrorToast(); + Helpers.showErrorToast(); }); } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 66a53857..535efcf5 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/auth/check_activation_code_request_mod 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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/auth/show_timer_text.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -17,7 +18,6 @@ import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_toast_msg.dart'; import '../../util/helpers.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -239,13 +239,6 @@ class _VerifyAccountState extends State { }); } -/* - *@author: Elham Rababah - *@Date:19/4/2020 - *@param: - *@return: - *@desc: change the style for the input field - */ TextStyle buildTextStyle() { return TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -260,16 +253,8 @@ class _VerifyAccountState extends State { return null; } -/* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: context - *@return:InputDecoration - *@desc: buildInputDecoration - */ InputDecoration buildInputDecoration(BuildContext context) { return InputDecoration( - // ts/images/password_icon.png contentPadding: EdgeInsets.only(top: 30, bottom: 30), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), @@ -290,13 +275,6 @@ class _VerifyAccountState extends State { ); } -/* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: - *@return: RichText - *@desc: buildText - */ RichText buildText() { String medthodName; switch (model['OTP_SendType']) { @@ -329,13 +307,6 @@ class _VerifyAccountState extends State { ); } -/* - *@author: Elham Rababah - *@Date:15/4/2020 - *@param: authProv - *@return: - *@desc: verify Account func call sendActivationCodeByOtpNotificationType service - */ verifyAccount(AuthViewModel authProv, Function changeLoadingStata) async { if (verifyAccountForm.currentState.validate()) { changeLoadingStata(true); @@ -346,23 +317,6 @@ class _VerifyAccountState extends State { verifyAccountFormValue['digit3'] + verifyAccountFormValue['digit4']; - int projectID = await sharedPref.getInt(PROJECT_ID); - - Map model = { - "activationCode": activationCode, - "DoctorID": _loggedUser['DoctorID'], - "LogInTokenID": _loggedUser['LogInTokenID'], - "ProjectID": projectID, - "LanguageID": 2, - "stamp": "2020-02-26T14:48:27.221Z", - "IPAdress": "11.11.11.11", - "VersionID": 5.5, - "Channel": 9, - "TokenID": "", - "SessionID": "i1UJwCTSqt", - "IsLoginForDoctorApp": true, - "IsSilentLogIN": false - }; CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( zipCode: _loggedUser['ZipCode'], @@ -387,22 +341,15 @@ class _VerifyAccountState extends State { } } else { changeLoadingStata(false); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { changeLoadingStata(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } } - /* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: Map profile, Function changeLoadingStata - *@return: - *@desc: loginProcessCompleted - */ loginProcessCompleted( Map profile, Function changeLoadingStata) { var doctor = DoctorProfileModel.fromJson(profile); @@ -412,43 +359,10 @@ class _VerifyAccountState extends State { } getDashboard(doctor, Function changeLoadingStata) { - // authProv.getDashboard(doctor).then((value) { - // print(value); changeLoadingStata(false); - // sharedPref.setObj(DASHBOARD_DATA, value); Navigator.of(context).pushReplacementNamed(HOME); - // }); - } - - Future _asyncSimpleDialog( - BuildContext context, List list, String txtKey, - [String text = '']) async { - return await showDialog( - context: context, - barrierDismissible: true, - builder: (BuildContext context) { - return SimpleDialog( - title: Text(text), - children: list.map((value) { - return SimpleDialogOption( - onPressed: () { - Navigator.pop(context, - value); //here passing the index to be return on item selection - }, - child: Text(value[txtKey]), //item value - ); - }).toList(), - ); - }); } - /* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: ClinicModel clinicInfo, Function changeLoadingStata - *@return: - *@desc: getDocProfiles - */ getDocProfiles(ClinicModel clinicInfo, Function changeLoadingStata) { ProfileReqModel docInfo = new ProfileReqModel( doctorID: clinicInfo.doctorID, @@ -462,11 +376,11 @@ class _VerifyAccountState extends State { loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); } else { changeLoadingStata(false); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { changeLoadingStata(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } } diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index b4d39894..48d93f54 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -9,12 +9,12 @@ import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.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/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/otp/sms-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -111,7 +111,7 @@ class _VerificationMethodsState extends State { return DrAppCircularProgressIndeicator(); default: if (snapshot.hasError) { - helpers.showErrorToast('Error: ${snapshot.error}'); + Helpers.showErrorToast('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}'); } else { return SingleChildScrollView( @@ -177,36 +177,19 @@ class _VerificationMethodsState extends State { user.logInTypeID, context), fontSize: 14, - ) - // Text( - // user.editedOn != null - // ? formatDate(Helpers - // .convertStringToDate( - // user.editedOn)) - // : user.createdOn != null - // ? formatDate(Helpers - // .convertStringToDate(user - // .createdOn)) - // : '--', - // overflow: - // TextOverflow.ellipsis, - // style: TextStyle( - // fontFamily: 'Poppins'), - // textAlign: - // TextAlign.center), - )), + ))), Flexible( flex: 2, child: ListTile( title: AppText( user.editedOn != null - ? getDate(Helpers + ? getDate(DateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getDate(Helpers + ? getDate(DateUtils .convertStringToDate( user.createdOn)) : '--', @@ -218,13 +201,13 @@ class _VerificationMethodsState extends State { ), subtitle: AppText( user.editedOn != null - ? getTime(Helpers + ? getTime(DateUtils .convertStringToDate( user .editedOn)) : user.createdOn != null - ? getTime(Helpers + ? getTime(DateUtils .convertStringToDate( user.createdOn)) : '--', @@ -288,16 +271,6 @@ class _VerificationMethodsState extends State { Expanded( child: getButton(5, authProv)) ]), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // children: [ - // Expanded( - // child: getButton(1, authProv)), - // Expanded( - // child: getButton(2, authProv)) - // ], - // ) ]) : Column( mainAxisAlignment: MainAxisAlignment.start, @@ -341,11 +314,11 @@ class _VerificationMethodsState extends State { ? Row( children: [ Expanded( - child: Button( + child: AppButton( title: TranslationBase.of(context) .useAnotherAccount, color: Colors.red[700], - onTap: () { + onPressed: () { Navigator.of(context).pushNamed(LOGIN); }, )), @@ -366,13 +339,6 @@ class _VerificationMethodsState extends State { return verificationMethod == 4 || verificationMethod == 3 ? true : false; } -/* - *@author: Elham Rababah - *@Date:15/4/2020 - *@param: oTPSendType - *@return: - *@desc: send Activation Code By Otp Notification Type - */ sendActivationCodeByOtpNotificationType( oTPSendType, AuthViewModel authProv) async { // TODO : build enum for verfication method @@ -401,19 +367,19 @@ class _VerificationMethodsState extends State { this.startSMSService(oTPSendType, authProv); } else { print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { print('$err'); widget.changeLoadingStata(false); - helpers.showErrorToast(); + Helpers.showErrorToast(); }); } catch (e) {} } else { // TODO route to this page with parameters to inicate we should present 2 option if (Platform.isAndroid && oTPSendType == 3) { - helpers.showErrorToast('Your device not support this feature'); + Helpers.showErrorToast('Your device not support this feature'); } else { // Navigator.of(context).push(MaterialPageRoute( // builder: (BuildContext context) => @@ -459,13 +425,13 @@ class _VerificationMethodsState extends State { } } else { print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { print('$err'); widget.changeLoadingStata(false); - helpers.showErrorToast(); + Helpers.showErrorToast(); }); } catch (e) {} // } @@ -846,11 +812,11 @@ class _VerificationMethodsState extends State { } } else { Navigator.pop(context); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { Navigator.pop(context); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } @@ -860,7 +826,12 @@ class _VerificationMethodsState extends State { sharedPref.setObj(DOCTOR_PROFILE, profile); projectsProvider.isLogin = true; - Navigator.pushAndRemoveUntil(context, FadePage(page: LandingPage(),), (r) => false); + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); } getDocProfiles(ClinicModel clinicInfo, authProv) { @@ -876,11 +847,11 @@ class _VerificationMethodsState extends State { loginProcessCompleted(res['DoctorProfileList'][0], authProv); } else { // changeLoadingStata(false); - helpers.showErrorToast(res['ErrorEndUserMessage']); + Helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { // changeLoadingStata(false); - helpers.showErrorToast(err); + Helpers.showErrorToast(err); }); } diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart index 98ef3cfa..aa532306 100644 --- a/lib/widgets/charts/app_bar_chart.dart +++ b/lib/widgets/charts/app_bar_chart.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; class AppBarChart extends StatelessWidget { const AppBarChart({ diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart index 553afec8..1a29b1e6 100644 --- a/lib/widgets/charts/app_line_chart.dart +++ b/lib/widgets/charts/app_line_chart.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; /// chart line /// [seriesList] charts series diff --git a/lib/widgets/dashboard/activity_button.dart b/lib/widgets/dashboard/activity_button.dart new file mode 100644 index 00000000..8258a1df --- /dev/null +++ b/lib/widgets/dashboard/activity_button.dart @@ -0,0 +1,39 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class GetActivityButton extends StatelessWidget { + final value; + GetActivityButton(this.value); + @override + Widget build(BuildContext context) { + return Container( + width: 120, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + height: 120, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: AppText(value.value.toString(), + fontSize: 32, fontWeight: FontWeight.bold)), + Expanded( + child: AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 12, + textAlign: TextAlign.center, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/dashboard/dashboard_item_icons_texts.dart b/lib/widgets/dashboard/dashboard_item_icons_texts.dart index 21cc23ea..740ebb66 100644 --- a/lib/widgets/dashboard/dashboard_item_icons_texts.dart +++ b/lib/widgets/dashboard/dashboard_item_icons_texts.dart @@ -1,10 +1,9 @@ -import 'dart:ffi'; import 'package:doctor_app_flutter/config/size_config.dart'; - -import '../shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; + import '../shared/app_texts_widget.dart'; +import '../shared/rounded_container_widget.dart'; class DashboardItemIconText extends StatefulWidget { final IconData icon; diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index 20dc5a22..659e4562 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../shared/rounded_container_widget.dart'; import '../shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; +import '../shared/rounded_container_widget.dart'; class DashboardItemTexts extends StatefulWidget { final String label; diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart index ddd649d1..6769c568 100644 --- a/lib/widgets/dashboard/guage_chart.dart +++ b/lib/widgets/dashboard/guage_chart.dart @@ -1,6 +1,6 @@ + import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; -import 'dart:math'; class GaugeChart extends StatelessWidget { final List seriesList; diff --git a/lib/widgets/dashboard/out_patient_stack.dart b/lib/widgets/dashboard/out_patient_stack.dart new file mode 100644 index 00000000..d5da97c6 --- /dev/null +++ b/lib/widgets/dashboard/out_patient_stack.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class GetOutPatientStack extends StatelessWidget { + final value; + GetOutPatientStack(this.value); + @override + Widget build(BuildContext context) { + value.summaryoptions + .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + + var list = new List(); + value.summaryoptions.forEach((result) => + {list.add(getStack(result, value.summaryoptions.first.value))}); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + value.kPIName, + medium: true, + ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) + ], + ); + } + + getStack(Summaryoptions value, max) { + return Stack(children: [ + Container( + height: 150, + margin: EdgeInsets.all(5), + width: 40, + child: SizedBox(), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.red[50]), + ), + Positioned( + bottom: 0, + child: Container( + child: SizedBox(), + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + height: max != 0 ? (150 * value.value) / max : 0, + width: 40, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.red[300]))), + Container( + height: 150, + margin: EdgeInsets.only(left: 5, top: 5), + padding: EdgeInsets.all(10), + child: RotatedBox( + quarterTurns: 1, + child: Center( + child: Align( + child: AppText( + value.kPIParameter + ' (' + value.value.toString() + ') ', + fontSize: 10, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + )), + ), + )) + ]); + } +} diff --git a/lib/widgets/dashboard/row_count.dart b/lib/widgets/dashboard/row_count.dart new file mode 100644 index 00000000..c56613da --- /dev/null +++ b/lib/widgets/dashboard/row_count.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class RowCounts extends StatelessWidget { + final name; + final int count; + final Color c; + RowCounts(this.name, this.count, this.c); + @override + Widget build(BuildContext context) { + return Row( + children: [ + dot(c), + Padding( + padding: EdgeInsets.only(top: 5, bottom: 5), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + name, + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 12, + textOverflow: TextOverflow.ellipsis, + ), + AppText( + ' (' + count.toString() + ')', + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 14, + fontWeight: FontWeight.bold, + ) + ], + )), + ], + ); + } + + Widget dot(Color c) { + return Container( + padding: EdgeInsets.all(5.0), + margin: EdgeInsets.all(5.0), + decoration: BoxDecoration(color: c, shape: BoxShape.circle)); + } +} diff --git a/lib/widgets/dashboard/swiper_rounded_pagination.dart b/lib/widgets/dashboard/swiper_rounded_pagination.dart new file mode 100644 index 00000000..7e5c2c70 --- /dev/null +++ b/lib/widgets/dashboard/swiper_rounded_pagination.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; + +class SwiperRoundedPagination extends StatelessWidget { + final active; + SwiperRoundedPagination(this.active); + @override + Widget build(BuildContext context) { + return active == true + ? Container( + height: 5, + width: 30, + // margin: EdgeInsets.only(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), color: Colors.black), + ) + : Container( + height: 5, + width: 8, + margin: EdgeInsets.all(2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.grey)); + } +} diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index ad2ee7f3..55173809 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -9,8 +9,8 @@ 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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -104,16 +104,28 @@ class _DoctorReplyWidgetState extends State { ], ), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: AppText( Helpers.capitalize( widget.reply.patientName), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', ), ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" +widget.reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), SizedBox( width: 4, ), @@ -221,7 +233,7 @@ class _DoctorReplyWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( - maxLines: 2, + maxLines: 3, overflow: TextOverflow.ellipsis, text: new TextSpan( style: new TextStyle( @@ -229,11 +241,11 @@ class _DoctorReplyWidgetState extends State { color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).doctorResponse + " : ", + text:"Patient Question :" ,//TranslationBase.of(context).doctorResponse + " : ", style: TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( - text: widget.reply.remarks.trim(), + text: widget.reply?.remarks?.trim()??'', style: TextStyle( fontFamily: 'Poppins', color: Color(0xFF575757), @@ -245,10 +257,10 @@ class _DoctorReplyWidgetState extends State { ],) ], ), - Container( - alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - child: Icon(FontAwesomeIcons.arrowRight, - size: 20, color: Colors.black),) + // Container( + // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // child: Icon(FontAwesomeIcons.arrowRight, + // size: 20, color: Colors.black),) ], ), // onTap: onTap, diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index 5ca50864..c4343a4b 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -1,6 +1,6 @@ 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/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -72,7 +72,7 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).description, color: Colors.white, ), @@ -84,7 +84,7 @@ class _LabResultWidgetState extends State { child: Container( color: HexColor('#515B5D'), child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).value, color: Colors.white), ), @@ -99,7 +99,7 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: Texts( + child: AppText( TranslationBase.of(context).range, color: Colors.white), ), @@ -135,7 +135,7 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: Texts( + child: AppText( '${result.description}', color: Colors.grey[800], ), @@ -146,7 +146,7 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: Texts('${result.resultValue}', + child: AppText('${result.resultValue}', color: Colors.grey[800]), ), height: 60), @@ -154,7 +154,7 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: Texts( + child: AppText( '${result.referenceRange}', color: Colors.grey[800]), ), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 98371a9f..453cff30 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -3,13 +3,10 @@ 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/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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -21,7 +18,12 @@ class MyReferralPatientWidget extends StatefulWidget { final bool isExpand; final Function expandClick; - MyReferralPatientWidget({Key key, this.myReferralPatientModel, this.model, this.isExpand, this.expandClick}); + MyReferralPatientWidget( + {Key key, + this.myReferralPatientModel, + this.model, + this.isExpand, + this.expandClick}); @override _MyReferralPatientWidgetState createState() => @@ -428,8 +430,9 @@ class _MyReferralPatientWidgetState extends State { Container( width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), - child: Button( - onTap: () async { + child: AppButton( + title : TranslationBase.of(context).replay, + onPressed: () async { final form = _formKey.currentState; if (form.validate()) { try { @@ -443,7 +446,6 @@ class _MyReferralPatientWidgetState extends State { } } }, - title: TranslationBase.of(context).replay, loading: widget.model.state == ViewState.BusyLocal, ), ) diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 6c9e51cf..e4112cf2 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,4 +1,5 @@ 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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -6,6 +7,7 @@ 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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MyScheduleWidget extends StatelessWidget { final ListDoctorWorkingHoursTable workingHoursTable; @@ -14,6 +16,7 @@ class MyScheduleWidget extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); List workingHours = Helpers.getWorkingHours( workingHoursTable.workingHours, ); @@ -30,14 +33,14 @@ class MyScheduleWidget extends StatelessWidget { height: 10, ), AppText( - workingHoursTable.dayName, - fontSize: 18, + projectViewModel.isArabic?DateUtils.getWeekDayArabic(workingHoursTable.date.weekday): DateUtils.getWeekDay(workingHoursTable.date.weekday) , + fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', - fontSize: 18, + fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', // fontSize: 18 @@ -71,6 +74,7 @@ class MyScheduleWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { return Container( + margin: EdgeInsets.only(bottom:workingHours.length>1? 15:0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index 117bdc5e..f4f78c08 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -1,10 +1,14 @@ import 'dart:convert'; import 'dart:typed_data'; + import 'package:doctor_app_flutter/config/size_config.dart'; -import '../shared/rounded_container_widget.dart'; -import '../shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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 @@ -60,7 +64,8 @@ class _MedicineItemWidgetState extends State { padding: EdgeInsets.all(5), child: Align( alignment: Alignment.centerLeft, - child: AppText(widget.label)))) + child: AppText(widget.label)))), + Icon(EvaIcons.eye) ], ), ), diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index b60ebeb1..6c28b488 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -6,8 +6,6 @@ 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:flutter/material.dart'; -import 'dart:math'; - import 'package:provider/provider.dart'; class SMSOTP { @@ -57,6 +55,7 @@ class SMSOTP { displayDialog(BuildContext context) async { return showDialog( context: context, + barrierColor: Colors.black.withOpacity(0.7), builder: (context) { projectProvider = Provider.of(context); return AlertDialog( @@ -86,14 +85,14 @@ class SMSOTP { ? Padding( child: Icon( DoctorApp.verify_sms_1, - size: 40, + size: 50, ), padding: EdgeInsets.only(bottom: 20), ) : Padding( child: Icon( DoctorApp.verify_whtsapp, - size: 40, + size: 50, ), padding: EdgeInsets.only(bottom: 20), ), @@ -116,7 +115,7 @@ class SMSOTP { ) ])), Padding( - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.only(top: 5, right: 5), child: AppText( TranslationBase.of(context).verificationMessage + ' XXXXXX' + @@ -124,7 +123,9 @@ class SMSOTP { .toString() .substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.bold, + fontSize: 14, + maxLines: 2, )), Form( key: verifyAccountForm, @@ -133,10 +134,11 @@ class SMSOTP { child: Directionality( textDirection: TextDirection.ltr, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: SizeConfig.realScreenWidth * 0.15, + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( textInputAction: TextInputAction.next, style: buildTextStyle(), @@ -164,7 +166,8 @@ class SMSOTP { ), ), Container( - width: SizeConfig.realScreenWidth * 0.15, + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( focusNode: focusD2, textInputAction: TextInputAction.next, @@ -191,7 +194,8 @@ class SMSOTP { validator: validateCodeDigit), ), Container( - width: SizeConfig.realScreenWidth * 0.15, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD3, textInputAction: TextInputAction.next, @@ -218,7 +222,8 @@ class SMSOTP { }, validator: validateCodeDigit)), Container( - width: SizeConfig.realScreenWidth * 0.15, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD4, maxLength: 1, @@ -282,15 +287,15 @@ class SMSOTP { // contentPadding: EdgeInsets.only(top: 20, bottom: 20), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[100]), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[100]), + borderSide: BorderSide(color: Colors.grey[300]), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[100]), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index faa7fee5..fd60b21d 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -5,11 +5,9 @@ import 'package:doctor_app_flutter/models/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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; class PatientCard extends StatelessWidget { @@ -17,12 +15,17 @@ class PatientCard extends StatelessWidget { final Function onTap; final String patientType; final String arrivalType; + final bool isInpatient; + final bool isMyPatient; + final bool isFromSearch; + const PatientCard( {Key key, this.patientInfo, this.onTap, this.patientType, - this.arrivalType}) + this.arrivalType, + this.isInpatient, this.isMyPatient = false, this.isFromSearch = false}) : super(key: key); @override Widget build(BuildContext context) { @@ -35,17 +38,28 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - Container( - height: MediaQuery.of(context).size.height * .20, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: patientInfo.patientStatusType == 43 - ? Colors.green[500] - : Colors.red[800], - )), + if (!isInpatient&& !isMyPatient && !isFromSearch) + Container( + height: 160, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: patientInfo.patientStatusType == 43 + ? Colors.green[500] + : Colors.red[800], + )), + if(isMyPatient && !isFromSearch) + Container( + height: 180, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: Colors.green[500] + )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -54,48 +68,114 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + !(isInpatient && !isFromSearch) ? Padding( padding: EdgeInsets.only(left: 12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ patientInfo.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), + ? Row( + children: [ + AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ) + : patientInfo.patientStatusType == 42?Row( + children: [ + AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ): !isFromSearch && patientInfo.patientStatusType==null ? Row( + children: [ + AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Booked':'Confirmed', + color: patientInfo.status==2? Colors.grey:Colors.green , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + ], + ):SizedBox(), this.arrivalType == '1' ? AppText( patientInfo.startTime != null ? patientInfo.startTime - : '', + : patientInfo.startTimes, fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, - 'MM-dd-yyyy HH:mm'), + DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) + )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, ) - : SizedBox() + : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? + AppText( + // + // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + ):SizedBox() ], )) : SizedBox(), + if(isInpatient && isMyPatient && !isFromSearch) + Row( + children: [ + SizedBox(width: 12,), + AppText( + 'My Patient', + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -110,7 +190,6 @@ class PatientCard extends StatelessWidget { Helpers.capitalize(patientInfo.lastName)), fontSize: 16, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', textOverflow: TextOverflow.ellipsis, ), @@ -137,6 +216,7 @@ class PatientCard extends StatelessWidget { : "", fontWeight: FontWeight.bold, fontSize: 14, + textOverflow: TextOverflow.ellipsis, ), patientInfo.nationality != null || patientInfo.nationalityId != null @@ -144,7 +224,9 @@ class PatientCard extends StatelessWidget { borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientInfo.nationalityFlagURL, + patientInfo.nationalityFlagURL != null + ? patientInfo.nationalityFlagURL + : '', height: 25, width: 30, errorBuilder: (BuildContext context, @@ -210,113 +292,79 @@ class PatientCard extends StatelessWidget { ), ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', + //if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: + TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], ), - children: [ + ), + ), + if (isInpatient ) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ new TextSpan( - text: TranslationBase.of(context).age + - " : ", + text: patientInfo.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", style: TextStyle(fontSize: 14)), new TextSpan( - text: - "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + text: patientInfo.admissionDate == null + ? "" + : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 15)), - ], - ), + ]))), + if (patientInfo.admissionDate != null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 15, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], ), - ), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - TranslationBase.of(context) - .appointmentDate + - " : ", - fontSize: 14, - ), - ), - patientInfo.startTimes != null - ? Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - patientInfo.startTimes, - color: Colors.white, - fontSize: 1.5 * - SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: patientInfo.appointmentDate != null - ? AppText( - DateUtils - .convertDateFromServerFormat( - patientInfo - .appointmentDate - .toString(), - 'yyyy-MM-dd'), - fontSize: 1.5 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ) - : SizedBox(), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ) + ])) ]), - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + !isInpatient && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Container( padding: EdgeInsets.all(4), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.only( - // bottomRight: Radius.circular(8), - // topLeft: Radius.circular(8), - // ), - // color: patientInfo.appointmentType == - // 'Regular' && - // patientInfo.visitTypeId == 100 - // ? HexColor('#D02127') - // : patientInfo.appointmentType == - // 'Walkin' - // ? HexColor('#28323A') - // : HexColor('#6C7379'), - // ), child: Image.asset( patientInfo.appointmentType == 'Regular' && @@ -330,7 +378,19 @@ class PatientCard extends StatelessWidget { width: 35, )), ]) - : SizedBox() + : (isInpatient == true) + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + 'assets/images/inpatient.png', + height: 25, + width: 35, + )), + ]) + : SizedBox() ], ), onTap: onTap, diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 1760c796..d2a68acd 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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'; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 98d4f458..a08282c0 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,17 +1,16 @@ 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/my_referral/PendingReferral.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; class PatientReferralItemWidget extends StatelessWidget { final String referralStatus; + final int referralStatusCode; final String patientName; final int patientGender; final String referredDate; @@ -19,6 +18,8 @@ class PatientReferralItemWidget extends StatelessWidget { final String patientID; final isSameBranch; final bool isReferral; + final bool isReferralClinic; + final String referralClinic; final String remark; final String nationality; final String nationalityFlag; @@ -29,6 +30,7 @@ class PatientReferralItemWidget extends StatelessWidget { PatientReferralItemWidget( {this.referralStatus, + this.referralStatusCode, this.patientName, this.patientGender, this.referredDate, @@ -42,7 +44,7 @@ class PatientReferralItemWidget extends StatelessWidget { this.doctorAvatar, this.referralDoctorName, this.clinicDescription, - this.infoIcon}); + this.infoIcon,this.isReferralClinic=false,this.referralClinic}); @override Widget build(BuildContext context) { @@ -54,11 +56,11 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Container( child: CardWithBgWidget( - bgColor: referralStatus != null - ? referralStatus == 'Pending' - ? Color(0xffc4aa54) - : Colors.red[800] - : Colors.grey[500], + bgColor: referralStatusCode == 1 + ? Color(0xffc4aa54) + : referralStatusCode == 46 + ? Colors.green[700] + : Colors.red[700], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -74,13 +76,11 @@ class PatientReferralItemWidget extends StatelessWidget { fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: referralStatus != null - ? referralStatus == 'Pending' - ? Color(0xffc4aa54) - : referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] - : Colors.grey[500], + color: referralStatusCode == 1 + ? Color(0xffc4aa54) + : referralStatusCode == 46 + ? Colors.green[700] + : Colors.red[700], ), AppText( referredDate, @@ -99,7 +99,6 @@ class PatientReferralItemWidget extends StatelessWidget { patientName, fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, color: Colors.black, fontFamily: 'Poppins', ), @@ -158,17 +157,15 @@ class PatientReferralItemWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).referredFrom, + isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), + AppText( - isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context) - .otherBranch, + !isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -223,6 +220,7 @@ class PatientReferralItemWidget extends StatelessWidget { fontWeight: FontWeight.w700, fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), + maxLines: 1, ), ), ], @@ -247,10 +245,26 @@ class PatientReferralItemWidget extends StatelessWidget { child: Container( width: 40, height: 40, - child: CircleAvatar( - radius: 25.0, - backgroundImage: NetworkImage(doctorAvatar), - backgroundColor: Colors.transparent, + child: doctorAvatar != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + doctorAvatar, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : Container( + child: Image.asset( + patientGender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), ), ), ), @@ -260,14 +274,23 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.only( left: 10, top: 25, right: 10, bottom: 0), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( referralDoctorName, fontFamily: 'Poppins', - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF2E303A), + color: Colors.black, ), + if (clinicDescription != null) + AppText( + clinicDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 1.4 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), ], ), ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index ebac98b5..66d33fe7 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -13,13 +13,15 @@ class PatientProfileButton extends StatelessWidget { final PatiantInformtion patient; final String patientType; String arrivalType; + final bool isInPatient; String from; String to; final String url = "assets/images/"; final bool isDisable; final bool isLoading; final Function onTap; - + final bool isDischargedPatient; + final bool isSelectInpatient; PatientProfileButton( {Key key, this.patient, @@ -33,7 +35,9 @@ class PatientProfileButton extends StatelessWidget { this.onTap, this.isLoading = false, this.from, - this.to}) + this.to, + this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, + }) : super(key: key); @override @@ -110,6 +114,9 @@ class PatientProfileButton extends StatelessWidget { } void navigator(BuildContext context, route) { + if(route == null) + return; + if (from == null) { from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } @@ -124,7 +131,10 @@ class PatientProfileButton extends StatelessWidget { 'from': from, 'to': to, 'patientType': patientType, - 'arrivalType': arrivalType + 'arrivalType': arrivalType, + 'isInpatient': isInPatient, + 'isDischargedPatient': isDischargedPatient, + 'isSelectInpatient': isSelectInpatient, }); } } diff --git a/lib/widgets/patients/profile/add-order/addNewOrder.dart b/lib/widgets/patients/profile/add-order/addNewOrder.dart new file mode 100644 index 00000000..275888e3 --- /dev/null +++ b/lib/widgets/patients/profile/add-order/addNewOrder.dart @@ -0,0 +1,59 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class AddNewOrder extends StatelessWidget { + const AddNewOrder({ + Key key, + this.onTap, this.label, + }) : super(key: key); + + final Function onTap; + final String label; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 10, + ), + AppText( + label ??'', + color: Colors.grey[600], + fontWeight: FontWeight.w600, + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index e98c2de4..80f54e12 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -3,8 +3,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'avatar_gradients.dart'; - class LargeAvatar extends StatelessWidget { LargeAvatar( {Key key, diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index ffb297b1..b9312289 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.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:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 7ed8579b..0ba5c8f2 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -9,6 +9,7 @@ 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'; class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { @@ -16,9 +17,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final String patientType; final String arrivalType; final double height; + final bool isInpatient; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false}); @override Widget build(BuildContext context) { @@ -37,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? 200 : height, + height: height == 0 ? isInpatient? 215:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -58,9 +60,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', ), ), @@ -73,6 +74,18 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget DoctorApp.female_1, color: Colors.pink, ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), ]), ), Row(children: [ @@ -242,7 +255,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age??'' + " : ", + text: TranslationBase.of(context).age+ " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: @@ -253,6 +266,50 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), ), ), + if(isInpatient) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patient.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: patient.admissionDate == null + ? "" + : "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ]))), + if (patient.admissionDate != null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 15, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ) ], ), ), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index a626ac7f..b4d8ce17 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -9,16 +9,18 @@ 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'; class PatientProfileHeaderNewDesign extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; final double height; + final bool isHaveMargin; PatientProfileHeaderNewDesign( this.patient, this.patientType, this.arrivalType, - {this.height = 0.0}); + {this.height = 0.0, this.isHaveMargin=true}); @override Widget build(BuildContext context) { @@ -61,7 +63,6 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { : Helpers.capitalize(patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', ), ), @@ -74,6 +75,18 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), ]), ), Row(children: [ @@ -127,9 +140,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { fontWeight: FontWeight.w600, ) : AppText( - DateUtils.convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm'), + DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate(patient.arrivedOn)), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart new file mode 100644 index 00000000..557f78ce --- /dev/null +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -0,0 +1,242 @@ +import 'package:doctor_app_flutter/config/size_config.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/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_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + + PatientProfileHeaderNewDesignInPatient( + this.patient, this.patientType, this.arrivalType, + {this.height = 0.0}); + + @override + Widget build(BuildContext context) { + int gender = 1; + if (patient.patientDetails != null) { + gender = patient.patientDetails.gender; + } else { + gender = patient.gender; + } + + return Container( + padding: EdgeInsets.only( + left: 0, + right: 5, + bottom: 5, + ), + decoration: BoxDecoration( + color: Colors.white, + ), + height: height == 0 ? 200 : height, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + // margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + patient.firstName != null + ? (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize(patient.lastName)) + : Helpers.capitalize(patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), + ), + gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).fileNumber, + fontSize: 1.2 * SizeConfig.textMultiplier, + ), + AppText(patient.patientId.toString(), + fontSize: 1.4 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700), + ], + ), + if(patient.admissionDate!=null) + Row( + children: [ + AppText( + DateUtils.convertDateFromServerFormat( + patient.admissionDate, "hh:mm a"), + fontWeight: FontWeight.bold, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), + ], + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if(patient.admissionDate!=null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).admissionDate}: ", + fontSize: 1.2 * SizeConfig.textMultiplier, + ), + AppText( + DateUtils.convertDateFromServerFormat( + patient.admissionDate, "dd MMM,yyyy"), + fontSize: 1.4 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700), + ], + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality ?? + patient.nationalityId ?? + '', + fontWeight: FontWeight.bold, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), + patient.nationalityFlagURL != null + ? ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + patient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + if(patient.admissionDate!=null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 1.2 * SizeConfig.textMultiplier, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 1.4 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700), + ], + ), + ], + ), + ), + ]), + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String newDate; + const start = "/Date("; + if (str.isNotEmpty) { + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + } + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart index 2bfaff23..acbb5f05 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -6,12 +6,12 @@ import 'package:doctor_app_flutter/models/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/shared/Text.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:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; @@ -79,7 +79,6 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier *2.2, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', ), ), @@ -92,6 +91,18 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { DoctorApp.female_1, color: Colors.pink, ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ) ]), ), Row(children: [ @@ -373,7 +384,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( '${TranslationBase.of(context).dr}.$doctorName', color: Colors.black, fontWeight: FontWeight.w600, @@ -382,11 +393,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { if (orderNo != null && !isPrescriptions) Row( children: [ - Texts( + AppText( 'Order No:', color: Colors.grey[800], ), - Texts( + AppText( orderNo ?? '', ) ], @@ -394,11 +405,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { if (invoiceNO != null && !isPrescriptions) Row( children: [ - Texts( + AppText( 'Invoice:', color: Colors.grey[800], ), - Texts( + AppText( invoiceNO, ) ], @@ -406,11 +417,11 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { if(isPrescriptions) Row( children: [ - Texts( + AppText( 'Branch:', color: Colors.grey[800], ), - Texts( + AppText( branch?? '', ) ], @@ -418,23 +429,23 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { if(isPrescriptions) Row( children: [ - Texts( + AppText( 'Clinic:', color: Colors.grey[800], ), - Texts( + AppText( clinic?? '', ) ], ), Row( children: [ - Texts( + AppText( !isPrescriptions? 'Result Date:': 'Prescriptions Date', color: Colors.grey[800], ), Expanded( - child: Texts( + child: AppText( '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), ) diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 1accfa35..0adfac4d 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -6,12 +6,12 @@ import 'package:doctor_app_flutter/models/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/shared/Text.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:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; @@ -87,7 +87,6 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget : Helpers.capitalize(patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, fontFamily: 'Poppins', ), ), @@ -100,6 +99,18 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget DoctorApp.female_1, color: Colors.pink, ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" + patient.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ) ]), ), Row(children: [ @@ -317,78 +328,78 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget margin: EdgeInsets.only(top: 10), ), Expanded( - flex: 4, + flex: 5, child: Container( margin: EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( + AppText( '${TranslationBase.of(context).dr}$doctorName', color: Colors.black, fontWeight: FontWeight.w600, - fontSize: 12, + fontSize: 9, ), if (orderNo != null && !isPrescriptions) Row( children: [ - Texts('Order No: ', + AppText('Order No: ', color: Colors.grey[800], fontSize: 12), - Texts(orderNo ?? '', fontSize: 12) + AppText(orderNo ?? '', fontSize: 12) ], ), if (invoiceNO != null && !isPrescriptions) Row( children: [ - Texts('Invoice: ', + AppText('Invoice: ', color: Colors.grey[800], fontSize: 12), - Texts(invoiceNO, fontSize: 12) + AppText(invoiceNO, fontSize: 12) ], ), if (branch != null) Row( children: [ - Texts('Branch: ', + AppText('Branch: ', color: Colors.grey[800], fontSize: 12), - Texts(branch ?? '', fontSize: 12) + AppText(branch ?? '', fontSize: 12) ], ), - if (isPrescriptions) + if (clinic != null) Row( children: [ - Texts('Clinic: ', + AppText('Clinic: ', color: Colors.grey[800], fontSize: 12), - Texts(clinic ?? '', fontSize: 12) + AppText(clinic ?? '', fontSize: 12) ], ), if (isMedicalFile && episode != null) Row( children: [ - Texts('Episode: ', + AppText('Episode: ', color: Colors.grey[800], fontSize: 12), - Texts(episode ?? '', fontSize: 12) + AppText(episode ?? '', fontSize: 12) ], ), if (isMedicalFile && vistDate != null) Row( children: [ - Texts('Visit Date: ', + AppText('Visit Date: ', color: Colors.grey[800], fontSize: 12), - Texts(vistDate ?? '', fontSize: 12) + AppText(vistDate ?? '', fontSize: 12) ], ), if (!isMedicalFile) Row( children: [ Expanded( - child: Texts( + child: AppText( !isPrescriptions ? 'Result Date: ' : 'Prescriptions Date ', @@ -396,7 +407,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget fontSize: 12, ), ), - Texts( + AppText( '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', fontSize: 14, ) @@ -456,5 +467,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget } @override - Size get preferredSize => Size(double.maxFinite, 290); + Size get preferredSize => Size(double.maxFinite, 310); } diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index 1c9b4462..9d22962a 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -4,7 +4,6 @@ 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'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index b4ceffb4..bd40c3ca 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/medication.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index d691446e..10586552 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -1,9 +1,5 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_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:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class ProfileWelcomeWidget extends StatelessWidget { diff --git a/lib/widgets/patients/profile/profile_general_info_content_widget.dart b/lib/widgets/patients/profile/profile_general_info_content_widget.dart index 713a98e1..f5c70ae6 100644 --- a/lib/widgets/patients/profile/profile_general_info_content_widget.dart +++ b/lib/widgets/patients/profile/profile_general_info_content_widget.dart @@ -1,8 +1,9 @@ -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../config/size_config.dart'; +import '../../shared/app_texts_widget.dart'; + /* *@author: Elham Rababah *@Date:22/4/2020 diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 8dc2a8c0..a469138c 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,20 +1,11 @@ -import 'package:doctor_app_flutter/config/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/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/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/date-utils.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/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { final String from; @@ -22,6 +13,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; + final bool isInpatient; ProfileMedicalInfoWidget( {Key key, @@ -29,7 +21,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { this.patientType, this.arrivalType, this.from, - this.to}); + this.to, this.isInpatient}); @override Widget build(BuildContext context) { @@ -43,7 +35,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget { childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -55,15 +46,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), - if (selectedPatientType != 7) + // if (selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, + nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, + nameLine2: "Summary",//TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( key: key, @@ -74,12 +65,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, patientType: patientType, arrivalType: arrivalType, + isInPatient:isInpatient, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, @@ -102,7 +94,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -112,7 +104,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -122,7 +114,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, icon: 'patient/vital_signs.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -132,7 +124,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'patient/patient_sick_leave.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (patient.appointmentNo!=null && patient.appointmentNo!=0) PatientProfileButton( key: key, patient: patient, @@ -143,7 +135,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'patient/ucaf.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (patient.appointmentNo!=null && patient.appointmentNo!=0) PatientProfileButton( key: key, patient: patient, @@ -154,7 +146,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (patient.appointmentNo!=null && patient.appointmentNo!=0) PatientProfileButton( key: key, patient: patient, @@ -165,7 +157,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), - if (patientType == "1") + if (isInpatient) PatientProfileButton( key: key, patient: patient, @@ -175,6 +167,16 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1:"Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), ], ), ); 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 new file mode 100644 index 00000000..eea3bfbb --- /dev/null +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -0,0 +1,176 @@ +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/routes.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/PatientProfileButton.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final bool isInpatient; + final bool isDischargedPatient; + + ProfileMedicalInfoWidgetInPatient( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to, + this.isInpatient, + this.isDischargedPatient = false}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ); + } +} 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 95a8c567..c03367bc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -4,6 +4,7 @@ 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'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -13,6 +14,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; + final bool isInpatient; + final bool isDischargedPatient; ProfileMedicalInfoWidgetSearch( {Key key, @@ -20,121 +23,523 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { this.patientType, this.arrivalType, this.from, - this.to}); + this.to, + this.isInpatient, + this.isDischargedPatient}); + TabController _tabController; + void initState() { + _tabController = TabController(length: 2); + } + + void dispose() { + _tabController.dispose(); + } @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - (int.parse(patientType) == 7 || int.parse(patientType) == 6) - ? PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png') - : PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: SHOW_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PATIENT_ADMISSION_REQUEST, - // nameLine1: TranslationBase.of(context).admission, - // nameLine2: TranslationBase.of(context).request, - // icon: 'heartbeat.png'), - ], + builder: (_, model, w) => DefaultTabController( + length: 2, + initialIndex: isInpatient ? 0 : 1, + child: SizedBox( + height: MediaQuery.of(context).size.height * 1.0, + width: double.infinity, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + toolbarHeight: 55, + elevation: 0, + bottom: TabBar( + controller: _tabController, + indicator: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10), // Creates border + color: Color(0xffD02126), + ), + //isScrollable: true, + + //indicatorWeight: 4.0, + indicatorColor: Colors.red[500], + + // labelPadding: + // EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Color(0xff5A6168), + labelColor: Colors.white, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('Inpatient Info'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('OutPatient Info'), + ), + ), + ]), + ), + body: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0), + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], + ), + ], + ), + ), + ), + ), + + // GridView.count( + // shrinkWrap: true, + // physics: NeverScrollableScrollPhysics(), + // crossAxisSpacing: 10, + // mainAxisSpacing: 10, + // childAspectRatio: 1 / 1.0, + // crossAxisCount: 3, + // children: [ + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // from: from, + // to: to, + // nameLine1: TranslationBase.of(context).vital, + // nameLine2: TranslationBase.of(context).signs, + // route: VITAL_SIGN_DETAILS, + // icon: 'patient/vital_signs.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: MEDICAL_FILE, + // nameLine1: + // "Health", //TranslationBase.of(context).medicalReport, + // nameLine2: + // "Summary", //TranslationBase.of(context).summaryReport, + // icon: 'patient/health_summary.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: LAB_RESULT, + // nameLine1: TranslationBase.of(context).lab, + // nameLine2: TranslationBase.of(context).result, + // icon: 'patient/lab_results.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // isInPatient: isInpatient, + // route: RADIOLOGY_PATIENT, + // nameLine1: TranslationBase.of(context).radiology, + // nameLine2: TranslationBase.of(context).service, + // icon: 'patient/health_summary.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PATIENT_ECG, + // nameLine1: TranslationBase.of(context).patient, + // nameLine2: "ECG", + // icon: 'patient/patient_sick_leave.png'), + // (int.parse(patientType) == 7 || + // int.parse(patientType) == 6) + // ? PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_NEW, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: + // TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png') + // : PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_NEW, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: + // TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PROCEDURE, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: TranslationBase.of(context).procedures, + // icon: 'patient/Order_Procedures.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PATIENT_INSURANCE_APPROVALS_NEW, + // nameLine1: TranslationBase.of(context).insurance, + // nameLine2: TranslationBase.of(context).service, + // icon: 'patient/vital_signs.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: SHOW_SICKLEAVE, + // nameLine1: TranslationBase.of(context).patientSick, + // nameLine2: TranslationBase.of(context).leave, + // icon: 'patient/patient_sick_leave.png'), + // if (patient.admissionNo != null && + // patient.admissionNo != "0") + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PROGRESS_NOTE, + // nameLine1: TranslationBase.of(context).progress, + // nameLine2: TranslationBase.of(context).note, + // icon: 'patient/Progress_notes.png'), + // if (patient.admissionNo != null && + // patient.admissionNo != "0") + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_NOTE, + // nameLine1: "Order", //"Text", + // nameLine2: "Sheet", + // icon: 'patient/Progress_notes.png'), + // if (patient.appointmentNo != null && + // patient.appointmentNo != 0) + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: REFER_PATIENT_TO_DOCTOR, + // // isDisable: patient.patientStatusType != 43 ? true : false, + // nameLine1: TranslationBase.of(context).referral, + // nameLine2: TranslationBase.of(context).patient, + // icon: 'patient/refer_patient.png'), + // ], + // ), ), ); } diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index 41af8e1d..8635f597 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.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'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -60,7 +60,7 @@ class _VitalSignDetailsWidgetState extends State { ), ), child: Center( - child: Texts( + child: AppText( widget.title1, color: Colors.white, ), @@ -77,7 +77,7 @@ class _VitalSignDetailsWidgetState extends State { ), ), child: Center( - child: Texts(widget.title2, color: Colors.white), + child: AppText(widget.title2, color: Colors.white), ), height: 60), ) @@ -89,8 +89,8 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: Center( - child: Texts( - '${Helpers.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${Helpers.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + child: AppText( + '${DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', textAlign: TextAlign.center, ), ), @@ -101,7 +101,7 @@ class _VitalSignDetailsWidgetState extends State { padding: EdgeInsets.all(10), color: Colors.white, child: Center( - child: Texts( + child: AppText( '${vital.toJson()[widget.viewKey]}', textAlign: TextAlign.center, ), diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart index 10c12fa5..f391e7bf 100644 --- a/lib/widgets/shared/StarRating.dart +++ b/lib/widgets/shared/StarRating.dart @@ -1,8 +1,7 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'Text.dart'; - class StarRating extends StatelessWidget { final double totalAverage; final double size; @@ -21,7 +20,7 @@ class StarRating extends StatelessWidget { Widget build(BuildContext context) { return Row(mainAxisAlignment: MainAxisAlignment.start, children: [ if (!forceStars && (totalAverage == null || totalAverage == 0)) - Texts("New", style: "caption"), + AppText("New", style: "caption"), if (forceStars || (totalAverage != null && totalAverage > 0)) ...List.generate( 5, @@ -38,7 +37,7 @@ class StarRating extends StatelessWidget { )), if (totalCount != null) SizedBox(width: 9.0), if (totalCount != null) - Texts( + AppText( "(" + totalCount.toString() + ")", style: "overline", color: Colors.grey[400], diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart deleted file mode 100644 index d3fa3cb9..00000000 --- a/lib/widgets/shared/Text.dart +++ /dev/null @@ -1,262 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class Texts extends StatefulWidget { - final String text; - final String variant; - final Color color; - final bool bold; - final bool regular; - final bool medium; - final int maxLength; - final bool italic; - final TextAlign textAlign; - final int maxLines; - final bool readMore; - final String style; - final bool allowExpand; - final double fontSize; - final FontWeight fontWeight; - final TextDecoration textDecoration; - - Texts(this.text, - {Key key, - this.variant, - this.color, - this.bold, - this.regular, - this.medium, - this.allowExpand = true, - this.italic: false, - this.textAlign, - this.maxLength = 60, - this.maxLines, - this.readMore = false, - this.style, - this.textDecoration, this.fontSize, this.fontWeight}) - : super(key: key); - - @override - _TextsState createState() => _TextsState(); -} - -class _TextsState extends State { - bool hidden = false; - String text = ""; - - @override - void didUpdateWidget(Texts oldWidget) { - setState(() { - if (widget.style == "overline") - text = widget.text.toUpperCase(); - else { - text = widget.text; - } - }); - super.didUpdateWidget(oldWidget); - } - - @override - void initState() { - hidden = widget.readMore; - if (widget.style == "overline") - text = widget.text.toUpperCase(); - else { - text = widget.text; - } - super.initState(); - } - - double _getFontSize() { - switch (widget.variant) { - case "heading0": - return 40.0; - case "heading": - return 32.0; - case "heading2": - return 28.0; - case "heading3": - return 18.0; - case "body1": - return 18.0; - case "body2": - return 20.0; - case "body2Link": - return 16.0; - case "caption": - return 16.0; - case "caption2": - return 14.0; - case "bodyText": - return 15.0; - case "bodyText2": - return 17.0; - case "caption3": - return 12.0; - case "caption4": - return 9.0; - case "overline": - return 11.0; - case "date": - return 24.0; - default: - return 16.0; - } - } - - FontWeight _getFontWeight() { - if (widget.bold ?? false) { - return FontWeight.w900; - } else if (widget.regular ?? false) { - return FontWeight.w500; - } else if (widget.medium ?? false) { - return FontWeight.w800; - } else { - if (widget.style == null) { - switch (widget.variant) { - case "heading": - return FontWeight.w900; - case "heading2": - return FontWeight.w900; - case "heading3": - return FontWeight.w900; - case "body1": - return FontWeight.w800; - case "body2": - return FontWeight.w900; - case "body2Link": - return FontWeight.w800; - case "caption": - return FontWeight.w700; - case "caption2": - return FontWeight.w700; - case "bodyText": - return FontWeight.w500; - case "bodyText2": - return FontWeight.w500; - case "caption3": - return FontWeight.w600; - case "caption4": - return FontWeight.w600; - case "overline": - return FontWeight.w800; - case "date": - return FontWeight.w900; - default: - return FontWeight.w500; - } - } else { - return null; - } - } - } - - @override - Widget build(BuildContext context) { - TextStyle _getFontStyle() { - switch (widget.style) { - case "headline2": - return Theme.of(context).textTheme.headline2; - case "headline3": - return Theme.of(context).textTheme.headline3; - case "headline4": - return Theme.of(context).textTheme.headline4; - case "headline5": - return Theme.of(context).textTheme.headline5; - case "headline6": - return Theme.of(context).textTheme.headline6; - case "bodyText2": - return Theme.of(context).textTheme.bodyText2; - case "bodyText_15": - return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); - case "bodyText1": - return Theme.of(context).textTheme.bodyText1; - case "caption": - return Theme.of(context).textTheme.caption; - case "overline": - return Theme.of(context).textTheme.overline; - case "button": - return Theme.of(context).textTheme.button; - default: - return TextStyle(); - } - } - - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), - textAlign: widget.textAlign, - overflow: widget.maxLines != null - ? ((widget.maxLines > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) - : null, - maxLines: widget.maxLines ?? null, - style: widget.style != null - ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color != null ? widget.color : null, - fontWeight: widget.fontWeight ?? _getFontWeight(), - ) - : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, - color: - widget.color != null ? widget.color : Colors.black, - fontSize:widget.fontSize?? _getFontSize(), - letterSpacing: - widget.variant == "overline" ? 1.5 : null, - fontWeight: widget.fontWeight ?? _getFontWeight(), - fontFamily: 'Poppins', - decoration: - widget.textDecoration //TextDecoration.lineThrough - )), - if (widget.readMore && text.length > widget.maxLength && hidden) - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), - height: 30, - ), - ) - ], - ), - if (widget.allowExpand && - widget.readMore && - text.length > widget.maxLength) - Padding( - padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), - child: InkWell( - onTap: () { - setState(() { - hidden = !hidden; - }); - }, - child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( - color: HexColor('#FF0000'), - fontWeight: FontWeight.w800, - fontFamily: "Poppins", - )), - ), - ), - ], - ); - } -} diff --git a/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart deleted file mode 100644 index 3f9c4549..00000000 --- a/lib/widgets/shared/app_button.dart +++ /dev/null @@ -1,150 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class Button extends StatefulWidget { - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; - final Color color; - - Button({ - Key key, - this.title = "", - this.icon, - this.onTap, - this.loading= false, - this.color, - }) : super(key: key); - - - - @override - _ButtonState createState() => _ButtonState(); -} - -class _ButtonState extends State