diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 074d8a1b..9e6f847f 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -41,6 +41,8 @@ class EntityList { String specialPermission; String subGroup; String template; + String remarks; + String type; EntityList( {this.allowedClinic, @@ -54,7 +56,9 @@ class EntityList { this.procedureName, this.specialPermission, this.subGroup, - this.template}); + this.template, + this.remarks, + this.type}); EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 1ec996fb..98b1f36d 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -75,7 +75,7 @@ class ProcedureService extends BaseService { Future getProcedureCategory({String categoryName, String categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( - search: [""], + search: [categoryName], patientMRN: 0, pageIndex: 0, clinicId: 0, diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 11eadbb0..2fa0c428 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -34,13 +34,12 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { controls.add( - Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), + Controls( + code: "remarks", + controlValue: element.remarks.isNotEmpty ? element.remarks : ""), ); controls.add( - Controls( - code: "ordertype", - controlValue: - orderType.toString().isNotEmpty ? orderType.toString() : '1'), + Controls(code: "ordertype", controlValue: element.type), ); }); @@ -218,43 +217,43 @@ class _AddSelectedProcedureState extends State { Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('routine'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 0, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - ], - ), - ), - SizedBox( - height: 15.0, - ), - TextFields( - hintText: TranslationBase.of(context).remarks, - controller: remarksController, - minLines: 3, - maxLines: 5, - ), + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), SizedBox( - height: 50.0, + height: 100.0, ), Container( margin: EdgeInsets.all( @@ -266,6 +265,7 @@ class _AddSelectedProcedureState extends State { title: TranslationBase.of(context) .addSelectedProcedures, onPressed: () { + //print(entityList.toString()); Navigator.pop(context); postProcedure( orderType: selectedType.toString(), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index a29100f5..73cf0115 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final Function addSelectedHistories; final Function(EntityList) removeHistory; final Function(EntityList) addHistory; + final Function(EntityList) addRemarks; + final bool Function(EntityList) isEntityListSelected; final List masterList; @@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { this.removeHistory, this.masterList, this.addHistory, - this.isEntityListSelected}) + this.isEntityListSelected, + this.addRemarks}) : super(key: key); @override @@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { - int selectedType; + int selectedType = 1; setSelectedType(int val) { setState(() { selectedType = val; @@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState } List items = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { @@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState super.initState(); } + TextEditingController remarksController = TextEditingController(); @override Widget build(BuildContext context) { return Container( @@ -84,34 +90,87 @@ class _EntityListCheckboxSearchWidgetState children: items.map((historyInfo) { return Column( children: [ - Row( + ExpansionTile( + title: Row( + children: [ + Checkbox( + value: widget.isEntityListSelected( + historyInfo), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (widget.isEntityListSelected( + historyInfo)) { + widget.removeHistory( + historyInfo); + } else { + widget + .addHistory(historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts( + historyInfo.procedureName, + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), children: [ - Checkbox( - value: widget.isEntityListSelected( - historyInfo), - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget - .removeHistory(historyInfo); - } else { - widget.addHistory(historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts( - historyInfo.procedureName, - variant: "bodyText", - bold: true, - color: Colors.black), + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context) + .orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 1, + groupValue: selectedType, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); + // historyInfo.type = + // value.toString(); + }, + ), + Text('routine'), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 0, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); + // historyInfo.type = + // value.toString(); + }, + ), + Text(TranslationBase.of(context) + .urgent), + ], ), ), + SizedBox( + height: 15.0, + ), + TextFields( + hintText: + TranslationBase.of(context).remarks, + //controller: remarksController, + onChanged: (value) { + historyInfo.remarks = value; + }, + minLines: 3, + maxLines: 5, + ), ], ), DividerWithSpacesAround(), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 2c502334..038b5d59 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State { isEntityListSelected(master), ), ), - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('routine'), - ], - ), - ), - 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( - hintText: widget.remarks, - fontSize: 15.0, - controller: widget.remarksController, - maxLines: 3, - minLines: 2, - onChanged: (value) {}, - ), - ), + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 0, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 1, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // ], + // ), + // ), + // 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( + // hintText: widget.remarks, + // fontSize: 15.0, + // controller: widget.remarksController, + // maxLines: 3, + // minLines: 2, + // onChanged: (value) {}, + // ), + // ), SizedBox( height: 50.0, ),