add procedure form update

merge-requests/603/head
hussam al-habibeh 5 years ago
parent e252eb6e1f
commit 8a564b34ac

@ -76,12 +76,12 @@ class ProcedureService extends BaseService {
Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [categoryName],
search: ["$categoryName"],
patientMRN: 0,
pageIndex: 0,
clinicId: 0,
pageSize: 0,
category: categoryID ?? "01",
category: categoryID ?? null,
);
hasError = false;
_categoriesList.clear();

@ -55,27 +55,29 @@ class _LabsHomePageState extends State<LabsHomePage> {
SizedBox(
height: 12,
),
if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'Lab',
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
'Result',
bold: true,
fontSize: 22,
),
],
if (model.patientLabOrdersList.isNotEmpty &&
patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'Lab',
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
'Result',
bold: true,
fontSize: 22,
),
],
),
),
),
if ( patient.patientStatusType!=null && patient.patientStatusType == 43)
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -95,18 +97,21 @@ class _LabsHomePageState extends State<LabsHomePage> {
],
),
),
if ( patient.patientStatusType!=null && patient.patientStatusType == 43)
AddNewOrder( onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddSelectedLabOrder(
patient: patient,
model: model,
)),
);
},label: 'Apply for New Lab Order',),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddSelectedLabOrder(
patient: patient,
model: model,
)),
);
},
label: 'Apply for New Lab Order',
),
...List.generate(
model.patientLabOrdersList.length,
(index) => Column(
@ -116,16 +121,16 @@ class _LabsHomePageState extends State<LabsHomePage> {
.patientLabOrdersList[index].patientLabOrdersList
.map((labOrder) {
return Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
child: Row(
children: [
Container(
@ -136,12 +141,11 @@ class _LabsHomePageState extends State<LabsHomePage> {
color: labOrder.isLiveCareAppointment
? Colors.red[900]
: !labOrder.isInOutPatient
? Colors.black
: Color(0xffa9a089),
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
),
child: RotatedBox(
@ -150,15 +154,15 @@ class _LabsHomePageState extends State<LabsHomePage> {
child: Text(
labOrder.isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
.liveCare
.toUpperCase()
: !labOrder.isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
@ -193,18 +197,20 @@ class _LabsHomePageState extends State<LabsHomePage> {
}).toList(),
),
),
if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43)
if (model.patientLabOrdersList.isEmpty &&
patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100,),
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText('No Lab Result Found'),
)
],
),
)

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
@ -126,6 +127,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
TextEditingController procedureName = TextEditingController();
dynamic selectedCategory;
@ -139,7 +141,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(),
//onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
@ -159,136 +161,191 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'Please Enter Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
)
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.04,
),
Row(
children: [
AppText(
'Please Select Category',
fontWeight: FontWeight.w700,
fontSize: 20,
Container(
width: MediaQuery.of(context).size.width * 0.85,
child: AppTextFieldCustom(
hintText: 'Search Procedure here...',
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
hasBorder: true,
controller: procedureName,
// onSubmitted: (_) {
// model.getProcedureCategory(
// categoryName: procedureName.text);
// },
onClick: () {
model.getProcedureCategory(
categoryName: procedureName.text);
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.29,
width: MediaQuery.of(context).size.width * 0.02,
),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
model.getProcedureCategory(
categoryName: procedureName.text);
},
child: Icon(
Icons.search,
size: 25.0,
),
),
],
),
SizedBox(
height: 10.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)
// SizedBox(
// width: MediaQuery.of(context).size.width * 0.29,
// ),
// InkWell(
// child: Icon(
// Icons.close,
// size: 24.0,
// ),
// onTap: () {
// Navigator.pop(context);
// },
// ),
// ],
// ),
// SizedBox(
// height: 10.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 (procedureName.text.isNotEmpty &&
model.procedureList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: selectedCategory != null
? selectedCategory['categoryId'] == 02 ||
selectedCategory['categoryId'] == 03
? 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),
child:
// selectedCategory != null
// ? selectedCategory['categoryId'] == 02 ||
// selectedCategory['categoryId'] == 03
// ?
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,
),
SizedBox(
height: 15.0,
),

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -227,8 +226,7 @@ class _EntityListCheckboxSearchWidgetState
)
: Center(
child: Container(
child: AppText(
"There's no procedures for this category",
child: AppText("Sorry , No Match",
color: Color(0xFFB9382C)),
),
)

Loading…
Cancel
Save