|
|
|
@ -192,92 +192,92 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.35,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
height: 38,
|
|
|
|
|
validationError: strengthError,
|
|
|
|
|
hintText: 'Strength',
|
|
|
|
|
isTextFieldHasSuffix: false,
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
onChanged: (String value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strengthChar = value.length;
|
|
|
|
|
});
|
|
|
|
|
if (strengthChar >= 5) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.only5DigitsAllowedForStrength,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
inputType: TextInputType.numberWithOptions(
|
|
|
|
|
decimal: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// width: MediaQuery.of(context)
|
|
|
|
|
// .size
|
|
|
|
|
// .width *
|
|
|
|
|
// 0.35,
|
|
|
|
|
// child: AppTextFieldCustom(
|
|
|
|
|
// height: 38,
|
|
|
|
|
// validationError:
|
|
|
|
|
// unitError,
|
|
|
|
|
// hintText: 'Unit',
|
|
|
|
|
// isTextFieldHasSuffix: false,
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// controller:
|
|
|
|
|
// unitController,
|
|
|
|
|
// onChanged: (selectedValue) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// units = selectedValue;
|
|
|
|
|
// units['isDefault'] = true;
|
|
|
|
|
// });
|
|
|
|
|
// if (strengthChar >= 5) {
|
|
|
|
|
// DrAppToastMsg
|
|
|
|
|
// .showErrorToast(
|
|
|
|
|
// TranslationBase.of(
|
|
|
|
|
// context)
|
|
|
|
|
// .only5DigitsAllowedForStrength,
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// inputType: TextInputType
|
|
|
|
|
// .numberWithOptions(
|
|
|
|
|
// decimal: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
PrescriptionTextFiled(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.510,
|
|
|
|
|
element:
|
|
|
|
|
widget.medicineViewModel.itemMedicineListUnit.length == 1
|
|
|
|
|
? widget.medicineViewModel.itemMedicineListUnit[0]
|
|
|
|
|
: units,
|
|
|
|
|
elementError: unitError,
|
|
|
|
|
keyName: 'description',
|
|
|
|
|
keyId: 'parameterCode',
|
|
|
|
|
hintText: 'Unit',
|
|
|
|
|
elementList: widget.medicineViewModel.itemMedicineListUnit,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.35,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
validationError: strengthError,
|
|
|
|
|
hintText: 'Strength',
|
|
|
|
|
isTextFieldHasSuffix: false,
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
onChanged: (String value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
units = selectedValue;
|
|
|
|
|
units['isDefault'] = true;
|
|
|
|
|
strengthChar = value.length;
|
|
|
|
|
});
|
|
|
|
|
if (strengthChar >= 5) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.only5DigitsAllowedForStrength,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
inputType: TextInputType.numberWithOptions(
|
|
|
|
|
decimal: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// width: MediaQuery.of(context)
|
|
|
|
|
// .size
|
|
|
|
|
// .width *
|
|
|
|
|
// 0.35,
|
|
|
|
|
// child: AppTextFieldCustom(
|
|
|
|
|
// height: 38,
|
|
|
|
|
// validationError:
|
|
|
|
|
// unitError,
|
|
|
|
|
// hintText: 'Unit',
|
|
|
|
|
// isTextFieldHasSuffix: false,
|
|
|
|
|
// enabled: true,
|
|
|
|
|
// controller:
|
|
|
|
|
// unitController,
|
|
|
|
|
// onChanged: (selectedValue) {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// units = selectedValue;
|
|
|
|
|
// units['isDefault'] = true;
|
|
|
|
|
// });
|
|
|
|
|
// if (strengthChar >= 5) {
|
|
|
|
|
// DrAppToastMsg
|
|
|
|
|
// .showErrorToast(
|
|
|
|
|
// TranslationBase.of(
|
|
|
|
|
// context)
|
|
|
|
|
// .only5DigitsAllowedForStrength,
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// inputType: TextInputType
|
|
|
|
|
// .numberWithOptions(
|
|
|
|
|
// decimal: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
PrescriptionTextFiled(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.510,
|
|
|
|
|
element:
|
|
|
|
|
widget.medicineViewModel.itemMedicineListUnit.length == 1
|
|
|
|
|
? widget.medicineViewModel.itemMedicineListUnit[0]
|
|
|
|
|
: units,
|
|
|
|
|
elementError: unitError,
|
|
|
|
|
keyName: 'description',
|
|
|
|
|
keyId: 'parameterCode',
|
|
|
|
|
hintText: 'Unit',
|
|
|
|
|
elementList: widget.medicineViewModel.itemMedicineListUnit,
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
units = selectedValue;
|
|
|
|
|
units['isDefault'] = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFields),
|
|
|
|
|
PrescriptionTextFiled(
|
|
|
|
@ -378,8 +378,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFields),
|
|
|
|
|
Container(
|
|
|
|
|
SizedBox(height: spaceBetweenTextFields), Container(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => selectDate(context, widget.prescriptionViewModel),
|
|
|
|
@ -397,7 +396,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
: null,
|
|
|
|
|
enabled: false,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// TextField(
|
|
|
|
@ -538,32 +536,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openDrugToDrug(
|
|
|
|
|
MedicineViewModel medicineViewModel, PrescriptionViewModel modelPrescription) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return AddDrugWidget(
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
medicineModel: widget.medicineViewModel,
|
|
|
|
|
modelPrescription: widget.prescriptionViewModel,
|
|
|
|
|
prescriptionList: widget.prescriptionList,
|
|
|
|
|
route: route,
|
|
|
|
|
doseTime: doseTime,
|
|
|
|
|
duration: duration,
|
|
|
|
|
frequency: frequency,
|
|
|
|
|
units: units,
|
|
|
|
|
uom: uom,
|
|
|
|
|
x: x,
|
|
|
|
|
selectedMedication: widget.selectedMedication,
|
|
|
|
|
strength: strengthController.text,
|
|
|
|
|
indication: indicationController.text,
|
|
|
|
|
instruction: instructionController.text,
|
|
|
|
|
selectedDate: selectedDate,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addMedicationButton(MedicineViewModel model) async {
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
eventCategory: "Add Prescription Form",
|
|
|
|
|