adding add procedure & update procedure forms

merge-requests/401/head
hussam al-habibeh 5 years ago
parent e038ec4333
commit ef2de6eb56

@ -64,7 +64,7 @@ class ProcedureScreen extends StatelessWidget {
if (patientType != null && patientType == '7') if (patientType != null && patientType == '7')
InkWell( InkWell(
onTap: () { onTap: () {
//TODO Hussam call the add page here addSelectedProcedure(context, model, patient);
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
@ -112,8 +112,35 @@ class ProcedureScreen extends StatelessWidget {
model.procedureList[0].rowcount, model.procedureList[0].rowcount,
(index) => ProcedureCard( (index) => ProcedureCard(
entityList: model.procedureList[0].entityList[index], entityList: model.procedureList[0].entityList[index],
onTap: (){ onTap: () {
//TODO Hussam call the edit page here if (model.procedureList[0].entityList[index]
.categoryID ==
2 ||
model.procedureList[0].entityList[index]
.categoryID ==
4) {
updateProcedureForm(context,
model: model,
patient: patient,
remarks: model
.procedureList[0].entityList[index].remarks,
orderType: model.procedureList[0]
.entityList[index].orderType
.toString(),
orderNo: model
.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model.procedureList[0]
.entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0]
.entityList[index].lineItemNo);
} else
helpers.showErrorToast(
'You Cant Update This Procedure');
}, },
), ),
), ),

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

Loading…
Cancel
Save