|
|
|
|
@ -102,241 +102,232 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
(BuildContext context, ProcedureViewModel model, Widget child) =>
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: DraggableScrollableSheet(
|
|
|
|
|
minChildSize: 0.90,
|
|
|
|
|
initialChildSize: 0.95,
|
|
|
|
|
maxChildSize: 1.0,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 1.20,
|
|
|
|
|
child: Form(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 20.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.65,
|
|
|
|
|
child: Form(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
widget.procedureName.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30.0,
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: screenSize.height * 0.070,
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: model.categoryList != null &&
|
|
|
|
|
// model.categoryList.length > 0
|
|
|
|
|
// ? () {
|
|
|
|
|
// ListSelectDialog dialog =
|
|
|
|
|
// ListSelectDialog(
|
|
|
|
|
// list: model.categoryList,
|
|
|
|
|
// attributeName: 'categoryName',
|
|
|
|
|
// attributeValueId: 'categoryId',
|
|
|
|
|
// okText:
|
|
|
|
|
// TranslationBase.of(context).ok,
|
|
|
|
|
// okFunction: (selectedValue) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// selectedCategory =
|
|
|
|
|
// selectedValue;
|
|
|
|
|
// model.getProcedureCategory(
|
|
|
|
|
// categoryName:
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryName'],
|
|
|
|
|
// categoryID: selectedCategory[
|
|
|
|
|
// 'categoryId'] <=
|
|
|
|
|
// 9
|
|
|
|
|
// ? "0" +
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryId']
|
|
|
|
|
// .toString()
|
|
|
|
|
// : selectedCategory[
|
|
|
|
|
// 'categoryId']
|
|
|
|
|
// .toString());
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// showDialog(
|
|
|
|
|
// barrierDismissible: false,
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder: (BuildContext context) {
|
|
|
|
|
// return dialog;
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// //model.getProcedureCategory();
|
|
|
|
|
// }
|
|
|
|
|
// : null,
|
|
|
|
|
// child: TextField(
|
|
|
|
|
// decoration: textFieldSelectorDecoration(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .procedureCategorise,
|
|
|
|
|
// selectedCategory != null
|
|
|
|
|
// ? selectedCategory['categoryName']
|
|
|
|
|
// : null,
|
|
|
|
|
// true,
|
|
|
|
|
// suffixIcon: Icon(
|
|
|
|
|
// Icons.search,
|
|
|
|
|
// color: Colors.black,
|
|
|
|
|
// )),
|
|
|
|
|
// enabled: false,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// if (widget.model.categoriesList.length != 0)
|
|
|
|
|
// NetworkBaseView(
|
|
|
|
|
// baseViewModel: model,
|
|
|
|
|
// child: selectedCategory != null
|
|
|
|
|
// ? selectedCategory['categoryId'] ==
|
|
|
|
|
// 02 ||
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryId'] ==
|
|
|
|
|
// 03 ||
|
|
|
|
|
// selectedCategory[
|
|
|
|
|
// 'categoryId'] ==
|
|
|
|
|
// 55
|
|
|
|
|
// ? EntityListCheckboxSearchWidget(
|
|
|
|
|
// model: widget.model,
|
|
|
|
|
// masterList: widget
|
|
|
|
|
// .model
|
|
|
|
|
// .categoriesList[0]
|
|
|
|
|
// .entityList,
|
|
|
|
|
// removeHistory: (item) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.remove(item);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addHistory: (history) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.add(history);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addSelectedHistories: () {
|
|
|
|
|
// //TODO build your fun herr
|
|
|
|
|
// // widget.addSelectedHistories();
|
|
|
|
|
// },
|
|
|
|
|
// isEntityListSelected:
|
|
|
|
|
// (master) =>
|
|
|
|
|
// isEntityListSelected(
|
|
|
|
|
// master),
|
|
|
|
|
// )
|
|
|
|
|
// : ProcedureListWidget(
|
|
|
|
|
// model: widget.model,
|
|
|
|
|
// masterList: widget
|
|
|
|
|
// .model
|
|
|
|
|
// .categoriesList[0]
|
|
|
|
|
// .entityList,
|
|
|
|
|
// removeHistory: (item) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.remove(item);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addHistory: (history) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// entityList.add(history);
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// addSelectedHistories: () {
|
|
|
|
|
// //TODO build your fun herr
|
|
|
|
|
// // widget.addSelectedHistories();
|
|
|
|
|
// },
|
|
|
|
|
// isEntityListSelected:
|
|
|
|
|
// (master) =>
|
|
|
|
|
// isEntityListSelected(
|
|
|
|
|
// master),
|
|
|
|
|
// )
|
|
|
|
|
// : null),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
widget.procedureName.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.categoryList != null &&
|
|
|
|
|
model.categoryList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.categoryList,
|
|
|
|
|
attributeName: 'categoryName',
|
|
|
|
|
attributeValueId: 'categoryId',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context).ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedCategory =
|
|
|
|
|
selectedValue;
|
|
|
|
|
model.getProcedureCategory(
|
|
|
|
|
categoryName:
|
|
|
|
|
selectedCategory[
|
|
|
|
|
'categoryName'],
|
|
|
|
|
categoryID: selectedCategory[
|
|
|
|
|
'categoryId'] <=
|
|
|
|
|
9
|
|
|
|
|
? "0" +
|
|
|
|
|
selectedCategory[
|
|
|
|
|
'categoryId']
|
|
|
|
|
.toString()
|
|
|
|
|
: selectedCategory[
|
|
|
|
|
'categoryId']
|
|
|
|
|
.toString());
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
//model.getProcedureCategory();
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.procedureCategorise,
|
|
|
|
|
selectedCategory != null
|
|
|
|
|
? selectedCategory['categoryName']
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (widget.model.categoriesList.length != 0)
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: selectedCategory != null
|
|
|
|
|
? selectedCategory['categoryId'] ==
|
|
|
|
|
02 ||
|
|
|
|
|
selectedCategory[
|
|
|
|
|
'categoryId'] ==
|
|
|
|
|
03 ||
|
|
|
|
|
selectedCategory[
|
|
|
|
|
'categoryId'] ==
|
|
|
|
|
55
|
|
|
|
|
? EntityListCheckboxSearchWidget(
|
|
|
|
|
model: widget.model,
|
|
|
|
|
masterList: widget
|
|
|
|
|
.model
|
|
|
|
|
.categoriesList[0]
|
|
|
|
|
.entityList,
|
|
|
|
|
removeHistory: (item) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.remove(item);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addHistory: (history) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.add(history);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addSelectedHistories: () {
|
|
|
|
|
//TODO build your fun herr
|
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
|
},
|
|
|
|
|
isEntityListSelected:
|
|
|
|
|
(master) =>
|
|
|
|
|
isEntityListSelected(
|
|
|
|
|
master),
|
|
|
|
|
)
|
|
|
|
|
: ProcedureListWidget(
|
|
|
|
|
model: widget.model,
|
|
|
|
|
masterList: widget
|
|
|
|
|
.model
|
|
|
|
|
.categoriesList[0]
|
|
|
|
|
.entityList,
|
|
|
|
|
removeHistory: (item) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.remove(item);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addHistory: (history) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.add(history);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addSelectedHistories: () {
|
|
|
|
|
//TODO build your fun herr
|
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
|
},
|
|
|
|
|
isEntityListSelected:
|
|
|
|
|
(master) =>
|
|
|
|
|
isEntityListSelected(
|
|
|
|
|
master),
|
|
|
|
|
)
|
|
|
|
|
: null),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).orderType),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFB9382C),
|
|
|
|
|
value: 0,
|
|
|
|
|
groupValue: selectedType,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setSelectedType(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Text('routine'),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFB9382C),
|
|
|
|
|
groupValue: selectedType,
|
|
|
|
|
value: 1,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setSelectedType(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Text(TranslationBase.of(context).urgent),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppText(TranslationBase.of(context).orderType),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFB9382C),
|
|
|
|
|
value: 0,
|
|
|
|
|
groupValue: selectedType,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setSelectedType(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12.0,
|
|
|
|
|
Text('routine'),
|
|
|
|
|
Radio(
|
|
|
|
|
activeColor: Color(0xFFB9382C),
|
|
|
|
|
groupValue: selectedType,
|
|
|
|
|
value: 1,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setSelectedType(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
controller: widget.remarksController,
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
minLines: 2,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 2),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.updateProcedure
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// if (entityList.isEmpty == true &&
|
|
|
|
|
// widget.remarksController.text ==
|
|
|
|
|
// widget.remarks) {
|
|
|
|
|
// DrAppToastMsg.showErrorToast(
|
|
|
|
|
// "Fill the mandatory procedure details");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
updateProcedure(
|
|
|
|
|
limetNO: widget.limetNo,
|
|
|
|
|
orderNo: widget.orderNo,
|
|
|
|
|
orderType: selectedType.toString(),
|
|
|
|
|
categorieId: widget.categoryId,
|
|
|
|
|
procedureId: widget.procedureId,
|
|
|
|
|
entityList: entityList,
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
model: widget.model,
|
|
|
|
|
remarks:
|
|
|
|
|
widget.remarksController.text);
|
|
|
|
|
// authorizationForm(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Text(TranslationBase.of(context).urgent),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
controller: widget.remarksController,
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
minLines: 2,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(SizeConfig.widthMultiplier * 2),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.updateProcedure
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// if (entityList.isEmpty == true &&
|
|
|
|
|
// widget.remarksController.text ==
|
|
|
|
|
// widget.remarks) {
|
|
|
|
|
// DrAppToastMsg.showErrorToast(
|
|
|
|
|
// "Fill the mandatory procedure details");
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
updateProcedure(
|
|
|
|
|
limetNO: widget.limetNo,
|
|
|
|
|
orderNo: widget.orderNo,
|
|
|
|
|
orderType: selectedType.toString(),
|
|
|
|
|
categorieId: widget.categoryId,
|
|
|
|
|
procedureId: widget.procedureId,
|
|
|
|
|
entityList: entityList,
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
model: widget.model,
|
|
|
|
|
remarks: widget.remarksController.text);
|
|
|
|
|
// authorizationForm(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
@ -366,22 +357,24 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
|
|
|
|
|
updateProcedureReqModel.lineItemNo = limetNO;
|
|
|
|
|
updateProcedureReqModel.orderNo = orderNo;
|
|
|
|
|
|
|
|
|
|
if (entityList.isNotEmpty) {
|
|
|
|
|
entityList.forEach((element) {
|
|
|
|
|
controls.add(
|
|
|
|
|
Controls(code: "remarks", controlValue: element.remarks ?? ''),
|
|
|
|
|
);
|
|
|
|
|
controls.add(
|
|
|
|
|
Controls(code: "ordertype", controlValue: '1'),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
controlsProcedure.procedure = element.procedureId;
|
|
|
|
|
controlsProcedure.category = int.parse(element.categoryID) > 9
|
|
|
|
|
? element.categoryID
|
|
|
|
|
: "0" + element.categoryID;
|
|
|
|
|
controlsProcedure.controls = controls;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// if (entityList.isNotEmpty) {
|
|
|
|
|
// entityList.forEach((element) {
|
|
|
|
|
// controls.add(
|
|
|
|
|
// Controls(code: "remarks", controlValue: element.remarks ?? ''),
|
|
|
|
|
// );
|
|
|
|
|
// controls.add(
|
|
|
|
|
// Controls(code: "ordertype", controlValue: '1'),
|
|
|
|
|
// );
|
|
|
|
|
//
|
|
|
|
|
// controlsProcedure.procedure = element.procedureId;
|
|
|
|
|
// controlsProcedure.category = int.parse(element.categoryID) > 9
|
|
|
|
|
// ? element.categoryID
|
|
|
|
|
// : "0" + element.categoryID;
|
|
|
|
|
// controlsProcedure.controls = controls;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
{
|
|
|
|
|
controls.add(
|
|
|
|
|
Controls(
|
|
|
|
|
code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""),
|
|
|
|
|
|