|
|
|
|
@ -210,20 +210,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: (){
|
|
|
|
|
onTap: () {
|
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
|
},
|
|
|
|
|
child: DraggableScrollableSheet(
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
minChildSize: 0.9,
|
|
|
|
|
builder: (BuildContext context, ScrollController scrollController) {
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 1010,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
@ -247,8 +248,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.allMedicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
setState(() {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedMedication = null;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -267,8 +268,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
true,
|
|
|
|
|
),
|
|
|
|
|
itemSubmitted: (item) => setState(
|
|
|
|
|
() =>
|
|
|
|
|
_selectedMedication = item),
|
|
|
|
|
() => _selectedMedication =
|
|
|
|
|
item),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions:
|
|
|
|
|
model.allMedicationList,
|
|
|
|
|
@ -278,19 +279,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: Texts(suggestion
|
|
|
|
|
.description +
|
|
|
|
|
'/' +
|
|
|
|
|
suggestion.genericName),
|
|
|
|
|
suggestion
|
|
|
|
|
.genericName),
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(8.0)),
|
|
|
|
|
itemSorter: (a, b) => 1,
|
|
|
|
|
itemFilter: (suggestion, input) =>
|
|
|
|
|
suggestion.genericName
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.genericName.toLowerCase().startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.description
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
.startsWith(input
|
|
|
|
|
.toLowerCase()) ||
|
|
|
|
|
suggestion.keywords
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
@ -338,19 +338,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width:
|
|
|
|
|
MediaQuery.of(context).size.width *
|
|
|
|
|
0.550,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.550,
|
|
|
|
|
child: TextFields(
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
LengthLimitingTextInputFormatter(4),
|
|
|
|
|
WhitelistingTextInputFormatter
|
|
|
|
|
.digitsOnly
|
|
|
|
|
],
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.strength,
|
|
|
|
|
// inputFormatters: [
|
|
|
|
|
// LengthLimitingTextInputFormatter(
|
|
|
|
|
// 4),
|
|
|
|
|
// WhitelistingTextInputFormatter
|
|
|
|
|
// .digitsOnly
|
|
|
|
|
// ],
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.strength,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
keyboardType: TextInputType.numberWithOptions(decimal: true,),
|
|
|
|
|
onChanged: (String value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strengthChar = value.length;
|
|
|
|
|
@ -375,40 +378,49 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
width: 10.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width:
|
|
|
|
|
MediaQuery.of(context).size.width *
|
|
|
|
|
0.350,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.350,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.medicationStrengthList !=
|
|
|
|
|
null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model
|
|
|
|
|
.medicationStrengthList,
|
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText: TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction:
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
units = selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
onTap:
|
|
|
|
|
model.medicationStrengthList !=
|
|
|
|
|
null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
context);
|
|
|
|
|
ListSelectDialog
|
|
|
|
|
dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model
|
|
|
|
|
.medicationStrengthList,
|
|
|
|
|
attributeName:
|
|
|
|
|
'nameEn',
|
|
|
|
|
attributeValueId:
|
|
|
|
|
'id',
|
|
|
|
|
okText:
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.ok,
|
|
|
|
|
okFunction:
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
units =
|
|
|
|
|
selectedValue;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible:
|
|
|
|
|
false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext
|
|
|
|
|
context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
@ -430,8 +442,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.medicationRouteList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list: model.medicationRouteList,
|
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
|
@ -452,7 +464,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
@ -473,13 +486,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.medicationFrequencyList != null
|
|
|
|
|
onTap: model.medicationFrequencyList !=
|
|
|
|
|
null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list:
|
|
|
|
|
model.medicationFrequencyList,
|
|
|
|
|
list: model
|
|
|
|
|
.medicationFrequencyList,
|
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
@ -494,7 +508,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
@ -502,7 +517,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.frequency,
|
|
|
|
|
frequency != null
|
|
|
|
|
? frequency['nameEn']
|
|
|
|
|
: null,
|
|
|
|
|
@ -515,13 +531,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.medicationDoseTimeList != null
|
|
|
|
|
onTap: model.medicationDoseTimeList !=
|
|
|
|
|
null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list:
|
|
|
|
|
model.medicationDoseTimeList,
|
|
|
|
|
list: model
|
|
|
|
|
.medicationDoseTimeList,
|
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
@ -536,7 +553,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
@ -544,7 +562,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.doseTime,
|
|
|
|
|
doseTime != null
|
|
|
|
|
? doseTime['nameEn']
|
|
|
|
|
: null,
|
|
|
|
|
@ -554,103 +573,74 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
|
|
|
|
|
if (model.patientAssessmentList.isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
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(
|
|
|
|
|
model.patientAssessmentList[0]
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
.toString(),
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.29,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
context);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: true,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
model
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
0]
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
.toString(),
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: true,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.65,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
context);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
model
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
0]
|
|
|
|
|
.asciiDesc
|
|
|
|
|
.toString(),
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: true,
|
|
|
|
|
readOnly: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
//model.patientAssessmentList.forEach((element) { }).
|
|
|
|
|
// Column(
|
|
|
|
|
// children: model.patientAssessmentList
|
|
|
|
|
// .map((element) {
|
|
|
|
|
// return 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(
|
|
|
|
|
// element.icdCode10ID
|
|
|
|
|
// .toString(),
|
|
|
|
|
// indication != null
|
|
|
|
|
// ? indication['name']
|
|
|
|
|
// : null,
|
|
|
|
|
// true),
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// readOnly: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }).toList(),
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
@ -660,7 +650,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
Helpers.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).date,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.date,
|
|
|
|
|
selectedDate != null
|
|
|
|
|
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
@ -677,13 +668,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.medicationDurationList != null
|
|
|
|
|
onTap: model.medicationDurationList !=
|
|
|
|
|
null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
list:
|
|
|
|
|
model.medicationDurationList,
|
|
|
|
|
list: model
|
|
|
|
|
.medicationDurationList,
|
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
okText:
|
|
|
|
|
@ -698,7 +690,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
showDialog(
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
builder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return dialog;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
@ -706,7 +699,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context).duration,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.duration,
|
|
|
|
|
duration != null
|
|
|
|
|
? duration['nameEn']
|
|
|
|
|
: null,
|
|
|
|
|
@ -726,17 +720,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: TextFields(
|
|
|
|
|
maxLines: 6,
|
|
|
|
|
minLines: 4,
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).instruction,
|
|
|
|
|
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),
|
|
|
|
|
@ -763,8 +750,23 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
"Please Fill All Fields");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (int.parse(
|
|
|
|
|
strengthController.text) >
|
|
|
|
|
1000) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"1000 is the MAX for the strength");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (int.parse(
|
|
|
|
|
strengthController.text) ==
|
|
|
|
|
0) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Streangth can't be zero");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
|
if (formKey.currentState
|
|
|
|
|
.validate()) {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
{
|
|
|
|
|
// var x = model
|
|
|
|
|
@ -801,8 +803,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
model: widget.model,
|
|
|
|
|
duration:
|
|
|
|
|
duration['id'].toString(),
|
|
|
|
|
frequency:
|
|
|
|
|
frequency['id'].toString(),
|
|
|
|
|
frequency: frequency['id']
|
|
|
|
|
.toString(),
|
|
|
|
|
route: route['id'].toString(),
|
|
|
|
|
drugId: _selectedMedication
|
|
|
|
|
.itemId
|
|
|
|
|
@ -812,7 +814,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
instructionController.text,
|
|
|
|
|
instructionController
|
|
|
|
|
.text,
|
|
|
|
|
doseTime: selectedDate,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|