From 05a3ca73001ecea5d6e3b9c9400a4fec3ce0b5f1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 11:40:27 +0300 Subject: [PATCH 1/4] add doctor profile --- lib/screens/home/home_screen.dart | 2 +- .../patient_search_screen_new.dart | 6 +- .../patient_search/patients_screen_new.dart | 347 +++++++++--------- 3 files changed, 183 insertions(+), 172 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 1435c942..307b635c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -559,7 +559,7 @@ class _HomeScreenState extends State { isSearch: false, isInpatient: false, patientSearchRequestModel: - PatientSearchRequestModel(from: date, to: date), + PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID), selectedPatientType: PatientType.OutPatient, isSearchWithKeyInfo: false, diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index c101567a..e1a22170 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class PatientSearchScreenNew extends StatefulWidget { @override @@ -26,9 +28,11 @@ class _PatientSearchScreenNewState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; + AuthViewModel authProvider; @override Widget build(BuildContext context) { + authProvider =Provider.of(context); return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( @@ -248,7 +252,7 @@ class _PatientSearchScreenNewState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel(); + PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID); if (showOther) { patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index ab1e9594..a4236870 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -100,187 +100,194 @@ class _PatientsScreenNewState extends State { title: "Search for ${widget.searchKey}", ), baseViewModel: model, - body: Container( - color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ + body: Column( + children: [ + if(!widget.isInpatient && !widget.isSearch) Container( - child: Column( - children: [ - if(!widget.isInpatient && !widget.isSearch) - Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils - .containerBorderDecoration( - Color(0Xffffffff), - Color(0xFFCCCCCC), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item - ? true - : false; + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils + .containerBorderDecoration( + Color(0Xffffffff), + Color(0xFFCCCCCC), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item + ? true + : false; - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), - ), + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), - ); - }).toList(), + ), + ), ), ), + ); + }).toList(), + ), + ), - SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox( - height: 10.0, - ), - SizedBox( - height: 10.0, + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( + // color: Colors.grey[200], + child: ListView( + scrollDirection: Axis.vertical, + children: [ Container( - child: model.patientList.isNotEmpty - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: model.filterData - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": - widget.isSearch, - "isInpatient": - widget.isInpatient, - "arrivalType": - "7", - }); - }, - isFromSearch: widget.isSearch, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], + child: Column( + children: [ + + SizedBox( + height: 10.0, ), - )), + Container( + child: model.patientList.isNotEmpty + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: model.filterData + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + isInpatient: + widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, + "isSearch": + widget.isSearch, + "isInpatient": + widget.isInpatient, + "arrivalType": + "7", + }); + }, + isFromSearch: widget.isSearch, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: AppText( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + )), + ], + ), + ) ], ), - ) - ], - ), + ), + ), + ], ) ), ); From 60eb7adab119ab6bc06b29545be4dcb73584380b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 11:54:25 +0300 Subject: [PATCH 2/4] hot fixes --- lib/config/localized_values.dart | 3 +- .../service/patient-vital-signs-service.dart | 47 ++- .../patient-vital-sign-viewmodel.dart | 2 +- lib/routes.dart | 1 + .../medical-file/medical_file_page.dart | 4 +- .../insurance_approval_screen_patient.dart | 4 +- .../profile/in_patient_profile_screen.dart | 227 +++++++++++++ .../profile/lab_result/labs_home_page.dart | 4 +- .../profile/note/progress_note_screen.dart | 2 +- .../profile/patient_profile_screen.dart | 310 +++++++++++++++++- .../radiology/radiology_home_page.dart | 9 +- .../refer-patient-screen-in-patient.dart | 4 +- .../prescription/prescriptions_page.dart | 3 +- lib/screens/procedures/procedure_screen.dart | 6 +- lib/screens/sick-leave/add-sickleave.dart | 2 + lib/util/translations_delegate_base.dart | 1 + ...ent-profile-header-new-design-app-bar.dart | 51 ++- 17 files changed, 617 insertions(+), 63 deletions(-) create mode 100644 lib/screens/patients/profile/in_patient_profile_screen.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e47a8707..ea99a982 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -48,6 +48,7 @@ const Map> localizedValues = { 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, @@ -769,7 +770,7 @@ const Map> localizedValues = { 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, "liveCare": {"en": "Live Care", "ar": "لايف كير"}, - "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "sendSuc": { diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 4dd16859..fe6dcb5b 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -39,25 +39,29 @@ class VitalSignsService extends BaseService { patientVitalSigns = null; hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientId; // patient.patientMRN - // body['AppointmentNo'] = patient.appointmentNo; - // body['EpisodeID'] = patient.episodeNo; + body['PatientID'] = patient.patientId; // patient.patientMRN + body['InOutPatientType'] = 1; body['PatientTypeID'] = 1; body['PatientType'] = 1; body['DeviceTypeID'] = 1; body['isDentalAllowedBackend'] = false; - body['From'] = fromDate; - body['To'] = toDate; + body['ProjectID'] = patient.projectId; + // body['From'] = fromDate; + // body['To'] = toDate; + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; + } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN_DATA, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['VitalSignsHistory'] != null) { - response['VitalSignsHistory'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -67,31 +71,26 @@ class VitalSignsService extends BaseService { ); } - Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; body['PatientTypeID'] = patient.patientType; - // if(isInPatient){ - body['InOutPatientType'] = 0; - // }else { - // body['InOutPatientType'] = 2; - // } + // if(isInPatient){ + body['InOutPatientType'] = 0; + // }else { + // body['InOutPatientType'] = 2; + // } - if (patient.appointmentNo != null && patient.projectId != null) { - body['TransNo'] = patient.appointmentNo; - body['ProjectID'] = patient.projectId; - } await baseAppClient.postPatient( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + });} }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index f9cbfc8d..cd02f538 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -56,7 +56,7 @@ class VitalSignsViewModel extends BaseViewModel { if (isInPatient) { await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); } else { - await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); } diff --git a/lib/routes.dart b/lib/routes.dart index c9a77e70..91c3eaed 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -35,6 +35,7 @@ const String LOGIN = 'login'; const String VERIFICATION_METHODS = 'verification-methods'; const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; +const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; const String MEDICAL_FILE = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index f0ee6445..b7587efb 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -24,14 +24,14 @@ class _MedicalFilePageState extends State { patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType), + patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2225e289..ab3abbe9 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -33,7 +33,7 @@ class _InsuranceApprovalScreenNewState PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: patient.admissionNo != null ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) @@ -45,7 +45,7 @@ class _InsuranceApprovalScreenNewState builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType), + patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart new file mode 100644 index 00000000..bce4c725 --- /dev/null +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -0,0 +1,227 @@ +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import '../../../routes.dart'; + + +class InPatientProfileScreen extends StatefulWidget { + @override + _InPatientProfileScreenState createState() => _InPatientProfileScreenState(); +} + +class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + String patientType; + String arrivalType; + String from; + String to; + + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + } + + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + ), + ), + )); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index abfcb282..5677d374 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -44,7 +44,7 @@ class _LabsHomePageState extends State { backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType), + patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -158,7 +158,7 @@ class _LabsHomePageState extends State { .toUpperCase() : !labOrder.isInOutPatient ? TranslationBase.of(context) - .inPatient + .inPatientLabel .toUpperCase() : TranslationBase.of(context) .outpatient diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 443bff8d..d7506402 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -79,7 +79,7 @@ class _ProgressNoteState extends State { backgroundColor: Theme.of(context).scaffoldBackgroundColor, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoProgressNote) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 730e8a26..49943159 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -71,9 +71,9 @@ class _PatientProfileScreenState extends Statewith SingleT baseViewModel: patientViewModel, appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: SingleChildScrollView( - child: Column( + child: isFromSearch ?Column( children: [ DefaultTabController( length: 2, @@ -165,6 +165,7 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, + isInPatient: isInpatient, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), @@ -192,6 +193,7 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, + isInPatient: isInpatient, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), @@ -201,7 +203,7 @@ class _PatientProfileScreenState extends Statewith SingleT arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: "Health", - //TranslationBase.of(context).medicalReport, + isInPatient: isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), @@ -212,7 +214,7 @@ class _PatientProfileScreenState extends Statewith SingleT isDisable: true, route: MEDICAL_FILE, nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, + isInPatient: isInpatient, nameLine2: "Report", //Report //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), @@ -226,6 +228,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -234,7 +237,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -244,7 +247,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: "Summery", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -264,7 +267,7 @@ class _PatientProfileScreenState extends Statewith SingleT crossAxisCount: 3, children: [ PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -276,7 +279,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -287,7 +290,7 @@ class _PatientProfileScreenState extends Statewith SingleT "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -307,7 +310,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -316,7 +319,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -326,7 +329,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -336,7 +339,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -346,7 +349,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -357,7 +360,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -370,7 +373,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -383,6 +386,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -404,6 +408,280 @@ class _PatientProfileScreenState extends Statewith SingleT ), ], + ):isInpatient?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, + 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, + 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'), + ], + ):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'), + // if (selectedPatientType != 7) + 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: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + 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: 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_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + 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'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + 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'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + 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 6c709e83..81e0e6cf 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -47,7 +47,7 @@ class _RadiologyHomePageState extends State { backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -155,7 +155,7 @@ class _RadiologyHomePageState extends State { .toUpperCase() : !model.radiologyList[index].isInOutPatient ? TranslationBase.of(context) - .inPatient + .inPatientLabel .toUpperCase() : TranslationBase.of(context) .outpatient @@ -172,9 +172,8 @@ class _RadiologyHomePageState extends State { invoiceNO: '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, - appointmentDate: !isInpatient - ? model.radiologyList[index].orderDate - : model.radiologyList[index].reportDate, + appointmentDate: model.radiologyList[index].orderDate?? + model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index ae3fcee7..197cf6bc 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -48,7 +48,7 @@ class _PatientMakeInPatientReferralScreenState patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; referToList = List(); dynamic sameBranch = { "id": 1, @@ -70,7 +70,7 @@ class _PatientMakeInPatientReferralScreenState appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + patient, patientType, arrivalType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 19ce09e4..a1a5b962 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -24,6 +24,7 @@ class PrescriptionsPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => @@ -35,7 +36,7 @@ class PrescriptionsPage extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType), + patient, patientType ?? '0', arrivalType,isInpatient: isInpatient,), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 2a3a851c..51122999 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -30,17 +30,17 @@ class ProcedureScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType), + model.getProcedure(mrn: patient.patientId, patientType: patientType,), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType), + patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 3b05d8f4..6ee37745 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -21,6 +21,7 @@ class AddSickLeavScreen extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), @@ -32,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget { patient, routeArgs['patientType'] ?? "0", routeArgs['arrivalType'] ?? "0", + isInpatient: isInpatient, ), body: SingleChildScrollView( child: Column(children: [ diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3d431f9d..6602722c 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,6 +100,7 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 48454af4..5faa82a4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -17,9 +17,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final String patientType; final String arrivalType; final double height; + final bool isInpatient; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false}); @override Widget build(BuildContext context) { @@ -38,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? 200 : height, + height: height == 0 ? isInpatient? 210:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -254,7 +255,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age??'' + " : ", + text: TranslationBase.of(context).age+ " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: @@ -265,6 +266,50 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), ), ), + if(isInpatient) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patient.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: patient.admissionDate == null + ? "" + : "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ]))), + if (patient.admissionDate != null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 15, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ) ], ), ), From 4c493d8ea680326f6a58e71d3aab90c6f6aebbab Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 12:16:12 +0300 Subject: [PATCH 3/4] fix issue in patients_screen --- .../viewModel/PatientSearchViewModel.dart | 1 + .../patient_search/patients_screen_new.dart | 117 ++++++------------ 2 files changed, 40 insertions(+), 78 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 59f8c9c6..b670205d 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -124,6 +124,7 @@ class PatientSearchViewModel extends BaseViewModel{ currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; + currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index a4236870..5de98242 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; @@ -208,85 +208,46 @@ class _PatientsScreenNewState extends State { ), Expanded( child: Container( - // color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: Column( - children: [ - - SizedBox( - height: 10.0, - ), - Container( - child: model.patientList.isNotEmpty - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: model.filterData - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": - widget.isSearch, - "isInpatient": - widget.isInpatient, - "arrivalType": - "7", - }); - }, - isFromSearch: widget.isSearch, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + }); + }, + isFromSearch: widget.isSearch, ), - )), - ], - ), - ) - ], - ), + ); + })), ), - ), ], ) ), From 21fd90ea8c1aa1d3d8c433e93cf9dad5fa291e27 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 12:32:01 +0300 Subject: [PATCH 4/4] hot fixes --- .../viewModel/PatientSearchViewModel.dart | 2 +- .../patients/PatientsInPatientScreen.dart | 92 ++++++++++++------- lib/util/dr_app_shared_pref.dart | 3 +- 3 files changed, 64 insertions(+), 33 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 59f8c9c6..9312f255 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -152,7 +152,7 @@ class PatientSearchViewModel extends BaseViewModel{ setState(ViewState.Busy); else setState(ViewState.BusyLocal); - await _inPatientService.getInPatientList(requestModel, isMyInpatient); + await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 2a3f3839..7d41b3cb 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -101,32 +101,60 @@ class _PatientInPatientScreenState extends State { // const SizedBox( // height: 16, // ), - ...model.filteredInPatientItems.map((item) { - return PatientCard( - patientInfo: item, - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + ...List.generate(model.filteredInPatientItems.length, (index) { + if(_activeTab == 0) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": item, - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - }).toList(), + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else return SizedBox(); + }), + SizedBox(height: 15,) ], ), ), @@ -173,12 +201,14 @@ class _PatientInPatientScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - GifLoaderDialogUtils.showMyDialog( - context); - await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1, isFirstTime: false); - GifLoaderDialogUtils.hideDialog( - context); + if (_activeTab==0) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getInPatientList(requestModel, + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog( + context); + } }, child: Center( child: Container( diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index 2f6f3232..bac296bf 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -92,7 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - prefs.clear(); + var vvas= await prefs.clear(); + var asd; } remove(String key) async {