project refactoring

app_translation
hussam al-habibeh 5 years ago
parent 9457e04825
commit bc340693ba

@ -1,12 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart'; 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 '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 'package:doctor_app_flutter/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 'package:doctor_app_flutter/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 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_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/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.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); setState(ViewState.Busy);
await _outPatientService.getPatientFileInformation( await _outPatientService
patientSearchRequestModel); .getPatientFileInformation(patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {
error = _outPatientService.error; error = _outPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -84,11 +85,12 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} }
getPatientBasedOnDate(
{item,
getPatientBasedOnDate ( PatientSearchRequestModel patientSearchRequestModel,
{item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, PatientType selectedPatientType,
bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async { bool isSearchWithKeyInfo,
OutPatientFilterType outPatientFilterType}) async {
String dateTo; String dateTo;
String dateFrom; String dateFrom;
if (OutPatientFilterType.Previous == outPatientFilterType) { if (OutPatientFilterType.Previous == outPatientFilterType) {
@ -128,11 +130,8 @@ class PatientSearchViewModel extends BaseViewModel {
currentModel.to = dateTo; currentModel.to = dateTo;
await getOutPatient(currentModel, isLocalBusy: true); await getOutPatient(currentModel, isLocalBusy: true);
filterData = _outPatientService.patientList; filterData = _outPatientService.patientList;
} }
PatientInPatientService _inPatientService = PatientInPatientService _inPatientService =
locator<PatientInPatientService>(); locator<PatientInPatientService>();
@ -146,7 +145,7 @@ class PatientSearchViewModel extends BaseViewModel {
Future getInPatientList(PatientSearchRequestModel requestModel, Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false}) async { {bool isMyInpatient = false}) async {
await getDoctorProfile(); await getDoctorProfile();
setState(ViewState.Busy); setState(ViewState.Busy);
if (inPatientList.length == 0) if (inPatientList.length == 0)
await _inPatientService.getInPatientList(requestModel, false); await _inPatientService.getInPatientList(requestModel, false);
@ -163,12 +162,11 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
filteredInPatientItems.clear(); filteredInPatientItems.clear();
if (inPatientList.length > 0) if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList);
filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
void clearPatientList(){ void clearPatientList() {
_inPatientService.inPatientList = []; _inPatientService.inPatientList = [];
_inPatientService.myInPatientList = []; _inPatientService.myInPatientList = [];
} }
@ -197,6 +195,4 @@ class PatientSearchViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
} }
} }

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/soap/SOAP_service.dart'; import 'package:doctor_app_flutter/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/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/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/medicine_service.dart'; import 'package:doctor_app_flutter/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/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';

@ -1,16 +1,18 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; 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/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/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.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_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.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.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 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/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/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_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/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.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/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/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/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_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'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
@ -503,7 +504,9 @@ class _HomeScreenState extends State<HomeScreen> {
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
"My\n"+TranslationBase.of(context).inPatient, "My\n" +
TranslationBase.of(context)
.inPatient,
color: Colors.white, color: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,

@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget {
_PatientInPatientScreenState createState() => _PatientInPatientScreenState(); _PatientInPatientScreenState createState() => _PatientInPatientScreenState();
} }
class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -103,12 +104,18 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
indicatorWeight: 1.0, indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, 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], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 0,
tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), TranslationBase.of(context).inPatientAll,
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), 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<PatientInPatientScreen> 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( return Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
isActive isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: 4,
borderWidth: 0), borderWidth: 0),
@ -164,9 +169,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isActive color: isActive ? Colors.white : Color(0xFFD02127),
? Colors.white
: Color(0xFFD02127),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: Center( child: Center(

@ -1,9 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_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/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/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -42,18 +43,19 @@ class OutPatientsScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
OutPatientsScreen( OutPatientsScreen(
{this.patientSearchForm, {this.patientSearchForm,
this.selectedType, this.selectedType,
this.isAppbar = true, this.isAppbar = true,
this.arrivalType, this.arrivalType,
this.isView, this.isView,
this.selectedPatientType, this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); this.isInpatient = false,
this.searchKey,
this.isSearchAndOut = false});
@override @override
_OutPatientsScreenState createState() => _OutPatientsScreenState(); _OutPatientsScreenState createState() => _OutPatientsScreenState();
@ -82,20 +84,11 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
_times = [ _times = [
TranslationBase TranslationBase.of(context).previous,
.of(context) TranslationBase.of(context).today,
.previous, TranslationBase.of(context).nextWeek,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.nextWeek,
]; ];
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context)
.size;
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
@ -106,148 +99,155 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: "My Out patient", title: "My Out patient",
), ),
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
children: [ children: [
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils decoration: TextFieldsUtils.containerBorderDecoration(
.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC),
Color(0Xffffffff), borderRadius: 4, borderWidth: 0),
Color(0xFFCCCCCC), child: Row(
borderRadius: 4, mainAxisSize: MainAxisSize.max,
borderWidth: 0), crossAxisAlignment: CrossAxisAlignment.center,
child: Row( children: _times.map((item) {
mainAxisSize: MainAxisSize.max, bool _isActive =
crossAxisAlignment: CrossAxisAlignment.center, _times[_activeLocation] == item ? true : false;
children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item
? true
: false;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
setState(() { setState(() {
_activeLocation = _times.indexOf(item); _activeLocation = _times.indexOf(item);
outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; outPatientFilterType = _activeLocation == 0
_controller.text=""; ? OutPatientFilterType.Previous
}); : _activeLocation == 1
model.searchData(""); ? OutPatientFilterType.Today
FocusScope.of(context).requestFocus(new FocusNode()); : OutPatientFilterType.NextWeek;
GifLoaderDialogUtils.showMyDialog(context); _controller.text = "";
await model.getPatientBasedOnDate(item: item, });
selectedPatientType: widget.selectedPatientType, model.searchData("");
patientSearchRequestModel: widget FocusScope.of(context).requestFocus(new FocusNode());
.patientSearchRequestModel, GifLoaderDialogUtils.showMyDialog(context);
isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); await model.getPatientBasedOnDate(
GifLoaderDialogUtils.hideDialog(context); item: item,
}, selectedPatientType: widget.selectedPatientType,
child: Center( patientSearchRequestModel:
child: Container( widget.patientSearchRequestModel,
height: screenSize.height * 0.070, isSearchWithKeyInfo: widget.isSearchWithKeyInfo,
decoration: TextFieldsUtils.containerBorderDecoration( outPatientFilterType: outPatientFilterType);
_isActive GifLoaderDialogUtils.hideDialog(context);
? Color(0xFFD02127 /*B8382B*/) },
: Color(0xFFEAEAEA), child: Center(
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), child: Container(
borderRadius: 4, height: screenSize.height * 0.070,
borderWidth: 0), decoration:
child: Center( TextFieldsUtils.containerBorderDecoration(
child: Row( _isActive
mainAxisAlignment: MainAxisAlignment.center, ? Color(0xFFD02127 /*B8382B*/)
children: [ : Color(0xFFEAEAEA),
AppText( _isActive
item, ? Color(0xFFD02127)
fontSize: SizeConfig.textMultiplier * 1.8, : Color(0xFFEAEAEA),
color: _isActive ? Colors.white : Color(0xFF2B353E), borderRadius: 4,
fontWeight: FontWeight.w700, borderWidth: 0),
), child: Center(
_isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( child: Row(
padding: EdgeInsets.all(2), mainAxisAlignment: MainAxisAlignment.center,
margin: EdgeInsets.symmetric(horizontal: 5), children: [
decoration: AppText(
new BoxDecoration( item,
color: Colors.white, fontSize: SizeConfig.textMultiplier * 1.8,
borderRadius: color: _isActive
BorderRadius.circular( ? Colors.white
50), : Color(0xFF2B353E),
), fontWeight: FontWeight.w700,
constraints: BoxConstraints( ),
minWidth: 20, _isActive &&
minHeight: 20, _activeLocation != 0 &&
), model.state == ViewState.Idle
child: new Text( ? Container(
model.filterData.length.toString(), padding: EdgeInsets.all(2),
style: new TextStyle( margin: EdgeInsets.symmetric(
color: Colors.red, horizontal: 5),
fontSize: 10 decoration: new BoxDecoration(
), color: Colors.white,
textAlign: borderRadius:
TextAlign.center, BorderRadius.circular(50),
), ),
):Container(), 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), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, top: 10),
left: 10, top: 10),
child: AppText( child: AppText(
TranslationBase.of( TranslationBase.of(context).searchPatientName,
context)
.searchPatientName,
fontSize: 13, fontSize: 13,
)), )),
AppTextFormField( AppTextFormField(
// focusNode: focusProject, // focusNode: focusProject,
controller: _controller, controller: _controller,
borderColor: Colors.white borderColor: Colors.white,
,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(
_activeLocation !=0 _activeLocation != 0
? DoctorApp.filter_1 ? DoctorApp.filter_1
: FontAwesomeIcons.slidersH, : FontAwesomeIcons.slidersH,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: padding: EdgeInsets.only(bottom: 30),
EdgeInsets.only( onPressed: _activeLocation != 0
bottom: 30), ? null
onPressed: _activeLocation !=0 ? null : () { : () {
Navigator.push(context, MaterialPageRoute( Navigator.push(
builder: (BuildContext context) => context,
FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); MaterialPageRoute(
}, builder: (BuildContext context) =>
FilterDatePage(
outPatientFilterType:
outPatientFilterType,
patientSearchViewModel:
model,
)));
},
), ),
onChanged: (String str) { onChanged: (String str) {
model.searchData(str); model.searchData(str);
}), }),
@ -255,58 +255,60 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
Expanded( Expanded(
child: Container( child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.youDontHaveAnyPatient, .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,
), ),
); )
else : ListView.builder(
return SizedBox(); 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();
})),
), ),
], ],
) )),
),
); );
} }
} }

