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 { Future getProcedureCategory({String categoryName, String categoryID}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [categoryName], search: ["$categoryName"],
patientMRN: 0, patientMRN: 0,
pageIndex: 0, pageIndex: 0,
clinicId: 0, clinicId: 0,
pageSize: 0, pageSize: 0,
category: categoryID ?? "01", category: categoryID ?? null,
); );
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();

@ -55,7 +55,8 @@ class _LabsHomePageState extends State<LabsHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) if (model.patientLabOrdersList.isNotEmpty &&
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -75,7 +76,8 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if ( patient.patientStatusType!=null && patient.patientStatusType == 43) if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -95,8 +97,10 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if ( patient.patientStatusType!=null && patient.patientStatusType == 43) if (patient.patientStatusType != null &&
AddNewOrder( onTap: () { patient.patientStatusType == 43)
AddNewOrder(
onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -105,8 +109,9 @@ class _LabsHomePageState extends State<LabsHomePage> {
model: model, model: model,
)), )),
); );
},label: 'Apply for New Lab Order',), },
label: 'Apply for New Lab Order',
),
...List.generate( ...List.generate(
model.patientLabOrdersList.length, model.patientLabOrdersList.length,
(index) => Column( (index) => Column(
@ -141,7 +146,6 @@ class _LabsHomePageState extends State<LabsHomePage> {
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8), topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8), bottomLeft: Radius.circular(8),
), ),
), ),
child: RotatedBox( child: RotatedBox(
@ -193,18 +197,20 @@ class _LabsHomePageState extends State<LabsHomePage> {
}).toList(), }).toList(),
), ),
), ),
if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) if (model.patientLabOrdersList.isEmpty &&
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: 100,), SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText('No Lab Result Found'), 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/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.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/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
@ -126,6 +127,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List(); List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List(); List<EntityList> entityListProcedure = List();
TextEditingController procedureName = TextEditingController();
dynamic selectedCategory; dynamic selectedCategory;
@ -139,7 +141,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), //onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -160,15 +162,13 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
'Please Select Category', 'Please Enter Procedure',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
SizedBox(
width: MediaQuery.of(context).size.width * 0.29,
),
InkWell( InkWell(
child: Icon( child: Icon(
Icons.close, Icons.close,
@ -177,79 +177,135 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },
), )
], ]),
),
SizedBox( SizedBox(
height: 10.0, height: MediaQuery.of(context).size.height * 0.04,
), ),
Row(
children: [
Container( Container(
height: screenSize.height * 0.070, width: MediaQuery.of(context).size.width * 0.85,
child: InkWell( child: AppTextFieldCustom(
onTap: model.categoryList != null && hintText: 'Search Procedure here...',
model.categoryList.length > 0 isTextFieldHasSuffix: false,
? () {
ListSelectDialog dialog = maxLines: 1,
ListSelectDialog( minLines: 1,
list: model.categoryList, hasBorder: true,
attributeName: 'categoryName', controller: procedureName,
attributeValueId: 'categoryId', // onSubmitted: (_) {
okText: TranslationBase.of(context).ok, // model.getProcedureCategory(
okFunction: (selectedValue) { // categoryName: procedureName.text);
setState(() { // },
selectedCategory = selectedValue; onClick: () {
model.getProcedureCategory( model.getProcedureCategory(
categoryName: selectedCategory[ categoryName: procedureName.text);
'categoryName'],
categoryID: selectedCategory[
'categoryId'] <=
9
? "0" +
selectedCategory[
'categoryId']
.toString()
: selectedCategory[
'categoryId']
.toString());
});
}, },
); ),
showDialog( ),
barrierDismissible: false, SizedBox(
context: context, width: MediaQuery.of(context).size.width * 0.02,
builder: (BuildContext context) { ),
return dialog; InkWell(
onTap: () {
model.getProcedureCategory(
categoryName: procedureName.text);
}, },
); child: Icon(
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search, Icons.search,
color: Colors.black, size: 25.0,
)),
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( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: selectedCategory != null child:
? selectedCategory['categoryId'] == 02 || // selectedCategory != null
selectedCategory['categoryId'] == 03 // ? selectedCategory['categoryId'] == 02 ||
? EntityListCheckboxSearchWidget( // selectedCategory['categoryId'] == 03
// ?
EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: widget.model masterList:
.categoriesList[0].entityList, widget.model.categoriesList[0].entityList,
removeHistory: (item) { removeHistory: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -267,28 +323,29 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
isEntityListSelected: (master) => isEntityListSelected: (master) =>
isEntityListSelected(master), isEntityListSelected(master),
) )
: ProcedureListWidget( // : ProcedureListWidget(
model: widget.model, // model: widget.model,
masterList: widget.model // masterList: widget.model
.categoriesList[0].entityList, // .categoriesList[0].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: (master) => // isEntityListSelected: (master) =>
isEntityListSelected(master), // isEntityListSelected(master),
) // )
: null), // : null,
),
SizedBox( SizedBox(
height: 15.0, height: 15.0,
), ),

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

Loading…
Cancel
Save