|
|
|
|
@ -68,6 +68,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
int testNum = 0;
|
|
|
|
|
int strengthChar;
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
/// TODO Elham* add type
|
|
|
|
|
dynamic route;
|
|
|
|
|
dynamic doseTime;
|
|
|
|
|
dynamic frequencyUpdate;
|
|
|
|
|
@ -86,6 +87,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
strengthController.text = widget.doseStreangth;
|
|
|
|
|
remarksController.text = widget.remarks;
|
|
|
|
|
indicationList = List();
|
|
|
|
|
/// TODO Elham* create model and try to have them form service and add translation
|
|
|
|
|
|
|
|
|
|
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
|
|
|
|
|
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
|
|
|
|
|
@ -112,6 +114,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
indicationList.add(indication9);
|
|
|
|
|
indicationList.add(indication10);
|
|
|
|
|
}
|
|
|
|
|
/// TODO Elham* Add Translation
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -120,6 +123,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
(BuildContext context, StateSetter setState /*You can rename this!*/) {
|
|
|
|
|
return BaseView<MedicineViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
/// TODO Elham* Move this to view model and remove unused data
|
|
|
|
|
|
|
|
|
|
await model.getMedicationList();
|
|
|
|
|
await model.getMedicationStrength();
|
|
|
|
|
await model.getMedicationDuration();
|
|
|
|
|
@ -172,78 +177,6 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// height: MediaQuery.of(context).size.height *
|
|
|
|
|
// 0.070,
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: model.allMedicationList != null
|
|
|
|
|
// ? () {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// newSelectedMedication = null;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// : null,
|
|
|
|
|
// child: newSelectedMedication == null
|
|
|
|
|
// ? AutoCompleteTextField<
|
|
|
|
|
// GetMedicationResponseModel>(
|
|
|
|
|
// decoration:
|
|
|
|
|
// textFieldSelectorDecoration(
|
|
|
|
|
// widget.drugNameGeneric,
|
|
|
|
|
// newSelectedMedication != null
|
|
|
|
|
// ? newSelectedMedication
|
|
|
|
|
// .genericName
|
|
|
|
|
// : null,
|
|
|
|
|
// true,
|
|
|
|
|
// ),
|
|
|
|
|
// itemSubmitted: (item) => setState(
|
|
|
|
|
// () => newSelectedMedication =
|
|
|
|
|
// item),
|
|
|
|
|
// key: key,
|
|
|
|
|
// suggestions:
|
|
|
|
|
// model.allMedicationList,
|
|
|
|
|
// itemBuilder: (context,
|
|
|
|
|
// suggestion) =>
|
|
|
|
|
// new Padding(
|
|
|
|
|
// child: AppText(suggestion
|
|
|
|
|
// .description +
|
|
|
|
|
// '/' +
|
|
|
|
|
// suggestion.genericName),
|
|
|
|
|
// padding:
|
|
|
|
|
// EdgeInsets.all(8.0)),
|
|
|
|
|
// itemSorter: (a, b) => 1,
|
|
|
|
|
// itemFilter: (suggestion, input) =>
|
|
|
|
|
// suggestion.genericName
|
|
|
|
|
// .toLowerCase()
|
|
|
|
|
// .startsWith(
|
|
|
|
|
// input.toLowerCase()) ||
|
|
|
|
|
// suggestion.description
|
|
|
|
|
// .toLowerCase()
|
|
|
|
|
// .startsWith(
|
|
|
|
|
// input.toLowerCase()) ||
|
|
|
|
|
// suggestion.keywords
|
|
|
|
|
// .toLowerCase()
|
|
|
|
|
// .startsWith(
|
|
|
|
|
// input.toLowerCase()),
|
|
|
|
|
// )
|
|
|
|
|
// : TextField(
|
|
|
|
|
// decoration:
|
|
|
|
|
// textFieldSelectorDecoration(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .searchMedicineNameHere,
|
|
|
|
|
// newSelectedMedication != null
|
|
|
|
|
// ? newSelectedMedication
|
|
|
|
|
// .description +
|
|
|
|
|
// ('${newSelectedMedication.genericName}')
|
|
|
|
|
// : null,
|
|
|
|
|
// true,
|
|
|
|
|
// ),
|
|
|
|
|
// enabled: false,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 12,
|
|
|
|
|
// ),
|
|
|
|
|
Container(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
|
@ -284,15 +217,6 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
"Only 5 Digits allowed for strength");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// if (value.isEmpty &&
|
|
|
|
|
// strengthController.text.length >
|
|
|
|
|
// 4)
|
|
|
|
|
// return TranslationBase.of(context)
|
|
|
|
|
// .emptyMessage;
|
|
|
|
|
// else
|
|
|
|
|
// return null;
|
|
|
|
|
// },
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
@ -805,6 +729,9 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
title: 'update prescription'
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
|
|
/// TODO Elham* Move this to function
|
|
|
|
|
|
|
|
|
|
if (double.parse(
|
|
|
|
|
strengthController.text) >
|
|
|
|
|
1000.0) {
|
|
|
|
|
@ -912,7 +839,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /// TODO Elham* Use it from the textfeild utils
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{Icon suffixIcon}) {
|
|
|
|
|
@ -945,6 +872,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// TODO Elham* Move this to view model and pass all data as model
|
|
|
|
|
updatePrescription(
|
|
|
|
|
{PrescriptionViewModel model,
|
|
|
|
|
int drugId,
|
|
|
|
|
@ -1030,6 +958,9 @@ void updatePrescriptionForm(
|
|
|
|
|
String uom,
|
|
|
|
|
int box,
|
|
|
|
|
String startDate}) {
|
|
|
|
|
|
|
|
|
|
/// TODO Elham* remove unused code.
|
|
|
|
|
|
|
|
|
|
TextEditingController remarksController = TextEditingController();
|
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
|
TextEditingController frequencyController = TextEditingController();
|
|
|
|
|
|