From c72d612646c91cebbf2aa9a148401fa1dc50b9e1 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 12 Apr 2021 14:03:08 +0300 Subject: [PATCH] add prescription & add lab test changes --- .../prescription/add_prescription_form.dart | 1445 +++++++++-------- .../entity_list_checkbox_search_widget.dart | 69 +- 2 files changed, 829 insertions(+), 685 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 1330dae4..f6207b52 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -345,8 +345,9 @@ class _PrescriptionFormWidgetState extends State { suggestion .genericName), padding: - EdgeInsets.all(8.0)), + EdgeInsets.all(15.0)), itemSorter: (a, b) => 1, + suggestionsAmount: 7, itemFilter: (suggestion, input) => suggestion.genericName.toLowerCase().startsWith( input.toLowerCase()) || @@ -383,710 +384,844 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds, ), - Container( - child: Row( - children: [ - AppText( - 'Order Type', - fontWeight: FontWeight.w600, - ), - Radio( - activeColor: Color(0xFFB9382C), - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('Regular'), - ], - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.550, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter( - 5), - // WhitelistingTextInputFormatter - // .digitsOnly - ], - hintText: - TranslationBase.of(context) - .strength, - controller: strengthController, - keyboardType: - TextInputType.numberWithOptions( - decimal: true, + Visibility( + visible: _selectedMedication == null + ? false + : true, + child: Container( + child: Column( + children: [ + Container( + child: Row( + children: [ + AppText( + 'Order Type', + fontWeight: FontWeight.w600, + ), + Radio( + activeColor: + Color(0xFFB9382C), + value: 1, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text('Regular'), + ], ), - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 5) { - DrAppToastMsg.showErrorToast( - "Only 5 Digits allowed for strength"); - } - }, - onSubmit: (_) { - if (_selectedMedication != null && - duration != null && - frequency != null && - strengthController.text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); - box = model.boxQuintity; + ), + SizedBox( + height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.550, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter( + 5), + // WhitelistingTextInputFormatter + // .digitsOnly + ], + hintText: + TranslationBase.of( + context) + .strength, + controller: + strengthController, + keyboardType: TextInputType + .numberWithOptions( + decimal: true, + ), + onChanged: (String value) { + setState(() { + strengthChar = + value.length; + }); + if (strengthChar >= 5) { + DrAppToastMsg + .showErrorToast( + "Only 5 Digits allowed for strength"); + } + }, + onSubmit: (_) { + if (_selectedMedication != + null && + duration != null && + frequency != null && + strengthController + .text != + null) { + model.getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: + duration['id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text)); + box = model.boxQuintity; - return; - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, + return; + } + }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), + ), + SizedBox( + width: 10.0, + ), + Container( + color: Colors.white, + width: MediaQuery.of(context) + .size + .width * + 0.350, + child: InkWell( + onTap: + model.itemMedicineListUnit != + null + ? () { + Helpers + .hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .itemMedicineListUnit, + attributeName: + 'description', + attributeValueId: + 'parameterCode', + okText: TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState( + () { + units = + selectedValue; + units['isDefault'] = + true; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: + context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT', + units != null + ? units[ + 'description'] + : null, + true), + enabled: false), + ), + ), + ], + ), ), - ), - SizedBox( - width: 10.0, - ), - Container( - color: Colors.white, - width: MediaQuery.of(context) - .size - .width * - 0.350, - child: InkWell( - onTap: model.itemMedicineListUnit != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = selectedValue; - units['isDefault'] = - true; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext - context) { - return dialog; - }, - ); - } - : null, - child: TextField( + SizedBox( + height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + color: Colors.white, + child: InkWell( + onTap: + model.itemMedicineListRoute != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .itemMedicineListRoute, + attributeName: + 'description', + attributeValueId: + 'parameterCode', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + route = + selectedValue; + route['isDefault'] = + true; + }); + if (route == + null) { + helpers.showErrorToast( + 'plase fill'); + } + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, + child: TextField( decoration: textFieldSelectorDecoration( - 'UNIT', - units != null - ? units[ + TranslationBase.of( + context) + .route, + route != null + ? route[ 'description'] : null, true), - enabled: false), + enabled: false, + ), + ), ), - ), - ], - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: model.itemMedicineListRoute != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: - model.itemMedicineListRoute, - attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - route['isDefault'] = true; - }); - 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['description'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: model.itemMedicineList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.itemMedicineList, - attributeName: 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequency = selectedValue; - frequency['isDefault'] = - true; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController - .text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); + SizedBox( + height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + color: Colors.white, + child: InkWell( + onTap: + model.itemMedicineList != null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .itemMedicineList, + attributeName: + 'description', + attributeValueId: + 'parameterCode', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + frequency = + selectedValue; + frequency[ + 'isDefault'] = + true; + if (_selectedMedication != null && + duration != + null && + frequency != + null && + strengthController + .text != + null) { + model.getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: + duration[ + 'id'], + itemCode: + _selectedMedication + .itemId, + strength: + double.parse( + strengthController.text)); - return; - } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequency != null - ? frequency['description'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: model.medicationDoseTimeList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: 'nameEn', - 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['nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox(height: spaceBetweenTextFileds), - if (model.patientAssessmentList.isNotEmpty) - Container( - height: screenSize.height * 0.070, - width: double.infinity, - color: Colors.white, - child: Row( - children: [ + return; + } + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of( + context) + .frequency, + frequency != null + ? frequency[ + 'description'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: spaceBetweenTextFileds), Container( - width: MediaQuery.of(context) - .size - .width * - 0.29, + height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( - onTap: indicationList != null + onTap: + model.medicationDoseTimeList != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .medicationDoseTimeList, + attributeName: + 'nameEn', + 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['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: spaceBetweenTextFileds), + if (model + .patientAssessmentList.isNotEmpty) + Container( + height: screenSize.height * 0.070, + width: double.infinity, + color: Colors.white, + child: Row( + children: [ + Container( + width: + MediaQuery.of(context) + .size + .width * + 0.29, + child: InkWell( + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + indication != + null + ? indication[ + 'name'] + : null, + false), + enabled: true, + readOnly: true, + ), + ), + ), + Container( + width: + MediaQuery.of(context) + .size + .width * + 0.65, + color: Colors.white, + 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, + false), + enabled: true, + readOnly: true, + ), + ), + ), + ], + ), + ), + SizedBox( + height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, widget.model), + child: TextField( + decoration: + 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, + color: Colors.white, + child: InkWell( + onTap: + model.medicationDurationList != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .medicationDurationList, + attributeName: + 'nameEn', + attributeValueId: + 'id', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + duration = + selectedValue; + if (_selectedMedication != null && + duration != + null && + frequency != + null && + strengthController + .text != + null) { + model + .getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: + duration[ + 'id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text), + ); + box = model + .boxQuintity; + + return; + } + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of( + context) + .duration, + duration != null + ? duration['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + color: Colors.white, + child: InkWell( + onTap: model.allMedicationList != + null ? () { Helpers.hideKeyboard( context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .allMedicationList, + attributeName: 'nameEn', + 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( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != null - ? indication['name'] + "UOM", + uom != null + ? uom : null, false), - enabled: true, + //enabled: false, readOnly: true, ), ), ), + SizedBox( + height: spaceBetweenTextFileds), Container( - width: MediaQuery.of(context) - .size - .width * - 0.65, + height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: indicationList != null + onTap: model.allMedicationList != + null ? () { Helpers.hideKeyboard( context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .allMedicationList, + attributeName: 'nameEn', + 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( - maxLines: 5, decoration: textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != null - ? indication['name'] + "Box Quantity", + box != null + ? "Box Quantity: " + + model + .boxQuintity + .toString() : null, false), - enabled: true, + //enabled: false, readOnly: true, ), ), ), - ], - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: 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, - color: Colors.white, - child: InkWell( - onTap: model.medicationDurationList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - duration = selectedValue; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController - .text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text), - ); - box = model.boxQuintity; - + 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, + ), + ), + SizedBox( + height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + color: Color(0xff359846), + title: TranslationBase.of( + context) + .addMedication, + fontWeight: FontWeight.w600, + onPressed: () { + // formKey.currentState.save(); + // Navigator.pop(context); + // openDrugToDrug(); + if (route == null || + frequency == null || + doseTime == null || + duration == null || + selectedDate == null || + units == null) { + DrAppToastMsg.showErrorToast( + "Please Fill All Fields"); + return; + } + if (_selectedMedication + .isNarcotic == + true) { + DrAppToastMsg.showErrorToast( + "Narcotic medicine can only be prescribed from VIDA"); + Navigator.pop(context); return; } - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - duration != null - ? duration['nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - 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( - "UOM", - uom != null ? uom : null, - false), - //enabled: false, - readOnly: true, - ), - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - color: Colors.white, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.allMedicationList, - attributeName: 'nameEn', - 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( - "Box Quantity", - box != null - ? "Box Quantity: " + - model.boxQuintity.toString() - : null, - false), - //enabled: false, - readOnly: true, - ), - ), - ), - 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, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - color: Color(0xff359846), - title: TranslationBase.of(context) - .addMedication, - fontWeight: FontWeight.w600, - onPressed: () { - // formKey.currentState.save(); - // Navigator.pop(context); - // openDrugToDrug(); - if (route == null || - frequency == null || - doseTime == null || - duration == null || - selectedDate == null || - units == null) { - DrAppToastMsg.showErrorToast( - "Please Fill All Fields"); - return; - } - if (_selectedMedication - .isNarcotic == - true) { - DrAppToastMsg.showErrorToast( - "Narcotic medicine can only be prescribed from VIDA"); - Navigator.pop(context); - return; - } - if (double.parse( - strengthController.text) > - 1000.0) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); - return; - } - if (double.parse( - strengthController.text) < - 0.0) { - DrAppToastMsg.showErrorToast( - "strength can't be zero"); - return; - } + if (double.parse( + strengthController + .text) > + 1000.0) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); + return; + } + if (double.parse( + strengthController + .text) < + 0.0) { + DrAppToastMsg.showErrorToast( + "strength can't be zero"); + return; + } - if (formKey.currentState - .validate()) { - Navigator.pop(context); - openDrugToDrug(model); - { - /*// var x = model - // .patientAssessmentList - // .map((value) => - // value.icdCode10ID) - // .toList() - // .join(','); - - postProcedure( - icdCode: model - .patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .isEmpty - ? "test" - : model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() - : "TEST", - // icdCode: model + if (formKey.currentState + .validate()) { + Navigator.pop(context); + openDrugToDrug(model); + { + /*// var x = model // .patientAssessmentList - // .map((value) => value - // .icdCode10ID - // .trim()) + // .map((value) => + // value.icdCode10ID) // .toList() - // .join(' '), - dose: strengthController.text, - doseUnit: - units['parameterCode'] - .toString(), - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: - frequency['parameterCode'] - .toString(), - route: route['parameterCode'] - .toString(), - drugId: _selectedMedication - .itemId - .toString(), - strength: - strengthController.text, - indication: - indicationController.text, - instruction: - instructionController - .text, - doseTime: selectedDate, - ); - */ - } - } + // .join(','); - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], + postProcedure( + icdCode: model + .patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .isEmpty + ? "test" + : model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() + : "TEST", + // icdCode: model + // .patientAssessmentList + // .map((value) => value + // .icdCode10ID + // .trim()) + // .toList() + // .join(' '), + dose: strengthController.text, + doseUnit: + units['parameterCode'] + .toString(), + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: + frequency['parameterCode'] + .toString(), + route: route['parameterCode'] + .toString(), + drugId: _selectedMedication + .itemId + .toString(), + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + instructionController + .text, + doseTime: selectedDate, + ); + */ + } + } + + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], + ), + ), + ], + ), ), ), ], diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 3426e4cd..4846c8c9 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -133,47 +133,56 @@ class _EntityListCheckboxSearchWidgetState child: Row( children: [ AppText( - TranslationBase.of(context) - .orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); - - historyInfo.type = - value.toString(); - }, + TranslationBase.of(context) + .orderType, + fontWeight: FontWeight.w700, ), - Text('routine'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + Row( + children: [ + Radio( + activeColor: + Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); + + historyInfo.type = + value.toString(); + }, + ), + Text('routine'), + Radio( + activeColor: + Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); - historyInfo.type = - value.toString(); - }, + historyInfo.type = + value.toString(); + }, + ), + Text(TranslationBase.of( + context) + .urgent), + ], ), - Text(TranslationBase.of(context) - .urgent), ], ), ), ), SizedBox( - height: 15.0, + height: 2.0, ), Padding( padding: EdgeInsets.symmetric( - horizontal: 12), + horizontal: 12, vertical: 12.0), child: TextFields( hintText: TranslationBase.of(context) .remarks,