diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ebeabbd1..d5999b21 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -384,10 +384,7 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, - 'yourBodyMassIndex': { - 'en': "Body Mass Index is", - 'ar': 'مؤشر كتلة الجسم هو' - }, + 'yourBodyMassIndex': {'en': "Body Mass Index is", 'ar': 'مؤشر كتلة الجسم هو'}, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, @@ -870,6 +867,83 @@ const Map> localizedValues = { }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, + "pleaseEnterProcedure": { + "en": "Please Enter Procedure", + "ar": "الرجاء إدخال الإجراء " + }, + "fillTheMandatoryProcedureDetails": { + "en": "Fill The Mandatory Procedure Details", + "ar": "املأ تفاصيل الإجراء الإلزامي" + }, + "atLeastThreeCharacters": { + "en": "At least three Characters", + "ar": "ثلاثة أحرف على الأقل " + }, + "searchProcedureHere": { + "en": "Search Procedure here...", + "ar": "إجراء البحث هنا ... " + }, + "noInsuranceApprovalFound": { + "en": "No Insurance Approval Found", + "ar": "لم يتم العثور على موافقة التأمين" + }, + "procedure": {"en": "Procedure", "ar": "عملية"}, + "stopDate": {"en": "Stop Date", "ar": "تاريخ التوقف"}, + "processed": {"en": "processed", "ar": "معالجتها"}, + "direction": {"en": "Direction", "ar": "إشراف"}, + "refill": {"en": "Refill", "ar": "اعادة تعبئه"}, + "medicationHasBeenAdded": { + "en": "Medication has been added", + "ar": "تمت إضافة الدواء" + }, + "newPrescriptionOrder": { + "en": "New Prescription Order", + "ar": "طلب وصفة طبية جديد " + }, + "pleaseFillAllFields": { + "en": "Please Fill All Fields", + "ar": "لو سمحت أملأ كل الحقول" + }, + "narcoticMedicineCanOnlyBePrescribedFromVida": { + "en": "Narcotic medicine can only be prescribed from VIDA", + "ar": "لا يمكن وصف الأدوية المخدرة إلا من VIDA " + }, + "only5DigitsAllowedForStrength": { + "en": "Only 5 Digits allowed for strength", + "ar": "يسمح فقط بـ 5 أرقام للقوة" + }, + "unit": {"en": "Unit", "ar": "وحدة"}, + "boxQuantity": {"en": "Box Quantity", "ar": "كمية الصندوق "}, + "orderTestOr": {"en": "Order Test or", "ar": "اطلب اختبار أو"}, + "applyForRadiologyOrder": { + "en": "Apply for Radiology Order", + "ar": "التقدم بطلب للحصول على طلب الأشعة " + }, + "applyForNewLabOrder": { + "en": "Apply for New Lab Order", + "ar": "تقدم بطلب جديد للمختبر الأشعة" + }, + "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب معمل"}, + "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشغة"}, + "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, + "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, + "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, + "health": {"en": "Health", "ar": "التقرير"}, + "summary": {"en": "Summary", "ar": "الصحي"}, + "applyForNewPrescriptionsOrder": { + "en": "Apply for New Prescriptions Order", + "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " + }, + "noPrescriptionsFound": { + "en": "No Prescriptions Found", + "ar": "لم يتم العثور على وصفات طبية" + }, + "noMedicalFileFound": { + "en": "No Medical File Found", + "ar": "لم يتم العثور على ملف طبي" + }, + "insurance22": {"en": "Insurance", "ar": "موافقات"}, + "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, }; diff --git a/lib/core/enum/filter_type.dart b/lib/core/enum/filter_type.dart index 4591e023..bfa781f9 100644 --- a/lib/core/enum/filter_type.dart +++ b/lib/core/enum/filter_type.dart @@ -1,2 +1,6 @@ enum FilterType { Clinic, Hospital } +enum OutPatientFilterType { Previous, Today, NextWeek } + + + diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index a714cef9..9ef94647 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -2,14 +2,9 @@ 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 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -61,7 +56,6 @@ class PatientSearchViewModel extends BaseViewModel{ } else { setState(ViewState.Error); } - setState(ViewState.Error); } else { filterData = _outPatientService.patientList; setState(ViewState.Idle); @@ -88,14 +82,14 @@ class PatientSearchViewModel extends BaseViewModel{ bool isSearchWithKeyInfo })async { String dateTo; String dateFrom; - if (item == 'Tomorrow') { + if (item == 'Previous') { dateTo = DateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), + DateTime.now().day-1), 'yyyy-MM-dd'); dateFrom = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), + DateTime(DateTime.now().year, DateTime.now().month-3, + DateTime.now().day), 'yyyy-MM-dd'); } else if (item == 'Next Week') { @@ -127,13 +121,7 @@ class PatientSearchViewModel extends BaseViewModel{ currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; - - - if(isSearchWithKeyInfo) { - await getPatientFileInformation(currentModel); - } else { - await getOutPatient(currentModel, isLocalBusy: true); - } + await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; } diff --git a/lib/routes.dart b/lib/routes.dart index 91c3eaed..97f842f6 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import './screens/auth/login_screen.dart'; import './screens/auth/verification_methods_screen.dart'; import './screens/patients/patients_screen.dart'; -import './screens/patients/profile/patient_profile_screen.dart'; +import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 828210e0..1c06fd0c 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -378,7 +378,10 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Condition: ', + TranslationBase.of( + context) + .condition + + ": ", fontSize: 12.5, ), Expanded( @@ -435,7 +438,10 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Type: ', + TranslationBase.of( + context) + .type + + ": ", fontSize: 15.5, ), Expanded( @@ -617,7 +623,10 @@ class _MedicalFileDetailsState extends State { Column( children: [ AppText( - 'Order Date: ', + TranslationBase.of( + context) + .orderDate + + ": ", ), AppText( DateUtils.getDateFormatted( @@ -807,9 +816,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText( - 'Exam Type: ', - ), + AppText(TranslationBase.of( + context) + .examType + + ": "), AppText( model .medicalFileList[ @@ -854,9 +864,10 @@ class _MedicalFileDetailsState extends State { ), Row( children: [ - AppText( - 'Abnormal: ', - ), + AppText(TranslationBase.of( + context) + .abnormal + + ": "), AppText( model .medicalFileList[ diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index b7587efb..b2590296 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,7 +31,11 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), + patient, + patientType.toString() ?? "0", + arrivalType, + isInpatient: isInpatient, + ), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( @@ -51,7 +55,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Health', + TranslationBase.of(context).health, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -61,7 +65,7 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Summary', + TranslationBase.of(context).summary, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -193,7 +197,8 @@ class _MedicalFilePageState extends State { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Medical File Found'), + child: AppText(TranslationBase.of(context) + .noMedicalFileFound), ) ], ), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index ab3abbe9..2e4645ae 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -45,7 +45,11 @@ class _InsuranceApprovalScreenNewState builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), + patient, + patientType.toString() ?? "0", + patientType, + isInpatient: isInpatient, + ), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, @@ -67,7 +71,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +81,7 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -141,7 +145,8 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Insurance Approval Found'), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ), SizedBox( height: 150.0, @@ -168,7 +173,8 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context) + .insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -178,7 +184,8 @@ class _InsuranceApprovalScreenNewState Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context) + .approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -238,7 +245,8 @@ class _InsuranceApprovalScreenNewState Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Insurance Approval Found'), + child: AppText(TranslationBase.of(context) + .noInsuranceApprovalFound), ) ], ), diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 931f4051..e6284be7 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -4,6 +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/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -67,7 +68,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -77,7 +78,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -121,7 +122,9 @@ class _InsuranceApprovalsDetailsState extends State { .approvalStatusDescption != null ? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == - "Approved" + "Approved" || + "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == + "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127) : Color(0xffD02127), @@ -192,7 +195,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Clinic: ', + TranslationBase.of( + context) + .clinic + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -210,7 +216,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approval No: ', + TranslationBase.of( + context) + .approvalNo + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -244,7 +253,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Company Name :', + TranslationBase.of( + context) + .companyName + + ": ", color: Colors.grey[500], ), AppText('Sample') @@ -253,7 +265,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Receipt on: ', + TranslationBase.of( + context) + .receiptOn + + ": ", color: Colors.grey[500], ), Expanded( @@ -269,7 +284,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Exp on: ', + TranslationBase.of( + context) + .expiryDate + + ": ", color: Colors.grey[500], ), AppText( @@ -300,19 +318,22 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - 'Procedure', + TranslationBase.of(context) + .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Status', + TranslationBase.of(context) + .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Usage Status', + TranslationBase.of(context) + .usageStatus, fontWeight: FontWeight.w700, ), ) @@ -424,7 +445,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Insurance', + TranslationBase.of(context).insurance22, fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -434,7 +455,7 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approvals', + TranslationBase.of(context).approvals22, fontSize: 30.0, fontWeight: FontWeight.w700, ), @@ -548,7 +569,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Clinic: ', + TranslationBase.of( + context) + .clinic + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -566,7 +590,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Approval No: ', + TranslationBase.of( + context) + .approvalNo + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -583,7 +610,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Unused Count:', + TranslationBase.of( + context) + .unusedCount + + ": ", color: Colors.grey[500], fontSize: 14, ), @@ -600,7 +630,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Company Name :', + TranslationBase.of( + context) + .companyName + + ": ", color: Colors.grey[500], ), AppText('Sample') @@ -609,7 +642,10 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Receipt on: ', + TranslationBase.of( + context) + .receiptOn + + ": ", color: Colors.grey[500], ), Expanded( @@ -625,16 +661,23 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ AppText( - 'Exp on: ', + TranslationBase.of( + context) + .expiryDate + + ": ", 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, - ), + if (model + .insuranceApproval[ + indexInsurance] + .expiryDate != + null) + AppText( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: + FontWeight.w600, + ), ], ), ], @@ -657,19 +700,22 @@ class _InsuranceApprovalsDetailsState extends State { children: [ Expanded( child: AppText( - 'Procedure', + TranslationBase.of(context) + .procedure, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Status', + TranslationBase.of(context) + .status, fontWeight: FontWeight.w700, ), ), Expanded( child: AppText( - 'Usage Status', + TranslationBase.of(context) + .usageStatus, fontWeight: FontWeight.w700, ), ) diff --git a/lib/screens/patients/out_patient/filter_date_page.dart b/lib/screens/patients/out_patient/filter_date_page.dart new file mode 100644 index 00000000..034f6136 --- /dev/null +++ b/lib/screens/patients/out_patient/filter_date_page.dart @@ -0,0 +1,317 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class FilterDatePage extends StatefulWidget { + final OutPatientFilterType outPatientFilterType; + final PatientSearchViewModel patientSearchViewModel; + + const FilterDatePage( + {Key key, this.outPatientFilterType, this.patientSearchViewModel}) + : super(key: key); + + @override + _FilterDatePageState createState() => _FilterDatePageState(); +} + +class _FilterDatePageState extends State { + DateTime selectedFromDate; + DateTime selectedToDate; + + @override + Widget build(BuildContext context) { + var screenSize; + 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: (OutPatientFilterType.Previous == + widget.outPatientFilterType) + ? " Filter Previous Out Patient" + : "Filter Nextweek Out Patient", + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + color: Colors.white, + child: InkWell( + onTap: () => + selectDate( + context, firstDate: getFirstDate( + widget.outPatientFilterType), + lastDate: getLastDate( + widget.outPatientFilterType)), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase + .of( + context) + .fromDate, + selectedFromDate != null + ? "${DateUtils + .convertStringToDateFormat( + selectedFromDate.toString(), + "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox(height: 10,), + Container( + color: Colors.white, + child: InkWell( + onTap: () => + selectDate( + context, isFromDate: false, + firstDate: getFirstDate( + widget.outPatientFilterType), + lastDate: getLastDate( + widget.outPatientFilterType)), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase + .of( + context) + .toDate, + selectedToDate != null + ? "${DateUtils + .convertStringToDateFormat( + selectedToDate.toString(), + "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery + .of(context) + .size + .height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: + TranslationBase + .of(context) + .search, + padding: 10, + color: Color(0xFF359846), + onPressed: () async { + if (selectedFromDate == null || + selectedToDate == null) { + Helpers.showErrorToast( + "Please Select All The date Fields "); + } else { + String dateTo = DateUtils.convertDateToFormat( + selectedToDate, + 'yyyy-MM-dd'); + String dateFrom = DateUtils.convertDateToFormat( + selectedFromDate, + 'yyyy-MM-dd'); + + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + currentModel.to = dateTo; + currentModel.from= dateFrom; + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientSearchViewModel.getOutPatient( + currentModel, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + if(widget.patientSearchViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientSearchViewModel.error); + }else { + Navigator.of(context).pop(); + } + + } + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ) + ); + } + + selectDate(BuildContext context, + {bool isFromDate = true, DateTime firstDate, lastDate}) async { + Helpers.hideKeyboard(context); + DateTime selectedDate = isFromDate + ? this.selectedFromDate ?? firstDate + : this.selectedToDate ?? lastDate; + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: firstDate, + lastDate: lastDate, + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null) { + if (isFromDate) { + setState(() { + this.selectedFromDate = picked; + }); + } else { + setState(() { + this.selectedToDate = picked; + }); + } + } + } + + getFirstDate(OutPatientFilterType outPatientFilterType) { + if (outPatientFilterType == OutPatientFilterType.Previous) { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month - 3, DateTime + .now() + .day); + } else { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, DateTime + .now() + .day + 1); + } + } + + getLastDate(OutPatientFilterType outPatientFilterType) { + if (outPatientFilterType == OutPatientFilterType.Previous) { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, (DateTime + .now() + .day - 1)); + } else { + return DateTime( + DateTime + .now() + .year, DateTime + .now() + .month, DateTime + .now() + .day + 7); + } + } + + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } +} diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 8a4a7b3d..f99f791b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/filter_type.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'; @@ -18,9 +19,12 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils 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:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'filter_date_page.dart'; + // ignore: must_be_immutable class OutPatientsScreen extends StatefulWidget { final patientSearchForm; @@ -57,9 +61,9 @@ class _OutPatientsScreenState extends State { int clinicId; AuthViewModel authProvider; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + List _times = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - int _activeLocation = 0; + int _activeLocation = 1; String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -70,21 +74,30 @@ class _OutPatientsScreenState extends State { PatientModel patient; + OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; @override Widget build(BuildContext context) { authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, + _times = [ + TranslationBase + .of(context) + .previous, + TranslationBase + .of(context) + .today, + TranslationBase + .of(context) + .nextWeek, ]; - final screenSize = MediaQuery.of(context).size; + final screenSize = MediaQuery + .of(context) + .size; return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel); + await model.getOutPatient(widget.patientSearchRequestModel); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -108,8 +121,8 @@ class _OutPatientsScreenState extends State { child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item + children: _times.map((item) { + bool _isActive = _times[_activeLocation] == item ? true : false; @@ -117,7 +130,8 @@ class _OutPatientsScreenState extends State { child: InkWell( onTap: () async { setState(() { - _activeLocation = _locations.indexOf(item); + _activeLocation = _times.indexOf(item); + outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; }); GifLoaderDialogUtils.showMyDialog(context); await model.getPatientBasedOnDate(item: item, @@ -181,17 +195,26 @@ class _OutPatientsScreenState extends State { AppTextFormField( // focusNode: focusProject, controller: _controller, - borderColor: Colors.white, + borderColor: Colors.white + , prefix: IconButton( icon: Icon( - DoctorApp.filter_1, + _activeLocation == 1 + ? DoctorApp.filter_1 + : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, padding: EdgeInsets.only( bottom: 30), + onPressed: _activeLocation == 1 ? null : () { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); + }, ), + onChanged: (String str) { model.searchData(str); }), 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 dfba4578..f60e875a 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -47,7 +47,11 @@ class _LabsHomePageState extends State { backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), + patient, + patient.patientType.toString() ?? '0', + patientType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -66,13 +70,13 @@ class _LabsHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Lab', + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -87,13 +91,13 @@ class _LabsHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Lab', + TranslationBase.of(context).lab, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -113,7 +117,7 @@ class _LabsHomePageState extends State { )), ); }, - label: 'Apply for New Lab Order', + label: TranslationBase.of(context).applyForNewLabOrder, ), ...List.generate( model.patientLabOrdersList.length, @@ -134,11 +138,13 @@ class _LabsHomePageState extends State { width: 20, height: 160, decoration: BoxDecoration( - color: model.patientLabOrdersList[index].isLiveCareAppointment + color: model.patientLabOrdersList[index] + .isLiveCareAppointment ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), + : !model.patientLabOrdersList[index] + .isInOutPatient + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), @@ -150,17 +156,19 @@ class _LabsHomePageState extends State { quarterTurns: 3, child: Center( child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.patientLabOrdersList[index].isInOutPatient + model.patientLabOrdersList[index] + .isLiveCareAppointment ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -172,19 +180,26 @@ class _LabsHomePageState extends State { context, FadePage( page: LaboratoryResultPage( - patientLabOrders: model.patientLabOrdersList[index], + 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, + 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, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart deleted file mode 100644 index b160f48c..00000000 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ /dev/null @@ -1,1152 +0,0 @@ -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/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/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/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 '../../../routes.dart'; - -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 - 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']; - 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 - : isDischargedPatient?240:0, - ), - - Container( - height: !isSearchAndOut ? isDischargedPatient?MediaQuery - .of(context) - .size - .height * 0.64 : MediaQuery - .of(context) - .size - .height * 0.65 : MediaQuery - .of(context) - .size - .height * 0.69, - child: ListView( - children: [ - Container( - child: isSearchAndOut - ? 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.01, - 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.01, - 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, - 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.01, - 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'), - ], - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - 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, - 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(), - ), - ); - } -} - -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/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart new file mode 100644 index 00000000..44641b4b --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -0,0 +1,319 @@ +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/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/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.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/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 '../../../../routes.dart'; + +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 + 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']; + 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, + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + ), + Container( + height: !isSearchAndOut + ? isDischargedPatient + ? MediaQuery.of(context).size.height * 0.64 + : MediaQuery.of(context).size.height * 0.65 + : MediaQuery.of(context).size.height * 0.69, + child: ListView( + children: [ + Container( + child: isSearchAndOut + ? ProfileGridForSearch( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ) + : isInpatient + ? ProfileGridForInPatient( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + isDischargedPatient: + isDischargedPatient, + isFromSearch: isFromSearch, + ) + : ProfileGridForOther( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ), + ), + ], + ), + ), + ], + ), + 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, + 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(), + ), + ); + } +} + +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/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart new file mode 100644 index 00000000..457fe04e --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -0,0 +1,275 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +// ignore: must_be_immutable +class ProfileGridForInPatient extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + final bool isDischargedPatient; + final bool isFromSearch; + String from; + String to; + + ProfileGridForInPatient( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return 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, + 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'), + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart new file mode 100644 index 00000000..5b7112d6 --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -0,0 +1,309 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +// ignore: must_be_immutable +class ProfileGridForOther extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + String from; + String to; + + ProfileGridForOther( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return 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, + 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'), + ], + ), + ), + ], + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart new file mode 100644 index 00000000..ed3c4dfd --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -0,0 +1,164 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:flutter/material.dart'; + +import '../../../../routes.dart'; + +class ProfileGridForSearch extends StatelessWidget { + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; + final bool isInpatient; + String from; + String to; + + ProfileGridForSearch( + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.height, + this.isInpatient, this.from,this.to}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return 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, + 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'), + ], + ), + ), + ], + ); + } +} diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index d96a908a..4b8d224e 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -48,7 +48,11 @@ class _RadiologyHomePageState extends State { backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: isInpatient, + ), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -66,13 +70,13 @@ class _RadiologyHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Radiology', + TranslationBase.of(context).radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -87,13 +91,13 @@ class _RadiologyHomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Radiology', + TranslationBase.of(context).radiology, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Result', + TranslationBase.of(context).result, bold: true, fontSize: 22, ), @@ -113,7 +117,7 @@ class _RadiologyHomePageState extends State { )), ); }, - label: 'Apply for Radiology Order', + label: TranslationBase.of(context).applyForRadiologyOrder, ), ...List.generate( model.radiologyList.length, @@ -135,34 +139,36 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index].isLiveCareAppodynamicment + color: model.radiologyList[index] + .isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient - ? Colors.black - : Color(0xffa9a089), + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) - ), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index].isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index].isInOutPatient + model.radiologyList[index] + .isLiveCareAppodynamicment ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + .liveCare + .toUpperCase() + : !model.radiologyList[index] + .isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -170,19 +176,26 @@ class _RadiologyHomePageState extends State { 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, + 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], + finalRadiology: + model.radiologyList[index], patient: patient, ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index c99bb063..baebe130 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -7,6 +7,7 @@ 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/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -25,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_fiel import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { @@ -188,6 +190,7 @@ class _PrescriptionFormWidgetState extends State { Widget build(BuildContext context) { ListSelectDialog drugDialog; final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; @@ -258,7 +261,8 @@ class _PrescriptionFormWidgetState extends State { MainAxisAlignment.spaceBetween, children: [ AppText( - 'New Prescription Order', + TranslationBase.of(context) + .newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -284,7 +288,6 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -407,7 +410,8 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ AppText( - 'Order Type', + TranslationBase.of(context) + .orderType, fontWeight: FontWeight.w600, ), Radio( @@ -460,7 +464,10 @@ class _PrescriptionFormWidgetState extends State { if (strengthChar >= 5) { DrAppToastMsg .showErrorToast( - "Only 5 Digits allowed for strength"); + TranslationBase.of( + context) + .only5DigitsAllowedForStrength, + ); } }, onSubmit: (_) { @@ -554,7 +561,9 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - 'UNIT', + TranslationBase.of( + context) + .unit, units != null ? units[ 'description'] @@ -1066,9 +1075,14 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - "Box Quantity", + TranslationBase.of( + context) + .boxQuantity, box != null - ? "Box Quantity: " + + ? TranslationBase.of( + context) + .boxQuantity + + ": " + model .boxQuintity .toString() @@ -1124,14 +1138,18 @@ class _PrescriptionFormWidgetState extends State { selectedDate == null || units == null) { DrAppToastMsg.showErrorToast( - "Please Fill All Fields"); + TranslationBase.of( + context) + .pleaseFillAllFields); return; } if (_selectedMedication .isNarcotic == true) { DrAppToastMsg.showErrorToast( - "Narcotic medicine can only be prescribed from VIDA"); + TranslationBase.of( + context) + .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index af0f66e5..b29a2169 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -271,7 +271,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Direction', + TranslationBase.of(context).direction, color: Colors.grey, ), Expanded( @@ -286,7 +286,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Route', + TranslationBase.of(context).route, color: Colors.grey, ), AppText(" " + @@ -301,7 +301,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Refill', + TranslationBase.of(context).refill, color: Colors.grey, ), Expanded( @@ -316,7 +316,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Start Date ', + TranslationBase.of(context).startDate, color: Colors.grey, ), Expanded( @@ -332,7 +332,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Stop Date', + TranslationBase.of(context).stopDate, color: Colors.grey, ), Expanded( @@ -377,7 +377,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Status', + TranslationBase.of(context).status, color: Colors.grey, ), AppText(" " + @@ -392,7 +392,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { Row( children: [ AppText( - 'Processed', + TranslationBase.of(context).processed, color: Colors.grey, ), AppText(" " + diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index be212dc9..19620dda 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da 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/shared/app_scaffold_widget.dart'; @@ -28,16 +29,19 @@ class PrescriptionsPage extends StatelessWidget { bool isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - isSelectInpatient - ? model.getPrescriptionsInPatient(patient) - : 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,isInpatient: isInpatient,), + patient, + patientType ?? '0', + arrivalType, + isInpatient: isInpatient, + ), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, @@ -55,13 +59,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order', + TranslationBase.of(context).orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Prescriptions', + TranslationBase.of(context).prescriptions, bold: true, fontSize: 22, ), @@ -76,13 +80,13 @@ class PrescriptionsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order', + TranslationBase.of(context).orders, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Prescriptions', + TranslationBase.of(context).prescriptions, bold: true, fontSize: 22, ), @@ -96,7 +100,8 @@ class PrescriptionsPage extends StatelessWidget { addPrescriptionForm(context, model, patient, model.prescriptionList); }, - label: 'Apply for New Prescriptions Order', + label: TranslationBase.of(context) + .applyForNewPrescriptionsOrder, ), ...List.generate( model.prescriptionsList.length, @@ -140,7 +145,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Prescriptions Found'), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), @@ -209,8 +215,8 @@ class PrescriptionsPage extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Prescriptions Found In Patentiss'), + child: AppText(TranslationBase.of(context) + .noPrescriptionsFound), ) ], ), diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 7cc9818b..df748922 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -165,7 +165,8 @@ class _AddSelectedProcedureState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'Please Enter Procedure', + TranslationBase.of(context) + .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -187,7 +188,8 @@ class _AddSelectedProcedureState extends State { Container( width: MediaQuery.of(context).size.width * 0.85, child: AppTextFieldCustom( - hintText: 'Search Procedure here...', + hintText: TranslationBase.of(context) + .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, @@ -199,11 +201,15 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { - if(procedureName.text.isNotEmpty && procedureName.text.length>=3) - model.getProcedureCategory( - categoryName: procedureName.text); + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + categoryName: procedureName.text); else - DrAppToastMsg.showErrorToast('At least three Characters'); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); }, ), ), @@ -212,11 +218,15 @@ class _AddSelectedProcedureState extends State { ), InkWell( onTap: () { - if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) model.getProcedureCategory( categoryName: procedureName.text); else - DrAppToastMsg.showErrorToast('At least three Characters'); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); }, child: Icon( Icons.search, @@ -419,7 +429,9 @@ class _AddSelectedProcedureState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); return; } diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index b7bc2835..4a20dbaa 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -9,6 +9,7 @@ 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/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'; @@ -160,7 +161,7 @@ class _AddSelectedLabOrderState extends State { Row( children: [ AppText( - 'New Lab Order', + TranslationBase.of(context).applyForNewLabOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -218,7 +219,8 @@ class _AddSelectedLabOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: "Add Lab Order", //TranslationBase.of(context) + title: TranslationBase.of(context) + .addLabOrder, //TranslationBase.of(context) fontWeight: FontWeight.w700, //.addSelectedProcedures, color: Color(0xff359846), @@ -227,7 +229,9 @@ class _AddSelectedLabOrderState extends State { onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, + ); return; } diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 4c1c8468..3f19e7f9 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -9,6 +9,7 @@ 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/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'; @@ -161,7 +162,7 @@ class _AddSelectedRadiologyOrderState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - 'New Radiology Order', + TranslationBase.of(context).newRadiologyOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -216,15 +217,15 @@ class _AddSelectedRadiologyOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: 'Add Radiology Order', + title: TranslationBase.of(context).addRadiologyOrder, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { //print(entityList.toString()); onPressed: if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .fillTheMandatoryProcedureDetails); return; } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 51122999..7e18055d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -8,11 +8,11 @@ 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-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/material.dart'; - import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { @@ -32,15 +32,21 @@ class ProcedureScreen extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; return BaseView( - onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType,), + onModelReady: (model) => 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,isInpatient: isInpatient,), + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -57,13 +63,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order Test or', + TranslationBase.of(context).orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Procedure', + TranslationBase.of(context).procedure, bold: true, fontSize: 22, ), @@ -78,13 +84,13 @@ class ProcedureScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Order Test or', + TranslationBase.of(context).orderTestOr, style: "caption2", color: Colors.black, fontSize: 13, ), AppText( - 'Procedure', + TranslationBase.of(context).procedure, bold: true, fontSize: 22, ), @@ -135,7 +141,7 @@ class ProcedureScreen extends StatelessWidget { height: 10, ), AppText( - 'Add More Procedure', + TranslationBase.of(context).addMoreProcedure, color: Colors.grey[600], fontWeight: FontWeight.w600, ) @@ -183,8 +189,9 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) - + if (model.state == ViewState.ErrorLocal || + (model.procedureList.isNotEmpty && + model.procedureList[0].entityList.isEmpty)) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -195,7 +202,9 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '), + child: AppText(model.procedureList.isEmpty + ? model.error + : 'No Procedure Found '), ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 56c2f710..cc6513d0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,9 +100,11 @@ 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 inPatientLabel => + localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get inPatientAll => + localizedValues['inPatientAll'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -1176,7 +1178,8 @@ 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]; @@ -1247,8 +1250,59 @@ class TranslationBase { String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; + String get pleaseEnterProcedure => + localizedValues["pleaseEnterProcedure"][locale.languageCode]; + String get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; + String get atLeastThreeCharacters => + localizedValues["atLeastThreeCharacters"][locale.languageCode]; + String get searchProcedureHere => + localizedValues["searchProcedureHere"][locale.languageCode]; + String get noInsuranceApprovalFound => + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; + String get procedure => localizedValues["procedure"][locale.languageCode]; + String get stopDate => localizedValues["stopDate"][locale.languageCode]; + String get processed => localizedValues["processed"][locale.languageCode]; + String get direction => localizedValues["direction"][locale.languageCode]; + String get refill => localizedValues["refill"][locale.languageCode]; + String get medicationHasBeenAdded => + localizedValues["medicationHasBeenAdded"][locale.languageCode]; + String get newPrescriptionOrder => + localizedValues["newPrescriptionOrder"][locale.languageCode]; + String get pleaseFillAllFields => + localizedValues["pleaseFillAllFields"][locale.languageCode]; + String get narcoticMedicineCanOnlyBePrescribedFromVida => + localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] + [locale.languageCode]; + String get only5DigitsAllowedForStrength => + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; + String get unit => localizedValues["unit"][locale.languageCode]; + String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; + String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; + String get applyForRadiologyOrder => + localizedValues["applyForRadiologyOrder"][locale.languageCode]; + String get applyForNewLabOrder => + localizedValues["applyForNewLabOrder"][locale.languageCode]; + String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; + String get addRadiologyOrder => + localizedValues["addRadiologyOrder"][locale.languageCode]; + String get newRadiologyOrder => + localizedValues["newRadiologyOrder"][locale.languageCode]; + String get orderDate => localizedValues["orderDate"][locale.languageCode]; + String get examType => localizedValues["examType"][locale.languageCode]; + String get health => localizedValues["health"][locale.languageCode]; + String get summary => localizedValues["summary"][locale.languageCode]; + String get applyForNewPrescriptionsOrder => + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; + String get noPrescriptionsFound => + localizedValues["noPrescriptionsFound"][locale.languageCode]; + String get noMedicalFileFound => + localizedValues["noMedicalFileFound"][locale.languageCode]; + String get insurance22 => localizedValues["insurance22"][locale.languageCode]; + String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index b9312289..49ad8f4e 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/screens/patients/profile/profile_screen/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:flutter/material.dart'; diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index e63acba2..66aaac09 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -49,7 +49,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - height: MediaQuery.of(context).size.height * 0.075, + // height: 60,//MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart index a163ef24..2b0aae7c 100644 --- a/lib/widgets/shared/doctor_card_insurance.dart +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -59,7 +59,8 @@ class DoctorCardInsurance extends StatelessWidget { topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), - color: approvalStatus == "Approved" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), @@ -79,7 +80,8 @@ class DoctorCardInsurance extends StatelessWidget { children: [ AppText( "$approvalStatus", - color: approvalStatus == "Approved" + color: approvalStatus == "Approved" || + approvalStatus == "تمت الموافقة" ? Color(0xff359846) : Color(0xffD02127), ), diff --git a/lib/widgets/shared/text_fields/app_text_form_field.dart b/lib/widgets/shared/text_fields/app_text_form_field.dart index 8fed3cd8..cf5f0abf 100644 --- a/lib/widgets/shared/text_fields/app_text_form_field.dart +++ b/lib/widgets/shared/text_fields/app_text_form_field.dart @@ -48,6 +48,7 @@ class AppTextFormField extends FormField { }, textInputAction: textInputAction, onFieldSubmitted: onFieldSubmitted, + decoration: InputDecoration( hintText: hintText, suffixIcon: prefix, diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..e9386145 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0"