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/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';

@ -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<PatientInPatientService>();
@ -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();
}
}
}

@ -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';

@ -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';

@ -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';

@ -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<HomeScreen> {
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,

@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget {
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
}
class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{
class _PatientInPatientScreenState extends State<PatientInPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
int _activeTab = 0;
@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> 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<PatientInPatientScreen> 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<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(
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<PatientInPatientScreen> 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(

@ -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<OutPatientsScreen> {
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<PatientSearchViewModel>(
onModelReady: (model) async {
@ -106,148 +99,155 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
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<OutPatientsScreen> {
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();
})),
),
],
)
),
)),
);
}
}

@ -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<PatientSearchViewModel>(
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,
),
);
})),
),
],
)
),
],
)),
);
}
}

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

@ -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';

@ -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';

@ -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';

@ -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:

Loading…
Cancel
Save