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

@ -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<String, dynamic> json) {
allowedClinic = json['allowedClinic'];

@ -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,

@ -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<AddSelectedProcedure> {
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<AddSelectedProcedure> {
title: TranslationBase.of(context)
.addSelectedProcedures,
onPressed: () {
//print(entityList.toString());
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),

@ -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<EntityList> 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<EntityListCheckboxSearchWidget> {
int selectedType;
int selectedType = 1;
setSelectedType(int val) {
setState(() {
selectedType = val;
@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState
}
List<EntityList> items = List();
List<String> remarksList = List();
List<int> 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(),

@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
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,
),

Loading…
Cancel
Save