|
|
|
|
@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
|
|
|
|
|
@ -41,6 +41,8 @@ class PatientsScreenNew extends StatefulWidget {
|
|
|
|
|
final PatientType selectedPatientType;
|
|
|
|
|
final PatientSearchRequestModel patientSearchRequestModel;
|
|
|
|
|
final bool isSearchWithKeyInfo;
|
|
|
|
|
final bool isSearch;
|
|
|
|
|
final bool isInpatient;
|
|
|
|
|
|
|
|
|
|
PatientsScreenNew(
|
|
|
|
|
{this.patientSearchForm,
|
|
|
|
|
@ -50,7 +52,9 @@ class PatientsScreenNew extends StatefulWidget {
|
|
|
|
|
this.isView,
|
|
|
|
|
this.selectedPatientType,
|
|
|
|
|
this.patientSearchRequestModel,
|
|
|
|
|
this.isSearchWithKeyInfo = true});
|
|
|
|
|
this.isSearchWithKeyInfo = true,
|
|
|
|
|
this.isSearch = false,
|
|
|
|
|
this.isInpatient = false});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_PatientsScreenNewState createState() => _PatientsScreenNewState();
|
|
|
|
|
@ -78,9 +82,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
|
|
|
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
|
|
|
|
|
|
|
|
|
|
int _activeLocation = 0;
|
|
|
|
|
bool isInpatient = false;
|
|
|
|
|
String patientType;
|
|
|
|
|
bool isSearch = false;
|
|
|
|
|
String patientTypeTitle;
|
|
|
|
|
var _isLoading = true;
|
|
|
|
|
var selectedFilter = 1;
|
|
|
|
|
@ -205,144 +207,82 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
|
|
|
appBarTitle: "Search Patient",
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: model.patientList.isEmpty
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
if (widget.selectedPatientType ==
|
|
|
|
|
PatientType.OutPatient &&
|
|
|
|
|
!widget.isSearchWithKeyInfo)
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
border: Border.all(color: Colors.grey),
|
|
|
|
|
borderRadius: BorderRadius.circular(10)),
|
|
|
|
|
child: ClinicList(
|
|
|
|
|
clinicId: clinicId,
|
|
|
|
|
onClinicChange: (newValue) {
|
|
|
|
|
clinicId = newValue;
|
|
|
|
|
changeClinic(newValue, context, model);
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery.of(context).size.height *
|
|
|
|
|
0.03),
|
|
|
|
|
// child: _locationBar(context)
|
|
|
|
|
child:
|
|
|
|
|
(widget.selectedPatientType == PatientType.OutPatient &&
|
|
|
|
|
widget.isSearchWithKeyInfo)
|
|
|
|
|
? _locationBar(context, model)
|
|
|
|
|
: Container(),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery.of(context).size.height * 0.10),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 100,
|
|
|
|
|
),
|
|
|
|
|
Image.asset('assets/images/no-data.png'),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: AppText(TranslationBase.of(context)
|
|
|
|
|
.youDontHaveAnyPatient),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
body: Container(
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
child: ListView(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child:model.patientList.isEmpty
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.fromLTRB(
|
|
|
|
|
0, 0, 0, 0), //250
|
|
|
|
|
child:
|
|
|
|
|
DrAppCircularProgressIndeicator(),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Column(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
BottomSheetTitle(title: "Search for 1111",),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
decoration: TextFieldsUtils.containerBorderDecoration(
|
|
|
|
|
Color(0Xffffffff), Color(0xFFCCCCCC),
|
|
|
|
|
borderRadius: 4, borderWidth: 0),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: _locations.map((item) {
|
|
|
|
|
bool _isActive = _locations[_activeLocation] == item ? true : false;
|
|
|
|
|
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// _activeTab = _locations.indexOf(item);
|
|
|
|
|
// });
|
|
|
|
|
setState(() {
|
|
|
|
|
_activeLocation = _locations.indexOf(item);
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getPatientBasedOnDate(item: item,
|
|
|
|
|
selectedPatientType: widget.selectedPatientType,
|
|
|
|
|
patientSearchRequestModel: widget
|
|
|
|
|
.patientSearchRequestModel,
|
|
|
|
|
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
},
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
decoration: TextFieldsUtils.containerBorderDecoration(
|
|
|
|
|
_isActive
|
|
|
|
|
? Color(0xFFD02127 /*B8382B*/)
|
|
|
|
|
: Color(0xFFEAEAEA),
|
|
|
|
|
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
|
|
|
|
borderRadius: 4,
|
|
|
|
|
borderWidth: 0),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
|
|
|
color: _isActive ? Colors.white : Color(0xFF2B353E),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
if(widget.isSearch)
|
|
|
|
|
HeaderInSearch(
|
|
|
|
|
title: "Search for 1111",
|
|
|
|
|
),
|
|
|
|
|
if(!widget.isSearch && !widget.isInpatient)
|
|
|
|
|
HeaderInSearch(
|
|
|
|
|
title: "Search for 1111",
|
|
|
|
|
),
|
|
|
|
|
if(!widget.isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
decoration: TextFieldsUtils
|
|
|
|
|
.containerBorderDecoration(
|
|
|
|
|
Color(0Xffffffff),
|
|
|
|
|
Color(0xFFCCCCCC),
|
|
|
|
|
borderRadius: 4,
|
|
|
|
|
borderWidth: 0),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: _locations.map((item) {
|
|
|
|
|
bool _isActive = _locations[_activeLocation] == item
|
|
|
|
|
? true
|
|
|
|
|
: false;
|
|
|
|
|
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// _activeTab = _locations.indexOf(item);
|
|
|
|
|
// });
|
|
|
|
|
setState(() {
|
|
|
|
|
_activeLocation = _locations.indexOf(item);
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getPatientBasedOnDate(item: item,
|
|
|
|
|
selectedPatientType: widget.selectedPatientType,
|
|
|
|
|
patientSearchRequestModel: widget
|
|
|
|
|
.patientSearchRequestModel,
|
|
|
|
|
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
},
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
decoration: TextFieldsUtils.containerBorderDecoration(
|
|
|
|
|
_isActive
|
|
|
|
|
? Color(0xFFD02127 /*B8382B*/)
|
|
|
|
|
: Color(0xFFEAEAEA),
|
|
|
|
|
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
|
|
|
|
borderRadius: 4,
|
|
|
|
|
borderWidth: 0),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
|
|
|
color: _isActive ? Colors.white : Color(0xFF2B353E),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
SizedBox(height: 18.5),
|
|
|
|
|
Container(
|
|
|
|
|
@ -390,18 +330,6 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height *
|
|
|
|
|
0.03),
|
|
|
|
|
// child: _locationBar(context)
|
|
|
|
|
child: widget.selectedPatientType ==
|
|
|
|
|
PatientType.OutPatient && !widget.isSearchWithKeyInfo
|
|
|
|
|
? _locationBar(context, model)
|
|
|
|
|
: Container(),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
@ -419,7 +347,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
|
|
|
arrivalType:
|
|
|
|
|
arrivalType,
|
|
|
|
|
isInpatient:
|
|
|
|
|
isInpatient,
|
|
|
|
|
widget.isInpatient,
|
|
|
|
|
onTap: () {
|
|
|
|
|
// TODO change the parameter to daynamic
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
@ -432,9 +360,9 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
|
|
|
"from": widget.patientSearchRequestModel.from,
|
|
|
|
|
"to": widget.patientSearchRequestModel.from,
|
|
|
|
|
"isSearch":
|
|
|
|
|
isSearch,
|
|
|
|
|
widget.isSearch,
|
|
|
|
|
"isInpatient":
|
|
|
|
|
isInpatient,
|
|
|
|
|
widget.isInpatient,
|
|
|
|
|
"arrivalType":
|
|
|
|
|
"7",
|
|
|
|
|
});
|
|
|
|
|
@ -566,80 +494,4 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
|
|
|
|
|
Helpers.showErrorToast(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO Replace it with time bar.
|
|
|
|
|
Widget _locationBar(BuildContext _context, model) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.0619,
|
|
|
|
|
width: SizeConfig.screenWidth * 0.94,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(0Xffffffff),
|
|
|
|
|
borderRadius: BorderRadius.circular(12.5),
|
|
|
|
|
// border: Border.all(
|
|
|
|
|
// width: 0.5,
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: _locations.map((item) {
|
|
|
|
|
bool _isActive = _locations[_activeLocation] == item ? true : false;
|
|
|
|
|
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.058,
|
|
|
|
|
width: SizeConfig.screenWidth * 0.2334,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
bottomRight: Radius.circular(12.5),
|
|
|
|
|
topRight: Radius.circular(12.5),
|
|
|
|
|
topLeft: Radius.circular(9.5),
|
|
|
|
|
bottomLeft: Radius.circular(9.5)),
|
|
|
|
|
color: _isActive ? HexColor("#B8382B") : Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: _isActive
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors.black, //Colors.black,
|
|
|
|
|
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
_activeLocation = _locations.indexOf(item);
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getPatientBasedOnDate(item: item,
|
|
|
|
|
selectedPatientType: widget.selectedPatientType,
|
|
|
|
|
patientSearchRequestModel: widget
|
|
|
|
|
.patientSearchRequestModel,
|
|
|
|
|
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
}),
|
|
|
|
|
_isActive
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
bottomRight: Radius.circular(10),
|
|
|
|
|
topRight: Radius.circular(10)),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
height: 1,
|
|
|
|
|
width: SizeConfig.screenWidth * 0.23,
|
|
|
|
|
)
|
|
|
|
|
: Container()
|
|
|
|
|
]);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|