|
|
|
|
@ -18,7 +18,18 @@ class InPatientListPage extends StatefulWidget {
|
|
|
|
|
final bool isMyInPatient;
|
|
|
|
|
final PatientSearchViewModel patientSearchViewModel;
|
|
|
|
|
|
|
|
|
|
InPatientListPage(this.isMyInPatient, this.patientSearchViewModel);
|
|
|
|
|
final bool isAllClinic;
|
|
|
|
|
final bool showBottomSheet;
|
|
|
|
|
final String selectedClinicName;
|
|
|
|
|
final Function onChangeValue;
|
|
|
|
|
|
|
|
|
|
InPatientListPage(
|
|
|
|
|
{this.isMyInPatient,
|
|
|
|
|
this.patientSearchViewModel,
|
|
|
|
|
this.selectedClinicName,
|
|
|
|
|
this.onChangeValue,
|
|
|
|
|
this.isAllClinic,
|
|
|
|
|
this.showBottomSheet});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_InPatientListPageState createState() => _InPatientListPageState();
|
|
|
|
|
@ -28,10 +39,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
TextEditingController _searchController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
bool isSortDes = false;
|
|
|
|
|
bool isAllClinic = true;
|
|
|
|
|
bool hasQuery = false;
|
|
|
|
|
bool showBottomSheet = false;
|
|
|
|
|
String selectedClinicName;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
@ -47,7 +55,8 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
if (!widget.isMyInPatient)
|
|
|
|
|
if (!widget.isMyInPatient &&
|
|
|
|
|
widget.patientSearchViewModel.inPatientList.isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 10.0, right: 10, top: 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
@ -58,14 +67,14 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: 1,
|
|
|
|
|
groupValue: isAllClinic ? 1 : 2,
|
|
|
|
|
groupValue: widget.isAllClinic ? 1 : 2,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = true;
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
selectedClinicName = null;
|
|
|
|
|
});
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: true,
|
|
|
|
|
showBottomSheet: false,
|
|
|
|
|
selectedClinicName: null);
|
|
|
|
|
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.setDefaultInPatientList();
|
|
|
|
|
});
|
|
|
|
|
@ -79,48 +88,55 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = true;
|
|
|
|
|
selectedClinicName = null;
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
});
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: true,
|
|
|
|
|
showBottomSheet: false,
|
|
|
|
|
selectedClinicName: null);
|
|
|
|
|
|
|
|
|
|
widget.patientSearchViewModel.setDefaultInPatientList();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
if (widget
|
|
|
|
|
.patientSearchViewModel.InpatientClinicList.isNotEmpty)
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (widget.patientSearchViewModel.InpatientClinicList
|
|
|
|
|
.length >
|
|
|
|
|
0) showBottomSheet = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: 2,
|
|
|
|
|
groupValue: isAllClinic ? 1 : 2,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
if (widget.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList.length >
|
|
|
|
|
0) showBottomSheet = true;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
activeColor: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
selectedClinicName ?? TranslationBase.of(context).clinicSelect,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10),
|
|
|
|
|
child: Icon(FontAwesomeIcons.sortDown))
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
0) {
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: false,
|
|
|
|
|
showBottomSheet: true,
|
|
|
|
|
selectedClinicName: widget.selectedClinicName);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: 2,
|
|
|
|
|
groupValue: widget.isAllClinic ? 1 : 2,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
if (widget.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList.length >
|
|
|
|
|
0) {
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: false,
|
|
|
|
|
showBottomSheet: true,
|
|
|
|
|
selectedClinicName:
|
|
|
|
|
widget.selectedClinicName);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
activeColor: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
widget.selectedClinicName ??
|
|
|
|
|
TranslationBase.of(context).clinicSelect,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10),
|
|
|
|
|
child: Icon(FontAwesomeIcons.sortDown))
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -148,7 +164,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
hasQuery = true;
|
|
|
|
|
});
|
|
|
|
|
widget.patientSearchViewModel.filterSearchResults(value,
|
|
|
|
|
isAllClinic: isAllClinic,
|
|
|
|
|
isAllClinic: widget.isAllClinic,
|
|
|
|
|
isMyInPatient: widget.isMyInPatient);
|
|
|
|
|
}),
|
|
|
|
|
Positioned(
|
|
|
|
|
@ -167,7 +183,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
widget.patientSearchViewModel.sortInPatient(
|
|
|
|
|
isDes: isSortDes,
|
|
|
|
|
isAllClinic: isAllClinic,
|
|
|
|
|
isAllClinic: widget.isAllClinic,
|
|
|
|
|
isMyInPatient: widget.isMyInPatient);
|
|
|
|
|
isSortDes = !isSortDes;
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
@ -181,7 +197,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
? (widget.isMyInPatient &&
|
|
|
|
|
widget.patientSearchViewModel.myIinPatientList.length > 0)
|
|
|
|
|
? ListOfMyInpatient(
|
|
|
|
|
isAllClinic: isAllClinic,
|
|
|
|
|
isAllClinic: widget.isAllClinic,
|
|
|
|
|
hasQuery: hasQuery,
|
|
|
|
|
patientSearchViewModel: widget.patientSearchViewModel)
|
|
|
|
|
: widget.patientSearchViewModel.filteredInPatientItems
|
|
|
|
|
@ -193,7 +209,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
0)
|
|
|
|
|
? NoData()
|
|
|
|
|
: ListOfAllInPatient(
|
|
|
|
|
isAllClinic: isAllClinic,
|
|
|
|
|
isAllClinic: widget.isAllClinic,
|
|
|
|
|
hasQuery: hasQuery,
|
|
|
|
|
patientSearchViewModel:
|
|
|
|
|
widget.patientSearchViewModel)
|
|
|
|
|
@ -206,7 +222,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: !showBottomSheet
|
|
|
|
|
bottomSheet: !widget.showBottomSheet
|
|
|
|
|
? Container(
|
|
|
|
|
height: 0,
|
|
|
|
|
)
|
|
|
|
|
@ -224,9 +240,10 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
});
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: widget.isAllClinic,
|
|
|
|
|
showBottomSheet: false,
|
|
|
|
|
selectedClinicName: widget.selectedClinicName);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(DoctorApp.close_1,
|
|
|
|
|
size: SizeConfig.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
@ -257,13 +274,13 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = false;
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
selectedClinicName = widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList[index];
|
|
|
|
|
});
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: false,
|
|
|
|
|
showBottomSheet: false,
|
|
|
|
|
selectedClinicName: widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList[index]);
|
|
|
|
|
|
|
|
|
|
widget.patientSearchViewModel.filterByClinic(
|
|
|
|
|
clinicName: widget.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList[index]);
|
|
|
|
|
@ -273,16 +290,15 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
Radio(
|
|
|
|
|
value: widget.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList[index],
|
|
|
|
|
groupValue: selectedClinicName,
|
|
|
|
|
groupValue: widget.selectedClinicName,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = false;
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
selectedClinicName = widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList[index];
|
|
|
|
|
});
|
|
|
|
|
widget.onChangeValue(
|
|
|
|
|
isAllClinic: false,
|
|
|
|
|
showBottomSheet: false,
|
|
|
|
|
selectedClinicName: widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.InpatientClinicList[index]);
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.filterByClinic(clinicName: value);
|
|
|
|
|
});
|
|
|
|
|
|