merge-requests/313/head
hussam al-habibeh 5 years ago
parent cb8b7a4ec4
commit 2563b10216

@ -41,6 +41,8 @@ class EntityList {
String specialPermission; String specialPermission;
String subGroup; String subGroup;
String template; String template;
String remarks;
String type;
EntityList( EntityList(
{this.allowedClinic, {this.allowedClinic,
@ -54,7 +56,9 @@ class EntityList {
this.procedureName, this.procedureName,
this.specialPermission, this.specialPermission,
this.subGroup, this.subGroup,
this.template}); this.template,
this.remarks,
this.type});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
allowedClinic = json['allowedClinic']; allowedClinic = json['allowedClinic'];

@ -75,7 +75,7 @@ class ProcedureService extends BaseService {
Future getProcedureCategory({String categoryName, String categoryID}) async { Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [""], search: [categoryName],
patientMRN: 0, patientMRN: 0,
pageIndex: 0, pageIndex: 0,
clinicId: 0, clinicId: 0,

@ -34,13 +34,12 @@ postProcedure(
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) { entityList.forEach((element) {
controls.add( controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), Controls(
code: "remarks",
controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
); );
controls.add( controls.add(
Controls( Controls(code: "ordertype", controlValue: element.type),
code: "ordertype",
controlValue:
orderType.toString().isNotEmpty ? orderType.toString() : '1'),
); );
}); });
@ -218,43 +217,43 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
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: 1, // value: 1,
groupValue: selectedType, // groupValue: selectedType,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text('routine'), // Text('routine'),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
groupValue: selectedType, // groupValue: selectedType,
value: 0, // value: 0,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text(TranslationBase.of(context).urgent), // Text(TranslationBase.of(context).urgent),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 15.0, // height: 15.0,
), // ),
TextFields( // TextFields(
hintText: TranslationBase.of(context).remarks, // hintText: TranslationBase.of(context).remarks,
controller: remarksController, // controller: remarksController,
minLines: 3, // minLines: 3,
maxLines: 5, // maxLines: 5,
), // ),
SizedBox( SizedBox(
height: 50.0, height: 100.0,
), ),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
@ -266,6 +265,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
title: TranslationBase.of(context) title: TranslationBase.of(context)
.addSelectedProcedures, .addSelectedProcedures,
onPressed: () { onPressed: () {
//print(entityList.toString());
Navigator.pop(context); Navigator.pop(context);
postProcedure( postProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),

@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final Function addSelectedHistories; final Function addSelectedHistories;
final Function(EntityList) removeHistory; final Function(EntityList) removeHistory;
final Function(EntityList) addHistory; final Function(EntityList) addHistory;
final Function(EntityList) addRemarks;
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList; final List<EntityList> masterList;
@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
this.removeHistory, this.removeHistory,
this.masterList, this.masterList,
this.addHistory, this.addHistory,
this.isEntityListSelected}) this.isEntityListSelected,
this.addRemarks})
: super(key: key); : super(key: key);
@override @override
@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> { extends State<EntityListCheckboxSearchWidget> {
int selectedType; int selectedType = 1;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
selectedType = val; selectedType = val;
@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState
} }
List<EntityList> items = List(); List<EntityList> items = List();
List<String> remarksList = List();
List<int> typeList = List();
@override @override
void initState() { void initState() {
@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState
super.initState(); super.initState();
} }
TextEditingController remarksController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -84,34 +90,87 @@ class _EntityListCheckboxSearchWidgetState
children: items.map((historyInfo) { children: items.map((historyInfo) {
return Column( return Column(
children: [ 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: [ children: [
Checkbox( Container(
value: widget.isEntityListSelected( child: Row(
historyInfo), children: [
activeColor: Colors.red[800], AppText(TranslationBase.of(context)
onChanged: (bool newValue) { .orderType),
setState(() { Radio(
if (widget.isEntityListSelected( activeColor: Color(0xFFB9382C),
historyInfo)) { value: 1,
widget groupValue: selectedType,
.removeHistory(historyInfo); onChanged: (value) {
} else { historyInfo.type =
widget.addHistory(historyInfo); setSelectedType(value)
} .toString();
}); // historyInfo.type =
}), // value.toString();
Expanded( },
child: Padding( ),
padding: const EdgeInsets.symmetric( Text('routine'),
horizontal: 10, vertical: 0), Radio(
child: Texts( activeColor: Color(0xFFB9382C),
historyInfo.procedureName, groupValue: selectedType,
variant: "bodyText", value: 0,
bold: true, onChanged: (value) {
color: Colors.black), 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(), DividerWithSpacesAround(),

@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
isEntityListSelected(master), isEntityListSelected(master),
), ),
), ),
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,
groupValue: selectedType, // groupValue: selectedType,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text(TranslationBase.of(context).urgent), // Text(TranslationBase.of(context).urgent),
Radio( // Radio(
activeColor: Color(0xFFB9382C), // activeColor: Color(0xFFB9382C),
groupValue: selectedType, // groupValue: selectedType,
value: 1, // value: 1,
onChanged: (value) { // onChanged: (value) {
setSelectedType(value); // setSelectedType(value);
}, // },
), // ),
Text('routine'), // Text('routine'),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 12.0, // height: 12.0,
), // ),
Container( // Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
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(
hintText: widget.remarks, // hintText: widget.remarks,
fontSize: 15.0, // fontSize: 15.0,
controller: widget.remarksController, // controller: widget.remarksController,
maxLines: 3, // maxLines: 3,
minLines: 2, // minLines: 2,
onChanged: (value) {}, // onChanged: (value) {},
), // ),
), // ),
SizedBox( SizedBox(
height: 50.0, height: 50.0,
), ),

Loading…
Cancel
Save