@ -31,10 +31,8 @@ class PatientsSearchResultScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
PatientsSearchResultScreen( PatientsSearchResultScreen(
{ {this.selectedPatientType,
this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
@ -52,7 +50,6 @@ class _PatientsSearchResultScreenState
int clinicId; int clinicId;
AuthViewModel authProvider; AuthViewModel authProvider;
String patientType; String patientType;
String patientTypeTitle; String patientTypeTitle;
var selectedFilter = 1; var selectedFilter = 1;
@ -63,77 +60,69 @@ class _PatientsSearchResultScreenState
PatientModel patient; PatientModel patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { if (!widget.isSearchWithKeyInfo &&
widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel); await model.getOutPatient(widget.patientSearchRequestModel);
} else { } else {
await model.getPatientFileInformation(widget.patientSearchRequestModel); await model
.getPatientFileInformation(widget.patientSearchRequestModel);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient", appBarTitle: "Search Patient",
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: "Search for ${widget.searchKey}", title: "Search for ${widget.searchKey}",
), ),
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
children: [ children: [
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)), border: Border.all(
border: Border.all( width: 1.0,
width: 1.0, color: HexColor("#CCCCCC"),
color: HexColor("#CCCCCC"), ),
), color: Colors.white),
color: Colors.white), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: children: [
CrossAxisAlignment.start, Padding(
children: [ padding: EdgeInsets.only(left: 10, top: 10),
Padding( child: AppText(
padding: EdgeInsets.only( TranslationBase.of(context).searchPatientName,
left: 10, top: 10), fontSize: 13,
child: AppText( )),
TranslationBase.of( AppTextFormField(
context) // focusNode: focusProject,
.searchPatientName, controller: _controller,
fontSize: 13, borderColor: Colors.white,
)), prefix: IconButton(
AppTextFormField( icon: Icon(
// focusNode: focusProject, DoctorApp.filter_1,
controller: _controller, color: Colors.black,
borderColor: Colors.white, ),
prefix: IconButton( iconSize: 20,
icon: Icon( padding: EdgeInsets.only(bottom: 30),
DoctorApp.filter_1,
color: Colors.black,
), ),
iconSize: 20, onChanged: (String str) {
padding: model.searchData(str);
EdgeInsets.only( }),
bottom: 30), ])),
), SizedBox(
onChanged: (String str) { height: 10.0,
model.searchData(str); ),
}), Expanded(
])), child: Container(
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
@ -152,8 +141,8 @@ class _PatientsSearchResultScreenState
patientInfo: model.filterData[index], patientInfo: model.filterData[index],
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isFromSearch:widget.isSearchAndOut, isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -168,17 +157,17 @@ class _PatientsSearchResultScreenState
"isSearch": widget.isSearch, "isSearch": widget.isSearch,
"isInpatient": widget.isInpatient, "isInpatient": widget.isInpatient,
"arrivalType": "7", "arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut, "isSearchAndOut":
widget.isSearchAndOut,
}); });
}, },
// isFromSearch: widget.isSearch, // isFromSearch: widget.isSearch,
), ),
); );
})), })),
), ),
], ],
) )),
),
); );
} }
} }

