|
|
|
@ -12,6 +12,8 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/profile/patient-page-header-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
@ -36,17 +38,23 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
final _estimatedCostController = TextEditingController();
|
|
|
|
|
final _expectedDaysController = TextEditingController();
|
|
|
|
|
final _otherDepartmentsInterventionsController = TextEditingController();
|
|
|
|
|
final _treatmentLineController = TextEditingController();
|
|
|
|
|
final _complicationsController = TextEditingController();
|
|
|
|
|
final _otherProceduresController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
DateTime _expectedAdmissionDate;
|
|
|
|
|
|
|
|
|
|
dynamic _selectedFloor;
|
|
|
|
|
dynamic _selectedWard;
|
|
|
|
|
dynamic _selectedRoomCategory;
|
|
|
|
|
dynamic _selectedAdmissionType;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
String patientType = routeArgs['patientType'];
|
|
|
|
|
String arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
AdmissionRequest admissionRequest = routeArgs['admission-data'];
|
|
|
|
|
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
@ -55,6 +63,7 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
return BaseView<AdmissionRequestViewModel>(
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).admissionRequest,
|
|
|
|
|
body: GestureDetector(
|
|
|
|
|
onTap: () {
|
|
|
|
@ -70,145 +79,159 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
PatientPageHeaderWidget(patient),
|
|
|
|
|
PatientProfileHeaderNewDesign(
|
|
|
|
|
patient, patientType, arrivalType),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 16, horizontal: 16),
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
AppText(
|
|
|
|
|
"${TranslationBase.of(context).admission}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.6,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"${TranslationBase.of(context).request}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.postPlansEstimatedCost,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.estimatedCost,
|
|
|
|
|
null,
|
|
|
|
|
false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: _estimatedCostController,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
|
RegExp(ONLY_NUMBERS))
|
|
|
|
|
],
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
)),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).estimatedCost,
|
|
|
|
|
controller: _estimatedCostController,
|
|
|
|
|
inputType: TextInputType.number,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
|
RegExp(ONLY_NUMBERS))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).postPlans,
|
|
|
|
|
null,
|
|
|
|
|
false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context).postPlans,
|
|
|
|
|
controller: _postPlansEstimatedCostController,
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
inputType: TextInputType.multiline,
|
|
|
|
|
minLines: 4,
|
|
|
|
|
maxLines: 6,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.otherDepartmentsInterventions,
|
|
|
|
|
null,
|
|
|
|
|
false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller:
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.otherDepartmentsInterventions,
|
|
|
|
|
controller:
|
|
|
|
|
_otherDepartmentsInterventionsController,
|
|
|
|
|
keyboardType: TextInputType.multiline,
|
|
|
|
|
minLines: 2,
|
|
|
|
|
maxLines: 4,
|
|
|
|
|
)),
|
|
|
|
|
inputType: TextInputType.multiline,
|
|
|
|
|
minLines: 2,
|
|
|
|
|
maxLines: 4,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).otherInformation,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2.5,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.expectedDays,
|
|
|
|
|
null,
|
|
|
|
|
false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: _expectedDaysController,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
|
RegExp(ONLY_NUMBERS))
|
|
|
|
|
],
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
)),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).expectedDays,
|
|
|
|
|
controller: _expectedDaysController,
|
|
|
|
|
inputType: TextInputType.number,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
|
RegExp(ONLY_NUMBERS))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (_expectedAdmissionDate == null) {
|
|
|
|
|
_expectedAdmissionDate = DateTime.now();
|
|
|
|
|
}
|
|
|
|
|
_selectDate(context, _expectedAdmissionDate,
|
|
|
|
|
(picked) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_expectedAdmissionDate = picked;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.expectedAdmissionDate,
|
|
|
|
|
_expectedAdmissionDate != null
|
|
|
|
|
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.expectedAdmissionDate,
|
|
|
|
|
dropDownText: _expectedAdmissionDate != null
|
|
|
|
|
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
enabled: false,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onClick: () {
|
|
|
|
|
if (_expectedAdmissionDate == null) {
|
|
|
|
|
_expectedAdmissionDate = DateTime.now();
|
|
|
|
|
}
|
|
|
|
|
_selectDate(context, _expectedAdmissionDate,
|
|
|
|
|
(picked) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_expectedAdmissionDate = picked;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.floorList != null &&
|
|
|
|
|
model.floorList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText: TranslationBase.of(context).floor,
|
|
|
|
|
dropDownText: _selectedFloor != null
|
|
|
|
|
? _selectedFloor['description']
|
|
|
|
|
: null,
|
|
|
|
|
enabled: false,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
onClick: model.floorList != null &&
|
|
|
|
|
model.floorList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'floorID',
|
|
|
|
|
model.floorList, (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedFloor = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getFloors().then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.floorList.length > 0) {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'floorID',
|
|
|
|
@ -217,52 +240,47 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
_selectedFloor = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getFloors().then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.floorList.length > 0) {
|
|
|
|
|
openListDialogField('description',
|
|
|
|
|
'floorID', model.floorList,
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedFloor = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).floor,
|
|
|
|
|
_selectedFloor != null
|
|
|
|
|
? _selectedFloor['description']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.wardList != null &&
|
|
|
|
|
model.wardList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText: TranslationBase.of(context).ward,
|
|
|
|
|
dropDownText: _selectedWard != null
|
|
|
|
|
? _selectedWard['description']
|
|
|
|
|
: null,
|
|
|
|
|
enabled: false,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
onClick: model.wardList != null &&
|
|
|
|
|
model.wardList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'nursingStationID',
|
|
|
|
|
model.wardList, (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedWard = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getWards().then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.wardList.length > 0) {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'nursingStationID',
|
|
|
|
@ -271,54 +289,51 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
_selectedWard = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getWards().then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.wardList.length > 0) {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'nursingStationID',
|
|
|
|
|
model.wardList,
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedWard = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).ward,
|
|
|
|
|
_selectedWard != null
|
|
|
|
|
? _selectedWard['description']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.roomCategoryList != null &&
|
|
|
|
|
model.roomCategoryList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).roomCategory,
|
|
|
|
|
dropDownText: _selectedRoomCategory != null
|
|
|
|
|
? _selectedRoomCategory['description']
|
|
|
|
|
: null,
|
|
|
|
|
enabled: false,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
onClick: model.roomCategoryList != null &&
|
|
|
|
|
model.roomCategoryList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'categoryID',
|
|
|
|
|
model.roomCategoryList,
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedRoomCategory =
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getRoomCategories().then(
|
|
|
|
|
(_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.roomCategoryList.length > 0) {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'categoryID',
|
|
|
|
@ -329,52 +344,103 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getRoomCategories().then(
|
|
|
|
|
(_) => GifLoaderDialogUtils
|
|
|
|
|
.hideDialog(context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.roomCategoryList.length >
|
|
|
|
|
0) {
|
|
|
|
|
openListDialogField(
|
|
|
|
|
'description',
|
|
|
|
|
'categoryID',
|
|
|
|
|
model.roomCategoryList,
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedRoomCategory =
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.roomCategory,
|
|
|
|
|
_selectedRoomCategory != null
|
|
|
|
|
? _selectedRoomCategory[
|
|
|
|
|
'description']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).treatmentLine,
|
|
|
|
|
controller: _treatmentLineController,
|
|
|
|
|
inputType: TextInputType.multiline,
|
|
|
|
|
minLines: 3,
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).complications,
|
|
|
|
|
controller: _complicationsController,
|
|
|
|
|
inputType: TextInputType.multiline,
|
|
|
|
|
minLines: 3,
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).otherProcedure,
|
|
|
|
|
controller: _otherProceduresController,
|
|
|
|
|
inputType: TextInputType.multiline,
|
|
|
|
|
minLines: 3,
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
height: screenSize.height * 0.075,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).admissionType,
|
|
|
|
|
dropDownText: _selectedAdmissionType != null
|
|
|
|
|
? _selectedAdmissionType['nameEn']
|
|
|
|
|
: null,
|
|
|
|
|
enabled: false,
|
|
|
|
|
isDropDown: true,
|
|
|
|
|
onClick: model.admissionTypeList != null &&
|
|
|
|
|
model.admissionTypeList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
openListDialogField('nameEn', 'id',
|
|
|
|
|
model.admissionTypeList,
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedAdmissionType =
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model
|
|
|
|
|
.getMasterLookup(MasterKeysService
|
|
|
|
|
.AdmissionRequestType)
|
|
|
|
|
.then((_) =>
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context));
|
|
|
|
|
if (model.state == ViewState.Idle &&
|
|
|
|
|
model.admissionTypeList.length >
|
|
|
|
|
0) {
|
|
|
|
|
openListDialogField('nameEn', 'id',
|
|
|
|
|
model.admissionTypeList,
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedAdmissionType =
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Empty List");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -384,53 +450,91 @@ class _AdmissionRequestSecondScreenState
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
color: HexColor("#B8382B"),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (_estimatedCostController.text != "" &&
|
|
|
|
|
_postPlansEstimatedCostController.text != "" &&
|
|
|
|
|
_expectedDaysController.text != "" &&
|
|
|
|
|
_expectedAdmissionDate != null &&
|
|
|
|
|
_otherDepartmentsInterventionsController.text != "" &&
|
|
|
|
|
_selectedFloor != null &&
|
|
|
|
|
_selectedRoomCategory !=
|
|
|
|
|
null /*_selectedWard is not required*/) {
|
|
|
|
|
model.admissionRequestData = admissionRequest;
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).previous,
|
|
|
|
|
color: HexColor("#EAEAEA"),
|
|
|
|
|
fontColor: Colors.black,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
color: HexColor("#D02127"),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (_estimatedCostController.text != "" &&
|
|
|
|
|
_postPlansEstimatedCostController.text != "" &&
|
|
|
|
|
_expectedDaysController.text != "" &&
|
|
|
|
|
_expectedAdmissionDate != null &&
|
|
|
|
|
_otherDepartmentsInterventionsController.text !=
|
|
|
|
|
"" &&
|
|
|
|
|
_selectedFloor != null &&
|
|
|
|
|
_selectedRoomCategory !=
|
|
|
|
|
null /*_selectedWard is not required*/ &&
|
|
|
|
|
_treatmentLineController.text != "" &&
|
|
|
|
|
_complicationsController.text != "" &&
|
|
|
|
|
_otherProceduresController.text != "" &&
|
|
|
|
|
_selectedAdmissionType != null) {
|
|
|
|
|
model.admissionRequestData = admissionRequest;
|
|
|
|
|
|
|
|
|
|
model.admissionRequestData.estimatedCost =
|
|
|
|
|
int.parse(_estimatedCostController.text);
|
|
|
|
|
model.admissionRequestData.elementsForImprovement =
|
|
|
|
|
_postPlansEstimatedCostController.text;
|
|
|
|
|
model.admissionRequestData.estimatedCost =
|
|
|
|
|
int.parse(_estimatedCostController.text);
|
|
|
|
|
model.admissionRequestData
|
|
|
|
|
.elementsForImprovement =
|
|
|
|
|
_postPlansEstimatedCostController.text;
|
|
|
|
|
|
|
|
|
|
model.admissionRequestData.expectedDays =
|
|
|
|
|
int.parse(_expectedDaysController.text);
|
|
|
|
|
model.admissionRequestData.admissionDate =
|
|
|
|
|
_expectedAdmissionDate.toIso8601String();
|
|
|
|
|
model.admissionRequestData
|
|
|
|
|
.otherDepartmentInterventions =
|
|
|
|
|
_otherDepartmentsInterventionsController.text;
|
|
|
|
|
model.admissionRequestData.admissionLocationID =
|
|
|
|
|
_selectedFloor['floorID'];
|
|
|
|
|
model.admissionRequestData.wardID =
|
|
|
|
|
_selectedWard != null
|
|
|
|
|
? _selectedWard['nursingStationID']
|
|
|
|
|
: 0;
|
|
|
|
|
model.admissionRequestData.roomCategoryID =
|
|
|
|
|
_selectedRoomCategory['categoryID'];
|
|
|
|
|
model.admissionRequestData.expectedDays =
|
|
|
|
|
int.parse(_expectedDaysController.text);
|
|
|
|
|
model.admissionRequestData.admissionDate =
|
|
|
|
|
_expectedAdmissionDate.toIso8601String();
|
|
|
|
|
model.admissionRequestData
|
|
|
|
|
.otherDepartmentInterventions =
|
|
|
|
|
_otherDepartmentsInterventionsController.text;
|
|
|
|
|
model.admissionRequestData.admissionLocationID =
|
|
|
|
|
_selectedFloor['floorID'];
|
|
|
|
|
model.admissionRequestData.wardID =
|
|
|
|
|
_selectedWard != null
|
|
|
|
|
? _selectedWard['nursingStationID']
|
|
|
|
|
: 0;
|
|
|
|
|
model.admissionRequestData.roomCategoryID =
|
|
|
|
|
_selectedRoomCategory['categoryID'];
|
|
|
|
|
|
|
|
|
|
model.admissionRequestData.admissionRequestProcedures =
|
|
|
|
|
[];
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {
|
|
|
|
|
'patient': patient,
|
|
|
|
|
'admission-data': model.admissionRequestData
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context).pleaseFill);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
model.admissionRequestData
|
|
|
|
|
.admissionRequestProcedures = [];
|
|
|
|
|
|
|
|
|
|
model.admissionRequestData.mainLineOfTreatment =
|
|
|
|
|
_treatmentLineController.text;
|
|
|
|
|
model.admissionRequestData.complications =
|
|
|
|
|
_complicationsController.text;
|
|
|
|
|
model.admissionRequestData.otherProcedures =
|
|
|
|
|
_otherProceduresController.text;
|
|
|
|
|
model.admissionRequestData.admissionType =
|
|
|
|
|
_selectedAdmissionType['id'];
|
|
|
|
|
|
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
|
PATIENT_ADMISSION_REQUEST_3,
|
|
|
|
|
arguments: {
|
|
|
|
|
'patient': patient,
|
|
|
|
|
'patientType': patientType,
|
|
|
|
|
'arrivalType': arrivalType,
|
|
|
|
|
'admission-data': model.admissionRequestData
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context).pleaseFill);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|