|
|
|
|
@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
@ -33,7 +34,6 @@ class _InPatientScreenState extends State<InPatientScreen>
|
|
|
|
|
|
|
|
|
|
int selectedMapId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
@ -55,170 +55,114 @@ class _InPatientScreenState extends State<InPatientScreen>
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final screenSize = MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size;
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
|
|
|
|
|
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return BaseView<PatientSearchViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
model.clearPatientList();
|
|
|
|
|
if (widget.specialClinic != null) {
|
|
|
|
|
await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
|
|
|
|
|
await model
|
|
|
|
|
.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
|
|
|
|
|
requestModel.nursingStationID =
|
|
|
|
|
model.specialClinicalCareMappingList[0].nursingStationID;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
requestModel.clinicID = 0;
|
|
|
|
|
await model.getInPatientList(requestModel);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) =>
|
|
|
|
|
AppScaffold(
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBar: InPatientHeader(),
|
|
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
|
|
|
|
margin: EdgeInsets.only(top: 50),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.black, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.inPatient,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.8,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF2B353E),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (model.specialClinicalCareMappingList.isNotEmpty &&
|
|
|
|
|
widget.specialClinic != null &&
|
|
|
|
|
_activeTab != 2)
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * .3,
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
dropdownColor: Colors.white,
|
|
|
|
|
iconEnabledColor: Colors.black,
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: selectedMapId == null ? model
|
|
|
|
|
.specialClinicalCareMappingList[0]
|
|
|
|
|
.nursingStationID : selectedMapId,
|
|
|
|
|
iconSize: 25,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return model
|
|
|
|
|
.specialClinicalCareMappingList
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.center,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(2),
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(2),
|
|
|
|
|
decoration:
|
|
|
|
|
new BoxDecoration(
|
|
|
|
|
color:
|
|
|
|
|
Colors.red[800],
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.circular(
|
|
|
|
|
20),
|
|
|
|
|
),
|
|
|
|
|
constraints:
|
|
|
|
|
BoxConstraints(
|
|
|
|
|
minWidth: 20,
|
|
|
|
|
minHeight: 20,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.specialClinicalCareMappingList
|
|
|
|
|
.length
|
|
|
|
|
.toString(),
|
|
|
|
|
color:
|
|
|
|
|
Colors.white,
|
|
|
|
|
fontSize:
|
|
|
|
|
projectsProvider
|
|
|
|
|
.isArabic
|
|
|
|
|
? 10
|
|
|
|
|
: 11,
|
|
|
|
|
textAlign:
|
|
|
|
|
TextAlign
|
|
|
|
|
.center,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
if (model.specialClinicalCareMappingList.isNotEmpty &&
|
|
|
|
|
widget.specialClinic != null &&
|
|
|
|
|
_activeTab != 2)
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * .3,
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
dropdownColor: Colors.white,
|
|
|
|
|
iconEnabledColor: Colors.black,
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: selectedMapId == null
|
|
|
|
|
? model.specialClinicalCareMappingList[0].nursingStationID
|
|
|
|
|
: selectedMapId,
|
|
|
|
|
iconSize: 25,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
|
return model.specialClinicalCareMappingList.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(2),
|
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
|
minWidth: 20,
|
|
|
|
|
minHeight: 20,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.specialClinicalCareMappingList.length
|
|
|
|
|
.toString(),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize:
|
|
|
|
|
projectsProvider.isArabic ? 10 : 11,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
AppText(item.description,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
textAlign: TextAlign.end),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) async {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedMapId = newValue;
|
|
|
|
|
});
|
|
|
|
|
model.clearPatientList();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppText(item.description,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
textAlign: TextAlign.end),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) async {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedMapId = newValue;
|
|
|
|
|
});
|
|
|
|
|
model.clearPatientList();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
PatientSearchRequestModel requestModel = PatientSearchRequestModel(
|
|
|
|
|
nursingStationID: selectedMapId, clinicID: 0);
|
|
|
|
|
await model.getInPatientList(requestModel, isLocalBusy: true);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context);
|
|
|
|
|
if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
items: model
|
|
|
|
|
.specialClinicalCareMappingList
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.description,
|
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
|
),
|
|
|
|
|
value: item.nursingStationID,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
PatientSearchRequestModel requestModel =
|
|
|
|
|
PatientSearchRequestModel(
|
|
|
|
|
nursingStationID: selectedMapId, clinicID: 0);
|
|
|
|
|
await model.getInPatientList(requestModel,
|
|
|
|
|
isLocalBusy: true);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
items: model.specialClinicalCareMappingList.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.description,
|
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
|
),
|
|
|
|
|
value: item.nursingStationID,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
extendBodyBehindAppBar: false,
|
|
|
|
|
@ -249,8 +193,8 @@ class _InPatientScreenState extends State<InPatientScreen>
|
|
|
|
|
tabWidget(screenSize, _activeTab == 0,
|
|
|
|
|
TranslationBase.of(context).inPatientAll,
|
|
|
|
|
counter: model.inPatientList.length),
|
|
|
|
|
tabWidget(
|
|
|
|
|
screenSize, _activeTab == 1, TranslationBase.of(context).inPatient,
|
|
|
|
|
tabWidget(screenSize, _activeTab == 1,
|
|
|
|
|
TranslationBase.of(context).myInPatientTitle,
|
|
|
|
|
counter: model.myIinPatientList.length),
|
|
|
|
|
tabWidget(screenSize, _activeTab == 2,
|
|
|
|
|
TranslationBase.of(context).discharged),
|
|
|
|
|
@ -267,7 +211,7 @@ class _InPatientScreenState extends State<InPatientScreen>
|
|
|
|
|
controller: _tabController,
|
|
|
|
|
children: [
|
|
|
|
|
InPatientListPage(false, model),
|
|
|
|
|
InPatientListPage(true,model),
|
|
|
|
|
InPatientListPage(true, model),
|
|
|
|
|
DischargedPatient(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|