@ -32,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget {
_AddReplayOnReferralPatientState(); _AddReplayOnReferralPatientState();
} }
class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> { class _AddReplayOnReferralPatientState
extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
@ -45,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient>
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -108,7 +107,7 @@ class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient>
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty? 130:70, height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -1,7 +1,7 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/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/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.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/config.dart';
import 'package:doctor_app_flutter/config/size_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/enum/viewstate.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 '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/Prescriptions/prescription_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/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/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';

@ -1,8 +1,9 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_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/enum/viewstate.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/Prescriptions/post_prescrition_req_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/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/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -50,11 +52,11 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(!projectsProvider.isArabic) if (!projectsProvider.isArabic)
AppText( AppText(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
TranslationBase.of(context).sickLeave, TranslationBase.of(context).sickLeave,
fontSize: 24, fontSize: 24,
@ -193,9 +195,10 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils DateUtils.getDayMonthYearDateFormatted(
.convertStringToDate( DateUtils
item.startDate)), .convertStringToDate(
item.startDate)),
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
), ),
@ -212,8 +215,10 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils DateUtils
.convertStringToDate( .getDayMonthYearDateFormatted(
DateUtils
.convertStringToDate(
item.endDate, item.endDate,
)), )),
fontWeight: fontWeight:

Loading…
Cancel
Save