From bc340693baab146305e87c7af11d86e35c6558e2 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 6 May 2021 14:12:32 +0300 Subject: [PATCH] project refactoring --- .../prescription/prescription_service.dart | 16 +- .../viewModel/PatientSearchViewModel.dart | 30 +- lib/core/viewModel/SOAP_view_model.dart | 7 +- lib/core/viewModel/medicine_view_model.dart | 7 +- .../viewModel/prescription_view_model.dart | 12 +- lib/screens/home/home_screen.dart | 7 +- .../patients/PatientsInPatientScreen.dart | 33 +- .../out_patient/out_patient_screen.dart | 352 +++++++++--------- .../patient_search_result_screen.dart | 125 +++---- .../referral/AddReplayOnReferralPatient.dart | 7 +- .../subjective/medication/add_medication.dart | 2 +- .../prescription/add_prescription_form.dart | 7 +- .../update_prescription_form.dart | 5 +- lib/screens/sick-leave/add-sickleave.dart | 27 +- 14 files changed, 321 insertions(+), 316 deletions(-) diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index 7df9d38b..daca52b9 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -1,12 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; + import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/item_by_medicine_request_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_req_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_request_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; + import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 418cae3a..c9dede3e 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -71,10 +71,11 @@ class PatientSearchViewModel extends BaseViewModel { } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService.getPatientFileInformation( - patientSearchRequestModel); + await _outPatientService + .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; setState(ViewState.Error); @@ -84,11 +85,12 @@ class PatientSearchViewModel extends BaseViewModel { } } - - - getPatientBasedOnDate ( - {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, - bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async { + getPatientBasedOnDate( + {item, + PatientSearchRequestModel patientSearchRequestModel, + PatientType selectedPatientType, + bool isSearchWithKeyInfo, + OutPatientFilterType outPatientFilterType}) async { String dateTo; String dateFrom; if (OutPatientFilterType.Previous == outPatientFilterType) { @@ -128,11 +130,8 @@ class PatientSearchViewModel extends BaseViewModel { currentModel.to = dateTo; await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; - } - - PatientInPatientService _inPatientService = locator(); @@ -146,7 +145,7 @@ class PatientSearchViewModel extends BaseViewModel { Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false}) async { await getDoctorProfile(); - setState(ViewState.Busy); + setState(ViewState.Busy); if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false); @@ -163,12 +162,11 @@ class PatientSearchViewModel extends BaseViewModel { setState(ViewState.BusyLocal); await getDoctorProfile(); filteredInPatientItems.clear(); - if (inPatientList.length > 0) - filteredInPatientItems.addAll(inPatientList); + if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList); setState(ViewState.Idle); } - void clearPatientList(){ + void clearPatientList() { _inPatientService.inPatientList = []; _inPatientService.myInPatientList = []; } @@ -197,6 +195,4 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } } - - } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index d73a6ab7..8b789cbc 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/soap/SOAP_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart'; + import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index b57b2ad5..d49b8cc3 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/medicine_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; + import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 2e959a3d..89c7c182 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,16 +1,18 @@ 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/Prescription_model.dart'; + import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart'; + import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index ffb6d00b..fcb74718 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -3,7 +3,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; + import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; @@ -503,7 +504,9 @@ class _HomeScreenState extends State { Container( padding: EdgeInsets.all(10), child: AppText( - "My\n"+TranslationBase.of(context).inPatient, + "My\n" + + TranslationBase.of(context) + .inPatient, color: Colors.white, textAlign: TextAlign.start, fontSize: 15, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 796485da..cff3b8ee 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget { _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } -class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin{ - +class _PatientInPatientScreenState extends State + with SingleTickerProviderStateMixin { TabController _tabController; int _activeTab = 0; @@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State with Si child: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( - preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), child: Container( height: MediaQuery.of(context).size.height * 0.070, decoration: BoxDecoration( @@ -103,12 +104,18 @@ class _PatientInPatientScreenState extends State with Si indicatorWeight: 1.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), + tabWidget(screenSize, _activeTab == 0, + TranslationBase.of(context).inPatientAll, + counter: model.inPatientList.length), + tabWidget( + screenSize, _activeTab == 1, "My InPatients", + counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, + TranslationBase.of(context).discharged), ], ), ), @@ -137,15 +144,13 @@ class _PatientInPatientScreenState extends State with Si ); } - Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){ - + Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { return Center( child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), borderRadius: 4, borderWidth: 0), @@ -164,9 +169,7 @@ class _PatientInPatientScreenState extends State with Si width: 15, height: 15, decoration: BoxDecoration( - color: isActive - ? Colors.white - : Color(0xFFD02127), + color: isActive ? Colors.white : Color(0xFFD02127), shape: BoxShape.circle, ), child: Center( diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 3968a2b6..c8b547b7 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,9 +1,10 @@ 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 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.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/model/patient_muse/PatientSearchRequestModel.dart'; + import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -42,18 +43,19 @@ class OutPatientsScreen extends StatefulWidget { final bool isSearchAndOut; final String searchKey; - OutPatientsScreen( {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView, - this.selectedPatientType, - this.patientSearchRequestModel, - this.isSearchWithKeyInfo = true, - this.isSearch = false, - this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false, + this.searchKey, + this.isSearchAndOut = false}); @override _OutPatientsScreenState createState() => _OutPatientsScreenState(); @@ -82,20 +84,11 @@ class _OutPatientsScreenState extends State { Widget build(BuildContext context) { authProvider = Provider.of(context); _times = [ - TranslationBase - .of(context) - .previous, - TranslationBase - .of(context) - .today, - TranslationBase - .of(context) - .nextWeek, + 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 { @@ -106,148 +99,155 @@ class _OutPatientsScreenState extends State { isShowAppBar: true, appBar: PatientSearchHeader( title: "My Out patient", - ), baseViewModel: model, body: Column( children: [ 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: _times.map((item) { - bool _isActive = _times[_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: _times.map((item) { + bool _isActive = + _times[_activeLocation] == item ? true : false; - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _times.indexOf(item); - outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; - _controller.text=""; - }); - model.searchData(""); - FocusScope.of(context).requestFocus(new FocusNode()); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); - 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: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - _isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.symmetric(horizontal: 5), - decoration: - new BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.circular( - 50), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - model.filterData.length.toString(), - style: new TextStyle( - color: Colors.red, - fontSize: 10 - ), - textAlign: - TextAlign.center, - ), - ):Container(), - ], - ), + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _times.indexOf(item); + outPatientFilterType = _activeLocation == 0 + ? OutPatientFilterType.Previous + : _activeLocation == 1 + ? OutPatientFilterType.Today + : OutPatientFilterType.NextWeek; + _controller.text = ""; + }); + model.searchData(""); + FocusScope.of(context).requestFocus(new FocusNode()); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate( + item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: + widget.patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo, + outPatientFilterType: outPatientFilterType); + 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: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive + ? Colors.white + : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + _isActive && + _activeLocation != 0 && + model.state == ViewState.Idle + ? Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.symmetric( + horizontal: 5), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.circular(50), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + model.filterData.length.toString(), + style: new TextStyle( + color: Colors.red, + fontSize: 10), + textAlign: TextAlign.center, + ), + ) + : Container(), + ], ), ), ), ), - ); - }).toList(), - ), + ), + ); + }).toList(), ), + ), SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"), ), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only( - left: 10, top: 10), + padding: EdgeInsets.only(left: 10, top: 10), child: AppText( - TranslationBase.of( - context) - .searchPatientName, + TranslationBase.of(context).searchPatientName, fontSize: 13, )), AppTextFormField( - // focusNode: focusProject, + // focusNode: focusProject, controller: _controller, - borderColor: Colors.white - , + borderColor: Colors.white, prefix: IconButton( icon: Icon( - _activeLocation !=0 + _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - onPressed: _activeLocation !=0 ? null : () { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); - }, + padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + FilterDatePage( + outPatientFilterType: + outPatientFilterType, + patientSearchViewModel: + model, + ))); + }, ), - onChanged: (String str) { model.searchData(str); }), @@ -255,58 +255,60 @@ class _OutPatientsScreenState extends State { SizedBox( height: 10.0, ), - Expanded( child: Container( child: model.filterData.isEmpty ? Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, - ), - ) - : ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.filterData.length, - itemBuilder: (BuildContext ctxt, int index) { - if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43)) - return - Padding( - padding: EdgeInsets.all(8.0), - child: PatientCard( - patientInfo: model.filterData[index], - patientType: patientType, - arrivalType: arrivalType, - isFromSearch:widget.isSearchAndOut, - isInpatient: widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); - }, - // isFromSearch: widget.isSearch, + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, ), - ); - else - return SizedBox(); - })), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + if (_activeLocation != 0 || + (model.filterData[index].patientStatusType != + null && + model.filterData[index] + .patientStatusType == + 43)) + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isFromSearch: widget.isSearchAndOut, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + else + return SizedBox(); + })), ), ], - ) - ), + )), ); } } diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 9fd92aba..32e7627b 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -31,10 +31,8 @@ class PatientsSearchResultScreen extends StatefulWidget { final bool isSearchAndOut; final String searchKey; - PatientsSearchResultScreen( - { - this.selectedPatientType, + {this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, @@ -52,7 +50,6 @@ class _PatientsSearchResultScreenState int clinicId; AuthViewModel authProvider; - String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -63,77 +60,69 @@ class _PatientsSearchResultScreenState PatientModel patient; - @override Widget build(BuildContext context) { authProvider = Provider.of(context); return BaseView( onModelReady: (model) async { - if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + if (!widget.isSearchWithKeyInfo && + widget.selectedPatientType == PatientType.OutPatient) { await model.getOutPatient(widget.patientSearchRequestModel); - } else { - await model.getPatientFileInformation(widget.patientSearchRequestModel); - + await model + .getPatientFileInformation(widget.patientSearchRequestModel); } }, builder: (_, model, w) => AppScaffold( - appBarTitle: "Search Patient", - isShowAppBar: true, + appBarTitle: "Search Patient", + isShowAppBar: true, appBar: PatientSearchHeader( title: "Search for ${widget.searchKey}", ), - baseViewModel: model, - body: Column( - children: [ - 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, + baseViewModel: model, + body: Column( + children: [ + 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), ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox( - height: 10.0, - ), - Expanded( - child: Container( + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( child: model.filterData.isEmpty ? Center( child: ErrorMessage( @@ -152,8 +141,8 @@ class _PatientsSearchResultScreenState patientInfo: model.filterData[index], patientType: patientType, arrivalType: arrivalType, - isFromSearch:widget.isSearchAndOut, - isInpatient: widget.isInpatient, + isFromSearch: widget.isSearchAndOut, + isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -168,17 +157,17 @@ class _PatientsSearchResultScreenState "isSearch": widget.isSearch, "isInpatient": widget.isInpatient, "arrivalType": "7", - "isSearchAndOut": widget.isSearchAndOut, + "isSearchAndOut": + widget.isSearchAndOut, }); }, - // isFromSearch: widget.isSearch, + // isFromSearch: widget.isSearch, ), ); })), ), - ], - ) - ), + ], + )), ); } } diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 1cec9092..a2ea0ebb 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -32,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget { _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState extends State { - +class _AddReplayOnReferralPatientState + extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -45,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State super.initState(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -108,7 +107,7 @@ class _AddReplayOnReferralPatientState extends State ), ), bottomSheet: Container( - height: replayOnReferralController.text.isNotEmpty? 130:70, + height: replayOnReferralController.text.isNotEmpty ? 130 : 70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index c7b54423..69475926 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -1,7 +1,7 @@ // ignore: must_be_immutable import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 9282182a..aabf7b2f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -2,9 +2,10 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; + import 'package:doctor_app_flutter/core/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'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 6cb4d70d..5d4c6a5b 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -1,8 +1,9 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; + import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 7f63f4d3..c7f6d993 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; + import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; @@ -50,11 +52,11 @@ class AddSickLeavScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(!projectsProvider.isArabic) - AppText( - TranslationBase.of(context).patient, - fontWeight: FontWeight.bold, - ), + if (!projectsProvider.isArabic) + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), AppText( TranslationBase.of(context).sickLeave, fontSize: 24, @@ -193,9 +195,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils - .convertStringToDate( - item.startDate)), + DateUtils.getDayMonthYearDateFormatted( + DateUtils + .convertStringToDate( + item.startDate)), fontWeight: FontWeight.bold, ), @@ -212,8 +215,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils - .convertStringToDate( + DateUtils + .getDayMonthYearDateFormatted( + DateUtils + .convertStringToDate( item.endDate, )), fontWeight: