|
|
|
|
@ -63,145 +63,144 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
|
|
|
|
|
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
|
|
|
|
|
AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: NetworkBaseView(
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
),
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
if (procedureType == ProcedureType.PROCEDURE)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.pleaseEnterProcedure,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery.of(context).size.height * 0.02,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width *
|
|
|
|
|
0.79,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchProcedureHere,
|
|
|
|
|
isTextFieldHasSuffix: false,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
controller: procedureName,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: MediaQuery.of(context).size.width *
|
|
|
|
|
0.02,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(12.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
if (procedureType == ProcedureType.PROCEDURE)
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.pleaseEnterProcedure,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery.of(context).size.height * 0.02,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width *
|
|
|
|
|
0.79,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchProcedureHere,
|
|
|
|
|
isTextFieldHasSuffix: false,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
controller: procedureName,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (procedureName.text.isNotEmpty &&
|
|
|
|
|
procedureName.text.length >= 3)
|
|
|
|
|
model.getProcedureCategory(
|
|
|
|
|
patientId: patient.patientId,
|
|
|
|
|
categoryName:
|
|
|
|
|
procedureName.text);
|
|
|
|
|
else
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.atLeastThreeCharacters,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
size: 25.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: MediaQuery.of(context).size.width *
|
|
|
|
|
0.02,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (procedureName.text.isNotEmpty &&
|
|
|
|
|
procedureName.text.length >= 3)
|
|
|
|
|
model.getProcedureCategory(
|
|
|
|
|
patientId: patient.patientId,
|
|
|
|
|
categoryName:
|
|
|
|
|
procedureName.text);
|
|
|
|
|
else
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.atLeastThreeCharacters,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
size: 25.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if ((procedureType == ProcedureType.PROCEDURE
|
|
|
|
|
? procedureName.text.isNotEmpty
|
|
|
|
|
: true) &&
|
|
|
|
|
model.categoriesList.length != 0)
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: EntityListCheckboxSearchWidget(
|
|
|
|
|
model: widget.model,
|
|
|
|
|
masterList:
|
|
|
|
|
model.categoriesList[0].entityList,
|
|
|
|
|
removeHistory: (item) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.remove(item);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addHistory: (history) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.add(history);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addSelectedHistories: () {
|
|
|
|
|
},
|
|
|
|
|
isEntityListSelected: (master) =>
|
|
|
|
|
widget.model.isEntityListSelected(master,entityList),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if ((procedureType == ProcedureType.PROCEDURE
|
|
|
|
|
? procedureName.text.isNotEmpty
|
|
|
|
|
: true) &&
|
|
|
|
|
model.categoriesList.length != 0)
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: EntityListCheckboxSearchWidget(
|
|
|
|
|
model: widget.model,
|
|
|
|
|
masterList:
|
|
|
|
|
model.categoriesList[0].entityList,
|
|
|
|
|
removeProcedure: (item) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.remove(item);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addProcedure: (history) {
|
|
|
|
|
setState(() {
|
|
|
|
|
entityList.add(history);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addSelectedHistories: () {
|
|
|
|
|
},
|
|
|
|
|
isEntityListSelected: (master) =>
|
|
|
|
|
widget.model.isEntityListSelected(master,entityList),
|
|
|
|
|
)),
|
|
|
|
|
SizedBox(height: 10,)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: procedureType.getAddButtonTitle(context),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (entityList.isEmpty == true) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.fillTheMandatoryProcedureDetails,
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await this.model.preparePostProcedure(
|
|
|
|
|
orderType: selectedType.toString(),
|
|
|
|
|
entityList: entityList,
|
|
|
|
|
patient: patient,
|
|
|
|
|
remarks: remarksController.text);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: procedureType.getAddButtonTitle(context),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (entityList.isEmpty == true) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.fillTheMandatoryProcedureDetails,
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await this.model.preparePostProcedure(
|
|
|
|
|
orderType: selectedType.toString(),
|
|
|
|
|
entityList: entityList,
|
|
|
|
|
patient: patient,
|
|
|
|
|
remarks: remarksController.text);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|