|
|
|
|
@ -121,9 +121,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
bool visbiltySearch = true;
|
|
|
|
|
|
|
|
|
|
final myController = TextEditingController();
|
|
|
|
|
late DateTime selectedDate;
|
|
|
|
|
late int strengthChar;
|
|
|
|
|
late GetMedicationResponseModel _selectedMedication;
|
|
|
|
|
DateTime? selectedDate;
|
|
|
|
|
int? strengthChar;
|
|
|
|
|
GetMedicationResponseModel? _selectedMedication;
|
|
|
|
|
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
|
|
|
|
|
|
|
|
|
TextEditingController drugIdController = TextEditingController();
|
|
|
|
|
@ -358,7 +358,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
visbiltyPrescriptionForm = true;
|
|
|
|
|
visbiltySearch = false;
|
|
|
|
|
_selectedMedication = model.allMedicationList[index];
|
|
|
|
|
uom = _selectedMedication.uom;
|
|
|
|
|
uom = _selectedMedication!.uom;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
@ -417,7 +417,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
setState(() {
|
|
|
|
|
strengthChar = value.length;
|
|
|
|
|
});
|
|
|
|
|
if (strengthChar >= 5) {
|
|
|
|
|
if (strengthChar! >= 5) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context).only5DigitsAllowedForStrength,
|
|
|
|
|
);
|
|
|
|
|
@ -483,7 +483,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
model.getBoxQuantity(
|
|
|
|
|
freq: frequency['parameterCode'],
|
|
|
|
|
duration: duration['id'],
|
|
|
|
|
itemCode: _selectedMedication.itemId!,
|
|
|
|
|
itemCode: _selectedMedication!.itemId!,
|
|
|
|
|
strength: double.parse(strengthController.text));
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
@ -577,7 +577,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
model.getBoxQuantity(
|
|
|
|
|
freq: frequency['parameterCode'],
|
|
|
|
|
duration: duration['id'],
|
|
|
|
|
itemCode: _selectedMedication.itemId!,
|
|
|
|
|
itemCode: _selectedMedication!.itemId!,
|
|
|
|
|
strength: double.parse(strengthController.text),
|
|
|
|
|
);
|
|
|
|
|
box = model.boxQuintity;
|
|
|
|
|
@ -661,7 +661,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
units != null &&
|
|
|
|
|
selectedDate != null &&
|
|
|
|
|
strengthController.text != "") {
|
|
|
|
|
if (_selectedMedication.isNarcotic == true) {
|
|
|
|
|
if (_selectedMedication!.isNarcotic == true) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(TranslationBase.of(context)
|
|
|
|
|
.narcoticMedicineCanOnlyBePrescribedFromVida);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
@ -922,7 +922,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
route: model.itemMedicineListRoute.length == 1
|
|
|
|
|
? model.itemMedicineListRoute[0]['parameterCode'].toString()
|
|
|
|
|
: route['parameterCode'].toString(),
|
|
|
|
|
drugId: _selectedMedication.itemId.toString(),
|
|
|
|
|
drugId: _selectedMedication!.itemId.toString(),
|
|
|
|
|
strength: strengthController.text,
|
|
|
|
|
indication: indicationController.text,
|
|
|
|
|
instruction: instructionController.text,
|
|
|
|
|
@ -958,10 +958,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (_selectedMedication.mediSpanGPICode != null) {
|
|
|
|
|
if (_selectedMedication!.mediSpanGPICode != null) {
|
|
|
|
|
prescriptionDetails.add({
|
|
|
|
|
'DrugId': _selectedMedication.mediSpanGPICode,
|
|
|
|
|
'DrugName': _selectedMedication.description,
|
|
|
|
|
'DrugId': _selectedMedication!.mediSpanGPICode,
|
|
|
|
|
'DrugName': _selectedMedication!.description,
|
|
|
|
|
'Dose': strengthController.text,
|
|
|
|
|
'DoseType': model.itemMedicineListUnit.length == 1
|
|
|
|
|
? model.itemMedicineListUnit[0]['parameterCode'].toString()
|
|
|
|
|
|