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,27 +55,29 @@ class _LabsHomePageState extends State<LabsHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) if (model.patientLabOrdersList.isNotEmpty &&
Padding( patient.patientStatusType != 43)
padding: const EdgeInsets.all(8.0), Padding(
child: Column( padding: const EdgeInsets.all(8.0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
AppText( children: [
'Lab', AppText(
style: "caption2", 'Lab',
color: Colors.black, style: "caption2",
fontSize: 13, color: Colors.black,
), fontSize: 13,
AppText( ),
'Result', AppText(
bold: true, 'Result',
fontSize: 22, bold: true,
), fontSize: 22,
], ),
],
),
), ),
), if (patient.patientStatusType != null &&
if ( patient.patientStatusType!=null && patient.patientStatusType == 43) patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -95,18 +97,21 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if ( patient.patientStatusType!=null && patient.patientStatusType == 43) if (patient.patientStatusType != null &&
AddNewOrder( onTap: () { patient.patientStatusType == 43)
Navigator.push( AddNewOrder(
context, onTap: () {
MaterialPageRoute( Navigator.push(
builder: (context) => AddSelectedLabOrder( context,
patient: patient, MaterialPageRoute(
model: model, builder: (context) => AddSelectedLabOrder(
)), patient: patient,
); 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(
@ -116,16 +121,16 @@ class _LabsHomePageState extends State<LabsHomePage> {
.patientLabOrdersList[index].patientLabOrdersList .patientLabOrdersList[index].patientLabOrdersList
.map((labOrder) { .map((labOrder) {
return Container( return Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 0.5, width: 0.5,
color: Colors.white, color: Colors.white,
), ),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.0), Radius.circular(8.0),
), ),
color: Colors.white), color: Colors.white),
child: Row( child: Row(
children: [ children: [
Container( Container(
@ -136,12 +141,11 @@ class _LabsHomePageState extends State<LabsHomePage> {
color: labOrder.isLiveCareAppointment color: labOrder.isLiveCareAppointment
? Colors.red[900] ? Colors.red[900]
: !labOrder.isInOutPatient : !labOrder.isInOutPatient
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
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(
@ -150,15 +154,15 @@ class _LabsHomePageState extends State<LabsHomePage> {
child: Text( child: Text(
labOrder.isLiveCareAppointment labOrder.isLiveCareAppointment
? TranslationBase.of(context) ? TranslationBase.of(context)
.liveCare .liveCare
.toUpperCase() .toUpperCase()
: !labOrder.isInOutPatient : !labOrder.isInOutPatient
? TranslationBase.of(context) ? TranslationBase.of(context)
.inPatient .inPatient
.toUpperCase() .toUpperCase()
: TranslationBase.of(context) : TranslationBase.of(context)
.outpatient .outpatient
.toUpperCase(), .toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -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,
@ -159,136 +161,191 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Row(
children: [ children: [
AppText( Container(
'Please Select Category', width: MediaQuery.of(context).size.width * 0.85,
fontWeight: FontWeight.w700, child: AppTextFieldCustom(
fontSize: 20, 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( SizedBox(
width: MediaQuery.of(context).size.width * 0.29, width: MediaQuery.of(context).size.width * 0.02,
), ),
InkWell( InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () { onTap: () {
Navigator.pop(context); model.getProcedureCategory(
categoryName: procedureName.text);
}, },
child: Icon(
Icons.search,
size: 25.0,
),
), ),
], ],
), ),
SizedBox( // SizedBox(
height: 10.0, // width: MediaQuery.of(context).size.width * 0.29,
), // ),
Container( // InkWell(
height: screenSize.height * 0.070, // child: Icon(
child: InkWell( // Icons.close,
onTap: model.categoryList != null && // size: 24.0,
model.categoryList.length > 0 // ),
? () { // onTap: () {
ListSelectDialog dialog = // Navigator.pop(context);
ListSelectDialog( // },
list: model.categoryList, // ),
attributeName: 'categoryName', // ],
attributeValueId: 'categoryId', // ),
okText: TranslationBase.of(context).ok, // SizedBox(
okFunction: (selectedValue) { // height: 10.0,
setState(() { // ),
selectedCategory = selectedValue; // Container(
model.getProcedureCategory( // height: screenSize.height * 0.070,
categoryName: selectedCategory[ // child: InkWell(
'categoryName'], // onTap: model.categoryList != null &&
categoryID: selectedCategory[ // model.categoryList.length > 0
'categoryId'] <= // ? () {
9 // ListSelectDialog dialog =
? "0" + // ListSelectDialog(
selectedCategory[ // list: model.categoryList,
'categoryId'] // attributeName: 'categoryName',
.toString() // attributeValueId: 'categoryId',
: selectedCategory[ // okText: TranslationBase.of(context).ok,
'categoryId'] // okFunction: (selectedValue) {
.toString()); // setState(() {
}); // selectedCategory = selectedValue;
}, // model.getProcedureCategory(
); // categoryName: selectedCategory[
showDialog( // 'categoryName'],
barrierDismissible: false, // categoryID: selectedCategory[
context: context, // 'categoryId'] <=
builder: (BuildContext context) { // 9
return dialog; // ? "0" +
}, // selectedCategory[
); // 'categoryId']
//model.getProcedureCategory(); // .toString()
} // : selectedCategory[
: null, // 'categoryId']
child: TextField( // .toString());
decoration: textFieldSelectorDecoration( // });
TranslationBase.of(context) // },
.procedureCategorise, // );
selectedCategory != null // showDialog(
? selectedCategory['categoryName'] // barrierDismissible: false,
: null, // context: context,
true, // builder: (BuildContext context) {
suffixIcon: Icon( // return dialog;
Icons.search, // },
color: Colors.black, // );
)), // //model.getProcedureCategory();
enabled: false, // }
), // : null,
), // child: TextField(
), // decoration: textFieldSelectorDecoration(
if (widget.model.categoriesList.length != 0) // 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
model: widget.model, // ?
masterList: widget.model EntityListCheckboxSearchWidget(
.categoriesList[0].entityList, model: widget.model,
removeHistory: (item) { masterList:
setState(() { widget.model.categoriesList[0].entityList,
entityList.remove(item); removeHistory: (item) {
}); setState(() {
}, entityList.remove(item);
addHistory: (history) { });
setState(() { },
entityList.add(history); addHistory: (history) {
}); setState(() {
}, entityList.add(history);
addSelectedHistories: () { });
//TODO build your fun herr },
// widget.addSelectedHistories(); addSelectedHistories: () {
}, //TODO build your fun herr
isEntityListSelected: (master) => // widget.addSelectedHistories();
isEntityListSelected(master), },
) isEntityListSelected: (master) =>
: ProcedureListWidget( isEntityListSelected(master),
model: widget.model, )
masterList: widget.model // : ProcedureListWidget(
.categoriesList[0].entityList, // model: widget.model,
removeHistory: (item) { // masterList: widget.model
setState(() { // .categoriesList[0].entityList,
entityList.remove(item); // removeHistory: (item) {
}); // setState(() {
}, // entityList.remove(item);
addHistory: (history) { // });
setState(() { // },
entityList.add(history); // addHistory: (history) {
}); // setState(() {
}, // entityList.add(history);
addSelectedHistories: () { // });
//TODO build your fun herr // },
// widget.addSelectedHistories(); // addSelectedHistories: () {
}, // //TODO build your fun herr
isEntityListSelected: (master) => // // widget.addSelectedHistories();
isEntityListSelected(master), // },
) // isEntityListSelected: (master) =>
: null), // isEntityListSelected(master),
// )
// : 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