|
|
|
|
@ -60,15 +60,15 @@ postProcedure(
|
|
|
|
|
sss.add(PrescriptionRequestModel(
|
|
|
|
|
covered: true,
|
|
|
|
|
dose: 1,
|
|
|
|
|
itemId: int.parse(drugId),
|
|
|
|
|
itemId: drugId.isEmpty ? 1 : int.parse(drugId),
|
|
|
|
|
doseUnitId: 1,
|
|
|
|
|
route: int.parse(route),
|
|
|
|
|
frequency: int.parse(frequency),
|
|
|
|
|
route: route.isEmpty ? 1 : int.parse(route),
|
|
|
|
|
frequency: frequency.isEmpty ? 1 : int.parse(frequency),
|
|
|
|
|
remarks: instruction,
|
|
|
|
|
approvalRequired: true,
|
|
|
|
|
icdcode10Id: "test2",
|
|
|
|
|
doseTime: int.parse(doseTimeIn),
|
|
|
|
|
duration: int.parse(duration),
|
|
|
|
|
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
|
|
|
|
|
duration: duration.isEmpty ? 1 : int.parse(duration),
|
|
|
|
|
doseStartDate: doseTime.toIso8601String()));
|
|
|
|
|
postProcedureReqModel.prescriptionRequestModel = sss;
|
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|
|
@ -120,10 +120,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
List<dynamic> durationList;
|
|
|
|
|
List<dynamic> doseTimeList;
|
|
|
|
|
List<dynamic> indicationList;
|
|
|
|
|
String routeInatial = 'By Mouth';
|
|
|
|
|
|
|
|
|
|
//PatiantInformtion patient;
|
|
|
|
|
dynamic _strength;
|
|
|
|
|
dynamic _selectedBranch;
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
@ -260,487 +259,500 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
|
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getDrugs(),
|
|
|
|
|
builder: (BuildContext context, PrescriptionViewModel model,
|
|
|
|
|
Widget child) =>
|
|
|
|
|
DraggableScrollableSheet(
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
minChildSize: 0.9,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 980,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).medicines.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Form(
|
|
|
|
|
key: formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.drugsList != null &&
|
|
|
|
|
model.drugsList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.drugsList,
|
|
|
|
|
attributeName: 'GenericName',
|
|
|
|
|
attributeValueId: 'ItemId',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedDrug =
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).search,
|
|
|
|
|
selectedDrug != null
|
|
|
|
|
? selectedDrug['GenericName']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context, PrescriptionViewModel model, Widget child) =>
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: DraggableScrollableSheet(
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
minChildSize: 0.9,
|
|
|
|
|
builder: (BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 980,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).medicines.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Form(
|
|
|
|
|
key: formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.drugsList != null &&
|
|
|
|
|
model.drugsList.length > 0
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.drugsList,
|
|
|
|
|
attributeName: 'GenericName',
|
|
|
|
|
attributeValueId: 'ItemId',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedDrug = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.searchMedicine,
|
|
|
|
|
selectedDrug != null
|
|
|
|
|
? selectedDrug['GenericName']
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: referToList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: referToList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
type = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderType,
|
|
|
|
|
type != null ? type['name'] : null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText('Order Type'),
|
|
|
|
|
Radio(),
|
|
|
|
|
Text('Regular'),
|
|
|
|
|
Radio(
|
|
|
|
|
value: 1,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text('Urgent'),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: strengthList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: strengthList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strength = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.strength,
|
|
|
|
|
strength != null
|
|
|
|
|
? strength['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: screenSize.height * 0.070,
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: referToList != null
|
|
|
|
|
// ? () {
|
|
|
|
|
// ListSelectDialog dialog =
|
|
|
|
|
// ListSelectDialog(
|
|
|
|
|
// list: referToList,
|
|
|
|
|
// attributeName: 'name',
|
|
|
|
|
// attributeValueId: 'id',
|
|
|
|
|
// okText:
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .ok,
|
|
|
|
|
// okFunction: (selectedValue) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// type = selectedValue;
|
|
|
|
|
// _selectedBranch = null;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// showDialog(
|
|
|
|
|
// barrierDismissible: false,
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder:
|
|
|
|
|
// (BuildContext context) {
|
|
|
|
|
// return dialog;
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// : null,
|
|
|
|
|
// child: TextField(
|
|
|
|
|
// decoration: textFieldSelectorDecoration(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .orderType,
|
|
|
|
|
// type != null ? type['name'] : null,
|
|
|
|
|
// true),
|
|
|
|
|
// enabled: false,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: strengthList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: strengthList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strength = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).strength,
|
|
|
|
|
strength != null
|
|
|
|
|
? strength['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: routeList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: routeList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
route = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).route,
|
|
|
|
|
route != null
|
|
|
|
|
? route['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: routeList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: routeList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
route = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
if (route == null) {
|
|
|
|
|
helpers.showErrorToast(
|
|
|
|
|
'plase fill');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).route,
|
|
|
|
|
route != null ? route['name'] : null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: frequencyList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: frequencyList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
frequency = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.frequency,
|
|
|
|
|
frequency != null
|
|
|
|
|
? frequency['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: frequencyList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: frequencyList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
frequency = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
|
frequency != null
|
|
|
|
|
? frequency['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: doseTimeList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: doseTimeList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
doseTime = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.doseTime,
|
|
|
|
|
doseTime != null
|
|
|
|
|
? doseTime['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: doseTimeList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: doseTimeList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
doseTime = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
|
doseTime != null
|
|
|
|
|
? doseTime['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: indicationList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
indicationList =
|
|
|
|
|
selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.indication,
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: indicationList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
indication = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.indication,
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
selectDate(context, widget.model),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.date,
|
|
|
|
|
selectedDate != null
|
|
|
|
|
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
selectDate(context, widget.model),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).date,
|
|
|
|
|
selectedDate != null
|
|
|
|
|
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: durationList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: durationList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
duration = selectedValue;
|
|
|
|
|
_selectedBranch = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.duration,
|
|
|
|
|
duration != null
|
|
|
|
|
? duration['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: durationList != null
|
|
|
|
|
? () {
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: durationList,
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
duration = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).duration,
|
|
|
|
|
duration != null
|
|
|
|
|
? duration['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
maxLines: 6,
|
|
|
|
|
minLines: 4,
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.instruction,
|
|
|
|
|
controller: instructionController,
|
|
|
|
|
//keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
maxLines: 6,
|
|
|
|
|
minLines: 4,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).instruction,
|
|
|
|
|
controller: instructionController,
|
|
|
|
|
//keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.addMedication,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.addMedication,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState
|
|
|
|
|
.validate()) {
|
|
|
|
|
postProcedure(
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
doseTimeIn:
|
|
|
|
|
doseTime['id'].toString(),
|
|
|
|
|
model: widget.model,
|
|
|
|
|
duration:
|
|
|
|
|
duration['id'].toString(),
|
|
|
|
|
frequency: frequency['id']
|
|
|
|
|
.toString(),
|
|
|
|
|
route: route['id'].toString(),
|
|
|
|
|
drugId: selectedDrug['ItemId']
|
|
|
|
|
.toString(),
|
|
|
|
|
strength:
|
|
|
|
|
strength['id'].toString(),
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
instructionController
|
|
|
|
|
.text,
|
|
|
|
|
doseTime: selectedDate);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) =>
|
|
|
|
|
// NewPrescriptionScreen()),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (strength == null ||
|
|
|
|
|
route == null ||
|
|
|
|
|
frequency == null ||
|
|
|
|
|
indication == null ||
|
|
|
|
|
doseTime == null ||
|
|
|
|
|
duration == null ||
|
|
|
|
|
selectedDrug == null ||
|
|
|
|
|
selectedDate == null) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Please Fill All Fields");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
|
postProcedure(
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
doseTimeIn:
|
|
|
|
|
doseTime['id'].toString(),
|
|
|
|
|
model: widget.model,
|
|
|
|
|
duration:
|
|
|
|
|
duration['id'].toString(),
|
|
|
|
|
frequency:
|
|
|
|
|
frequency['id'].toString(),
|
|
|
|
|
route: route['id'].toString(),
|
|
|
|
|
drugId: selectedDrug['ItemId']
|
|
|
|
|
.toString(),
|
|
|
|
|
strength:
|
|
|
|
|
strength['id'].toString(),
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
instructionController.text,
|
|
|
|
|
doseTime: selectedDate);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) =>
|
|
|
|
|
// NewPrescriptionScreen()),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|